리액트네이티브

1일 1개발공부˙Day 8

묘걍 2022. 10. 1. 16:12

알바 가기 전에 짬내서

캘린더 작업 계속 하고 있는데

갑자기 Expo Go 어플에서

Somethign went wrong 오류가 계속 나서

아무것도 못 하고 있는 중,,

구글링해서 이것저것 해봐도

도저히 해결이 안 됩니다ㅠㅠㅠ

그래서 일단 지금까지 한 부분만 기록해보려 합니다

 

 

calendar15

yarn add react-native-calendars

yarn add date-fns

yarn add @react-navigation/native

yarn add react-native-vector-icons

yarn add uuid

yarn add react-native-safe-area-context

yarn add @react-native-community/async-storage

yarn add @react-native-community/datetimepicker

yarn add react-native-modal-datetime-picker

 

[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.

To fix this issue try these steps:

 

• Run `react-native link @react-native-community/async-storage` in the project root.

 

• Rebuild and restart the app.

 

• Run the packager with `--reset-cache` flag.

 

• If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app.

 

• If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-community.github.io/async-storage/docs/advanced/jest

 

If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-async-storage/issues

 

 

될지 안 될지는 모르겠지만 일단 따라해본다

 

첫 단계에서 부터 에러가 났다

error: unknown command 'link'

https://exerror.com/command-link-unrecognized-in-react-native/

 

[Solved] Command link unrecognized in React Native

To Solve Command link unrecognized in React Native Error From React-Native 0.69 link and unlink commands have been removed in the favour of a

exerror.com

 

 

계속 yarn으로 해왔으니 yarn 명령어를 찾아서

yarn add @react-native/assets

했는데 해결 안 됨,,

 

그냥 아예 처음 에러로 검색해봤는데

https://stackoverflow.com/questions/56029007/nativemodule-asyncstorage-is-null-with-rnc-asyncstorage

 

NativeModule: AsyncStorage is null, with @RNC/AsyncStorage

I'm working on a React Native project created with Expo. I've been using regular old AsyncStorage, importing from react-native, and all has been well. In looking up how to mock AsyncStorage for te...

stackoverflow.com

 

expo install @react-native-async-storage/async-storage

로 하라고 함

생각해보니 이건 그냥 RN 책이라 Expo는 방법이 좀 다를 수도,,

이 에러는 해결된 듯..!

 

TypeError: undefined is not a function (near '..._reactNative.StyleSheet.ceate...')

내가 레이아웃을 주려고 따로 컴포넌트에 만들었는데

 

import React from "react";
import {StyleSheet, View, Text} from 'react-native';

export const Header = () => {
    return (
        <View style={[styles.container, styles.header]}>
            
        </View>
    );
};
export const Contents = () => {
    return (
        <View style={[styles.container, styles.contents]}>
            
        </View>
    );
};
export const Footer = () => {
    return (
        <View style={[styles.container, styles.Footer]}>
            
        </View>
    );
};

const styles = StyleSheet.ceate({
    container: {
        width: '100%',
        alignItems: 'center',
        justifycontent: 'center',
    },
    header: {
        height: 80,
    },
    contents: {
        height: 360,
    },
    footer: {
        height: 360,
    },
});

 

그게 적용이 잘 안 되는 듯 하다

그냥 App.js에 styles로 해야되나?

어쩌구저쩌구

시간 없어서 다 기록은 못했고

하다보니 floatingwritebutton쪽에서 navigation관련 에러가 났다

나는 여기서 navigation을 안 쓰고 한 화면만 만드니까

없애야되는거라고 생각했는데

navigation을 통해 버튼을 누르면 글쓰기 화면으로 넘어가는 것 같아서

floatingwritebutton에서만 살리기로 했다

yarn add @react-navigation/native

 

 

Error: Couldn't find a navigation object. Is your component inside NavigationContainer?

네비게이션 콘테이너 안 쓸건데 자꾸 이런 에러가...

원래 서로 다른 화면을 한 화면에 합치려니까 힘들다,,

그냥 <NavigationContainer>를 추가해버려?

근데 어디에???

 

(또 다른 에러)

Invariant Violation: "main" has not been registered. This can happen if:

* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.

* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

 

 


잠깐 쉬고 다시 해보려는데 Expo Go 앱이 아예 안된다!

이건 오류가 있어서 그렇다 치고

오류 없이 실행됐던 프로젝트를 열어봐도

Something went wrong 만 뜰 뿐

아무것도 실행되지 않는다,,

https://stackoverflow.com/questions/43002144/cant-load-expo-app-something-went-wrong

 

Can't load expo app: Something went wrong

I've created an expo app with exp init MyApp command and started it by running exp start in MyApp directory. Then I'm scanning barcode which was printed in console with expo mobile app on android ...

stackoverflow.com

 

로컬 호스트 브라우저 앱이 뜰거고 어쩌고

터널로 바꾸라는데

로컬호스트 URL도 안 뜨고 터널도 어떤건지 모르겠다

https://medium.com/@yms0214/expo-error-something-went-wrong-332b240193a8

 

Expo Error. Something went wrong….

Something went wrong. Sorry about that. You can go back to Expo home or try to reload the Experience

medium.com

 

 

다 아니고

폰이랑 노트북이랑 서로 다른 와이파이를 잡고 있었다..

평소에 카공하던 카페에서는 자동으로 둘이 같은 와이파이를 잡아서

신경 안 쓰고 있었,,

https://studioplug.tistory.com/362

 

React Native도구 'Expo'와 실제 Android기기 연결이 안될 때

문제상황  Something went wrong 개발 컴퓨터에 필요한 모듈은 모두 설치하였고, expo init - npm start 로 정상적으로 에뮬레이팅 환경을 띄워놓았다. 이 상태에서 안드로이드 기기 ( 갤S8 ) Expo 앱에서 QR..

studioplug.tistory.com

해결 못 함

https://github.com/expo/expo/issues/3206

 

Expo App Broke but my Application is working · Issue #3206 · expo/expo

READ THIS FIRST, PLEASE! Hello! Thanks for reporting an issue. Please make sure you're posting this in the right place: If this is an issue with Expo CLI, our command line tool, please post it ...

github.com

지우고 다시 설치도 해봄

그래도 안된다...

시간 없는데 나한테 왜이러는건지ㅠㅠㅠㅠ