Skip to content
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

React Native Android app errors upon running #17014

Closed
1 of 4 tasks
antepetkovic0 opened this issue May 14, 2023 · 5 comments · Fixed by #17074
Closed
1 of 4 tasks

React Native Android app errors upon running #17014

antepetkovic0 opened this issue May 14, 2023 · 5 comments · Fixed by #17074
Assignees
Labels
outdated scope: react-native Issues relating to React Native type: bug

Comments

@antepetkovic0
Copy link

Current Behavior

Application created by the React Native plugin can not run for Android. (Installing react-native-config package does not help)
P.S. React Native CLI applications created outside Nx workspace are running normally.

Expected Behavior

Android application should run.

GitHub Repo

https://github.com/antepetkovic0/nx-rn-bug

Steps to Reproduce

  1. nx run mobile:run-android

Nx Report

Node   : 18.16.0
   OS     : win32 x64
   npm    : 9.5.1
   Hasher : Node

   nx (global)        : 16.1.4
   nx                 : 16.1.4
   @nx/js             : 16.1.4
   @nx/jest           : 16.1.4
   @nx/linter         : 16.1.4
   @nx/workspace      : 16.1.4
   @nx/detox          : 16.1.4
   @nx/devkit         : 16.1.4
   @nx/eslint-plugin  : 16.1.4
   @nx/react          : 16.1.4
   @nx/react-native   : 16.1.4
   @nrwl/tao          : 16.1.4
   @nx/web            : 16.1.4
   typescript         : 5.0.4

Failure Logs

> Task :app:compileDebugJavaWithJavac FAILED
31 actionable tasks: 2 executed, 29 up-to-date
C:\Users\antep\Desktop\test-rn-nx\apps\mobile\android\app\src\main\java\com\mobile\MainApplication.java:12: error: package com.lugg.RNCConfig does not exist
import com.lugg.RNCConfig.RNCConfigPackage;
                         ^
1 error

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 12s

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 -PreactNativeDebugArchitectures=x86_64 -PreactNativeArchitectures=x86_64
C:\Users\antep\Desktop\test-rn-nx\apps\mobile\android\app\src\main\java\com\mobile\MainApplication.java:12: error: package com.lugg.RNCConfig does not exist
import com.lugg.RNCConfig.RNCConfigPackage;
                         ^
1 error

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 12s

    at makeError (C:\Users\antep\Desktop\test-rn-nx\node_modules\execa\index.js:174:9)
    at C:\Users\antep\Desktop\test-rn-nx\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (C:\Users\antep\Desktop\test-rn-nx\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
    at async Command.handleAction (C:\Users\antep\Desktop\test-rn-nx\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.

 >  NX   1





 >  NX   Running target run-android for project mobile failed

   Failed tasks:

   - mobile:run-android

   Hint: run the command with --verbose for more details.

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@AgentEnder AgentEnder added the scope: react-native Issues relating to React Native label May 15, 2023
@xiongemi xiongemi self-assigned this May 17, 2023
@xiongemi
Copy link
Collaborator

could you go to test-rn-nx\apps\mobile\android\app\src\main\java\com\mobile\MainApplication.java and delete the line import com.lugg.RNCConfig.RNCConfigPackage;?

@antepetkovic0
Copy link
Author

Yes, already tried that and this is the error I'm getting:

> Task :app:packageDebug FAILED
53 actionable tasks: 5 executed, 48 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > com.android.ide.common.signing.KeytoolException: Failed to read key androiddebugkey from store "C:\Users\antep\Desktop\test-rn-nx\apps\mobile\android\app\debug.keystore": DerInputStream.getLength(): lengthTag=63, too big.

* 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 1m 46s

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 -PreactNativeDebugArchitectures=x86_64 -PreactNativeArchitectures=x86_64

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > com.android.ide.common.signing.KeytoolException: Failed to read key androiddebugkey from store "C:\Users\antep\Desktop\test-rn-nx\apps\mobile\android\app\debug.keystore": DerInputStream.getLength(): lengthTag=63, too big.

* 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 1m 46s

    at makeError (C:\Users\antep\Desktop\test-rn-nx\node_modules\execa\index.js:174:9)
    at C:\Users\antep\Desktop\test-rn-nx\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (C:\Users\antep\Desktop\test-rn-nx\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
    at async Command.handleAction (C:\Users\antep\Desktop\test-rn-nx\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.

 >  NX   1





 >  NX   Running target run-android for project mobile failed

   Failed tasks:

   - mobile:run-android

   Hint: run the command with --verbose for more details.

Will wait your PR to be merged and check if its keystore related
Thanks in advance!

@Arthurmtro
Copy link

Arthurmtro commented May 25, 2023

I still get this with a fresh react native install with nx 16.2.2

BUILD FAILED in 20s

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: /Users/arthurmtro/Developer/projects/garden-grower/apps/mobile/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/VirtualView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Users/arthurmtro/Developer/projects/garden-grower/apps/mobile/android/app/src/main/java/com/garden/MainApplication.java:12: error: package com.lugg.RNCConfig does not exist
import com.lugg.RNCConfig.RNCConfigPackage;
                         ^
1 error

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 20s

    at makeError (/Users/arthurmtro/Developer/projects/garden-grower/node_modules/.pnpm/[email protected]/node_modules/execa/index.js:174:9)
    at /Users/arthurmtro/Developer/projects/garden-grower/node_modules/.pnpm/[email protected]/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/Users/arthurmtro/Developer/projects/garden-grower/node_modules/.pnpm/@[email protected]/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:82:7)
    at async Command.handleAction (/Users/arthurmtro/Developer/projects/garden-grower/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@react-native-community/cli/build/index.js:108:9)
info Run CLI with --verbose flag for more details.

@antepetkovic0
Copy link
Author

Same to me

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants