Skip to content

Error when init project and run android #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Vn-ChemGio opened this issue Dec 17, 2021 · 1 comment
Closed

Error when init project and run android #241

Vn-ChemGio opened this issue Dec 17, 2021 · 1 comment

Comments

@Vn-ChemGio
Copy link

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

Untitled

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

  1. Use cli to init project
    npx react-native init XXXX--template react-native-template-typescript
  2. Start server
    npx react-native start
  3. Run in android
    npx react-native run-android
@radko93
Copy link
Collaborator

radko93 commented Dec 17, 2021

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.

@radko93 radko93 closed this as completed Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants