React Native 세팅 에러 모음

Kim Nahyeong·2022년 1월 24일
0

1

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/nahyeongkim/react-native-android/AwesomeProject/android/local.properties'.

https://daesiker.tistory.com/15
이분 글을 참고

cd ios
npx react-native start

애플 실리콘에서 React Native ios 빌드가 안되면 Rosetta 터미널을 설치해서 돌려보면 앱이 돌아간다... 왜지 너무 허탈하다. 아직 안드로이드는 빌드하지 못했음.

2

 Task :app:compileDebugJavaWithJavac FAILED
 Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

mac 내 자바 위치 확인
https://whitepaek.tistory.com/8

아래의 포스팅을 보고 수정해주면 됨. Big Sur 업데이트 후 RN에서 나오는 에러라고 함.... 기절 !
https://lee-it-alls.tistory.com/35

3

에뮬레이터에서 돌아가긴하지만 이상한 에러 발생

node 버전이 높아서 생기는 에러였다. 전부 지우고 다운그레이드하여 해결하였다.

해결!

4

또 ios에서 에러 발생

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening pj.xcworkspace.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace pj.xcworkspace -configuration Debug -scheme pj -destination id=9AE08C7C-995F-43E6-BB26-1E0DFA9E07FF

cd ios
pod update

cd ..
한 후 react native run을 시켜주면 된다... 해결...

5

Requiring module "node_modules/react-native-reanimated/src/Animated.js", which threw an exception: TypeError: undefined is not an object

package.json에서 버전을 다운그레이드 해주고 다시 yarn install 로 재설치 해주면 문제가 해결된다.

0개의 댓글