Could not able to run android with a react native application - android-studio

I am working on a react native application and this is my my first project in react native. I have installed react native, jdk, android studio, done the set up for AVD manager and emulator running also. But when I started to run the app through command line it showing me error Could not install the app on the device.
Can please anyone help me to resolve this issue.
Thanks in advance

Your Java version is 11.try to downgrade or install jdk version 8.

Related

React Native Android No such property - logger for class DefaultProjectDescriptor

I am developing my app using React Native and now when I open the android project in Android Studio, during gradle sync it is throwing this error:
A problem occurred evaluating settings 'MyApp'.
No such property: logger for class: org.gradle.initialization.DefaultProjectDescriptor
Caused by: groovy.lang.MissingPropertyException: No such property: logger for class: org.gradle.initialization.DefaultProjectDescriptor
I tried installing yarn add react-native-unimodules but this won't resolve.
I am using NVM to used node version 14.17.3
Android gradle plugin version: 4.1.0
Gradle version: 6.8
Please help me resolving this as I am stuck on this since 2 days now.
I had the same problem I tried different node versions with nvm and also downgrade android studio but none worked for me. also, I tried installing node via homebrew. What I did was to start android studio using
open -a /Applications/Android\ Studio.app
The problem was that android studio couldn't find node so in this case starting with the above command fixed the problem for me and I used nvm
I was able to resolve this issue by fully shutting down my MacBook Pro and starting it up again. Once started I loaded my project in Android Studio once again and let the gradle build finish.
Fixed this by downgrading Android studio to version 4.1.3.
Before that I installed Node through NVM but it didn`t help
I encountered this exact error on a new MacBook M1 where I formerly used Java 8 with Rosetta (from the migration). After installing Zulu Java 8/11 with ARM-64bit support, I could not build the React Native App anymore.
I simply deleted the .gradle folder (e.g. in ~/.gradle) and executed the build command again. It downloaded Gradle from scratch and the build worked.
The real fix is stackoverflow.com/a/70891538/9878385
Run chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv and this actually fixes the problem, rather than just working around the problem.
Check Android Studio for available updates
Android Studio -> Check For Updates
I have updated Android Studio and Tools to the latest version and this solved the problem. Currently I have Android Studio Chipmunk | 2021.2.1 (Build on April 28, 2022)
I was facing the same issue. It could be some problem with permissions on Android Studio installation.
This might help you to open the project without this error, but it doesn't definitively solve the problem. (Ubuntu linux)
cd App_Name/android/
android-studio .
I had same error using ReactNative and NVM. Installing NodeJS through package manager solved the problem. I guess NVM environment wasn't loaded in Android Studio environment.

React Native: Failed to install the app. Could not find or load main class org.gradle.wrapper.GradleWrapperMain

I recently started my React Native journey and hit a snag before I could even start to code. I followed the guide by Facebook on how to set up your environment for a React Native project, though I installed java SDK, python and node manually instead of through chocolatey. Installing the react native application on my system went smoothly but when I try to run on my Android Emulator by using the command react-native run-android, I run into the following Error message.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
The system cannot find the path specified.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
The system cannot find the path specified.
Note: I have not made any changed in any file nor deleted anything
Steps to reproduce
Run the command react-native init AwesomeProject
cd AwesomeProject
Ensure Emulator is running then start Metro Bundler with react-native start
Run command react-native run-android in a separate terminal to receive error
Steps taken to resolve
I have tried following multiple issues and queries of others with similar problems to no avail
I tried re-installing everything from scratch to no avail, and creating a new project but the same message appears after hours of re-installation
One person suggested running gradle wrapper inside the project folder, but that too made no difference
Another suggested that a file name gradle-wapper.jar would be missing, but its there in the project folder
I tried loading the Android folder of the react native project in my Android Studio, the gradle starts building but there is still no success when the gradle is built
Packages Installed
Node V12.18.2
Java SDK V8
Python 2.7
Android Studio SDK [Android 10.0 (Q)]
Android SDK Build-Tools (Installed)
Android Emulator (Installed)
Android SDK Platform-Tools (Installed)
Intel x86 Emulator Accelerator (HAXM Installer) (Installed)
Please let me know if any further information is required to understand my problem. Thanks!

Cordova Crosswalk: installation of Andoird-apk failed

I'm using cordova-plugin-crosswalk-webview-v3 to create android app with a build-in browser as standard webview in my app.
Cordova can create very simple a android app without any problem. As I added crosswalk (latest version) in cordova, my export are in 2 versions: arm64 and x86_64.
The problem is I cannot install both created apps on my android-device or emulator of android-studio.
I have 2 kind of errors:
first:
after importing the .apk in android-studio : .*so missing
second
after try to running app: INSTALL_FAILED_NO_MATCHING_ABIS
can somebody help me to solve this problem? I also read some issues on github of crosswalk, but they are not interested to replay their issues.
Thank you for your help!
The solution is to set android-minSdkVersion in config.xml to the latest version, like 28. Also just add this code in your config.xml and build the app via cordova build android again:
<preference name="android-minSdkVersion" value="28" />
After that there is a new apk-output, which names debug.apk. This apk is universal and can run on any devices.

VS2015 Cordova apps BLDErr_Build_NodeMissing

I am trying to develop a cordova application using vs2015.I am new to vs2015 corodova application.I have been using the node.js and ionic cli to develop hybrid application.My system is Windows 8.1x64 bit.
After creating a sample vs2015 cordova application while running ,I got an error
"Severity Code Description Project
File Line
Error BLDErr_Build_NodeMissing
Path to Node.js executable could not be determined. Please check that Node.js has been installed".
I have set the path variable for node js and npm in enviorment variable section.
Please help and
Thanks in advance
Ajeesh13
I had the same issue once I had installed Node 4.1 to a different path (other than default C:\ ). Reinstalling Node to default path and clearing the Cordova Cache fixed it for me. Hope this helps.
Running VS'15 in Administrative mode (Right click -> Shift + Right Click on Vs 2015 -> Run as Administrator) ,solved the problem for me.
Re-installing node.js alone didn't solve the problem for me.

Phonegap in Visual Studio 2012 : how to use console.log?

I'm using PhoneGap 3.0.0 and I need to debug a Windows Phone 8 App.
The PhoneGap WP8 documentation is outdated since it's about a downloaded version though NodeJS seems to be mandatory with version 3.0.0.
I can open the project generated by PhoneGap with VS2012 but I don't see any log in the console... Did anybody have the same problem ?
PhoneGap WP8 doc: http://docs.phonegap.com/en/edge/guide_platforms_wp8_index.md.html#Windows%20Phone%208%20Platform%20Guide
I've found the solution: you need to run the application in debug mode (unlike android).
During the Debugg process, go to Debug>Window>JavaScript Console or press Strg+Alt+V
Now you must see the console.log output

Resources