React Native app can't be started after upgrading to nodejs 12.13 from 10.13 - node.js

My React Native used to run fine with 0.61.2 with Nodej 10.13. There is an error after upgrading to nodejs 12.13.0 when react-native run-android. Here is the error:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1461 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
FAILURE: Build failed with an exception.
* Where:
Script 'C:\D\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 182
* What went wrong:
A problem occurred evaluating script.
> Text must not be null or empty
* 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 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where:
Script 'C:\D\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 182
* What went wrong:
A problem occurred evaluating script.
> Text must not be null or empty
* 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 3s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli\build\index.js:164:9)
./gradlew clean failed as well. What is wrong with the upgrade? Shall I roll back to nodejs 10.13?

Related

Gradle: Could not resolve me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1

I'm trying to upgrade Gradle version from 4.10.3 to 6.8 for project https://archive.apache.org/dist/groovy/2.5.8/sources/apache-groovy-src-2.5.8.zip
and for that I modified build.gradle this way https://gist.github.com/iva-nova-e-katerina/c2fe31c429d19ecf2e08e53f638de451 , but I have the following error building this project:
└─$ ./gradlew -PskipIndy clean distBin 1 ⨯
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'groovy'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1.
Required by:
project :
> Could not resolve me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1.
> Could not get resource 'https://dl.bintray.com/melix/gradle-javadoc-hotfix-plugin/me/champeau/gradle/gradle-javadoc-hotfix-plugin/0.1/gradle-javadoc-hotfix-plugin-0.1.pom'.
> Could not GET 'https://dl.bintray.com/melix/gradle-javadoc-hotfix-plugin/me/champeau/gradle/gradle-javadoc-hotfix-plugin/0.1/gradle-javadoc-hotfix-plugin-0.1.pom'. Received status code 403 from server: Forbidden
* 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 3s
Could you tell me how to fix that?
This plugin found in the repository
maven `{ url "https://repo.spring.io/plugins-release" }
look here https://gitee.com/mirrors/spring-social/blob/master/build.gradle`

Execution failed for task ':app:installDebug'. > com.android.builder.testing.api.DeviceException: No online devices found

When I normally running my react-native from visual code in Android Virtual Device (Emulator) via terminal with npx react-native run android, suddenly I'm facing this error
1. info Running jetifier to migrate libraries to AndroidX. You can
disable it using "--no-jetifier" flag. Jetifier found 954 file(s) to
forward-jetify. Using 8 workers... info Starting JS server... info
Launching emulator... error Failed to launch emulator. Reason: Could
not start emulator within 30 seconds.. warn Please launch an
emulator manually or connect a device. Otherwise app may fail to
launch. info Installing the app...
> Configure project :react-native-firebase_app :react-native-firebase_app package.json found at
C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_app:firebase.bom using default value: 28.1.0
:react-native-firebase_app:play.play-services-auth using default
value: 19.0.0 :react-native-firebase_app package.json found at
C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\#react-native-firebase\app\package.json
:react-native-firebase_app:version set from package.json: 12.1.0
(12,1,0 - 12001000) :react-native-firebase_app:android.compileSdk
using custom value: 29 :react-native-firebase_app:android.targetSdk
using custom value: 29 :react-native-firebase_app:android.minSdk
using custom value: 21
:react-native-firebase_app:reactNativeAndroidDir
C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\react-native\android
> Task :app:installDebug FAILED Skipping device 'emulator-5554' (emulator-5554): Device is OFFLINE. 64 actionable tasks: 2 executed,
62 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 online devices found.
* 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 16s
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:installDebug'.
> com.android.builder.testing.api.DeviceException: No online devices found.
* 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 16s
at makeError (C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\execa\index.js:174:9)
at C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async runOnAllDevices (C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\admin\Desktop\TheOriginalsAgency\Stage-pre-emcauche\MilinusApp\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
I don't know if you already fixed this but I just solved it!
I added more space to the Android Virtual Device.
You have to:
Edit the device or create a new one
On the ¨Verify Configuration¨ page, click on ¨Show Advanced Settings¨
Scroll down to ¨Memory and Storage¨
Change the Internal Storage MB amount
Initially the device that I've created had 2048MB and so I changed it to 6000MB but that wasn't enough so I finally put 10000MB of Internal Storage and with that amount I didn't get this error anymore.
Hope it works, good luck!

I'm trying to run a flutter app but this happens when running gradle task 'assemblyDebug'. How can I get past this

FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not download kotlin-compiler-embeddable.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50)
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.50/kotlin-compiler-embeddable-1.3.50.jar'.
> Connection reset
Could not download fastutil.jar (it.unimi.dsi:fastutil:7.2.0)
> Could not get resource 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
> Connection reset
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 22m 42s
Exception: Gradle task assembleDebug failed with exit code 1

Error when passing an app to my Huawei - Android-studio - Flutter

hello I’m trying to pass by my first made an application(flutter) to my phone(Huawei) but gives me a strange error someone has already gone through the same, can anyone help me? Thank you very much!
ERROR:
Launching lib/main.dart on ALE L21 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/indumonta/AndroidStudioProjects/smarthouse/android/app/src/nullnull/google-services.json
/Users/indumonta/AndroidStudioProjects/smarthouse/android/app/src/debug/google-services.json
/Users/indumonta/AndroidStudioProjects/smarthouse/android/app/src/nullnullDebug/google-services.json
/Users/indumonta/AndroidStudioProjects/smarthouse/android/app/src/nullnull/debug/google-services.json
/Users/indumonta/AndroidStudioProjects/smarthouse/android/app/src/debug/nullnull/google-services.json
/Users/indumonta/AndroidStudioProjects/smarthouse/android/app/google-services.json
* 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 9s
Exception: Gradle task assembleDebug failed with exit code 1

error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`. in Mac

I am setting up an Android development environment. However, there is a problem in the execution environment. I've already finished the configuration, but I keep saying I can't find the device. However, if you run the server and then run it in the Android studio, it will work normally. What's the problem?
bash_profile
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
export PATH=${PATH}:$JAVA_HOME/bin
export ANDROID_PATH=/Users/myname/Library/Android
export PATH=$PATH:$ANDROID_PATH/sdk/platform-tools
export PATH=$PATH:$ANDROID_PATH/sdk/emulator
export PATH=$PATH:$ANDROID_PATH/sdk/tools
export PATH=$PATH:$ANDROID_PATH/sdk/tools/bin
But Error
$ npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
/bin/sh: adb: command not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
Starting a Gradle Daemon, 5 stopped Daemons could not be reused, use --status for details
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
> Task :app:installDebug
> Task :app:installDebug FAILED
27 actionable tasks: 9 executed, 18 up-to-date
[adb]: * daemon not running; starting now at tcp:5037
[adb]: * daemon started successfully
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 22s
error Failed to install the app. Make sure you have an Android emulator running or a device connected. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
[adb]: * daemon not running; starting now at tcp:5037
[adb]: * daemon started successfully
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 22s
at checkExecSyncError (child_process.js:611:11)
at execFileSync (child_process.js:629:15)
at runOnAllDevices (/Users/myname/AwesomeProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Is there anyone who has the same problem as me?
Try the following:
> vim ~/.bash_profile
Add the following lines:
export ANDROID_HOME=/Users/myname/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_PATH/emulator
export PATH=$PATH:$ANDROID_PATH/tools/bin
Save changes and restart terminal.
Run ADB and if you got following it will work.
> adb devices
List of devices attached
emulator-5554 device
If you already configured the .bash_profile check the ANDROID_HOME using echo and then you simply need to run your app with this command :
source ~/.bash_profile && npx react-native run-android
UPDATE
Pay attention to this : You should run bash shell NOT zsh shell to be able to run emulator.

Resources