Error when init project and run android
Vn-ChemGio opened this issue · 1 comments
Vn-ChemGio commented
Expected results
I want to start install new project with react-native and react-native-template-typescript use react-native cli
Observed results
It take some error and project can't build in android with npx react-native run-android
It return an error
Logs
D:\XXXX>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 870 file(s) to forward-jetify. Using 12 workers...
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :app:compressDebugAssets FAILED
15 actionable tasks: 15 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compressDebugAssets'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CompressAssetsWorkAction
> D:\XXXX\android\app\build\intermediates\merged_assets\debug\out
* 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 18s
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.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compressDebugAssets'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CompressAssetsWorkAction
> D:\XXXX\android\app\build\intermediates\merged_assets\debug\out
* 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 18s
at makeError (D:\XXXX\node_modules\execa\index.js:174:9)
at D:\XXXX\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\XXXX\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\XXXX\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
Steps to reproduce
- Use cli to init project
npx react-native init XXXX--template react-native-template-typescript
- Start server
npx react-native start
- Run in android
npx react-native run-android
radko93 commented
Hi, this template only touches some JS dependencies so it has no effect on the actual Android code. You can try if you can create your project without template. If you have issues you can report them on react-native
repo.