작성
·
728
0
이름이 한글이라서 에러떠서 sdk설치할떄 mklink으로 c: 쪽에 android 폴더새롭게 만들어서 생성했습니다 npx react-native init FoodDeliveryApp --template react-native-template-typescript
그후에 셋팅 해주고
sdk 30 으로 설정하고 에뮬 생성햇습니다
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 936 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Configure project :app
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
> Task :app:installDebug FAILED
37 actionable tasks: 2 executed, 35 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
error Failed to install the app. Make sure you have an Android emulator running or a device connected.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
at makeError (C:\index\FoodDeliveryApp\node_modules\execa\index.js:174:9)
at C:\index\FoodDeliveryApp\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\index\FoodDeliveryApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\index\FoodDeliveryApp\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
이런식으로 에러뜨길래 .. error검색하니까
에뮬레이터 실행안되는 문제라 환경변수라고 생각하여
이렇게 환경변수도 일치하는것을 확인햇는데 왜 에뮬레이터가 실행이안되는지모르겟습니다..
삭제하고 생성도 여러번햇는데... 어렵네요
저 react랑 typescirpt 랑 이거랑 강의3개쨴데
좀도와주십시요...
답변 1
0
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
이게 핵심 에러인것 같은데 이것 관련해서 찾아보세요.
https://github.com/facebook/react-native/issues/33687
RN 몇 버전이신가요?
npm i mime 설치 해보시고 다시 시도해 보세요
저도 같은 현상이 있어서 그냥 팅기고 그랬는데 API31로 해보니 경고 문구 뜨면서 안되고
npx run react-native start가 떠서 그대로 실행하니 can not find module 'mime' 가 나오길래 mime 설치하고
API30 에서도 실행 됐습니다.
참고로 저는 처음에는 잘 되다가 플리퍼 설치후 플리퍼 관련 모듈 설치하고 나서 안되길래 패키지 엄청 설치 했습니다.
네 거기서도 디바이스 매니저에서 run 눌러도 실행을못합니다.