react-native android app gives error , but iOS works - react-native

i am new to react native
i followed the instructions on facebook react-native site to install java, Android Studio, SDK and SDK tools
the emulator is up and running , paths are correct. but when running the app i get
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ':app'.
Failed to notify project evaluation listener.
javax/xml/bind/annotation/XmlSchema
the same app IOS runs , i even tried Android USB debugging
help please
anyone?

The problem was Java 9. even though react-native site asks you to install Java SDK 8 or later , then 9 installation doesn't work for some reason. I uninstalled 9 and installed 8 and it worked like a charm

This normally happens when the JDK is not correctly installed or the JAVA_HOME has not properly been set. Make sure to export your JAVA_HOME path. and have a working JDK version running on your computer.

Related

info Installing the app... FAILURE: Build failed with an exception. in react native

I am new in react native, I have followed all the instruction as in react native getting started guide. When i enter the 'npx react-native run-android' command. The metro server starts and gives an error.
Metro server error image
Visual Studio Code terminal error
My node and jdk version are the same as mentioned on their website.
node and jdk version
Android sdk versions are also same.
android sdk
I have also tried it on my physical device same error occurs every time.
environment variable is also added.
[Environment variable] (https://i.stack.imgur.com/m8ik1.png)

Library linking issue after upgrading to React Native 0.70.3

We upgraded the mobile development project we are working on to React Native v0.70.3 from 0.66.4 and our build starting to give all sort of issue in our build server after that. Both iOS and Android builds are failing with following error messages.
Android:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-camera-kit:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR:/Users/jenkinsoffshore/CICDBuilds/workspace/Mobile-Service-Android/node_modules/react-native-camera-kit/android/build/intermediates/merged_res/release/values/values.xml:2784: AAPT: error: resource android:attr/lStar not found.
iOS:
iOS build ends in success and we can upload to testflight as well. but getting the following error in email and the app crashes in devices.
ITMS-90863: Apple silicon Macs support issue - The app links with libraries that are not present on Mac:
#rpath/hermes.framework/hermes
After you’ve corrected the issues, you can upload a new binary to App Store Connect
We upgraded the MacOS version to Ventura and Xcode along with in the build machine. In developer machine both builds work fine.
Do we have to do anything specifically after upgrading to React Native 0.70.3?
Downgrade to atmost react-native 0.69
Rebuilding the server completely solve the issue. We had to setup everything from scratch. There must be a simple solution that that but project deadlines made us to go for a full re-inttall.

Is there some special environment for creating desktop app in react native

I was trying to make react native desktop app, I have never used it before its my first time experience and am facing errors I did tried to resolve them but couldnot, i did followed the instructions given on official website, error i am facing right now is:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.target
s(46,5): error MSB8036: The Windows SDK version 10.0.18362.0 was not found.
I installed the sdk but its not going and this is what i see on my terminal
Build failed with message Building Solution returned error code 1. Check your build configuration.
nailed it....!!!
I don't know why but the issue was with the target SDK version 10.0.18362.0...
I installed the latest version and now its working absolutely fine.....

Error in USB debugging live testing in React Native

I am new to React Native and I install React Native and I want to test using y device (Realme 2).
Using USB debugging, but I am stuck on this same mobile using Android Studio runs in ADB.
This stucks at this position I await multiple 15m
info Starting JS server...
info Installing the app...
Configure project :app
File C:\Users\Muhammed Sajid Ali.android\repositories.cfg could not be loaded.
Checking the license for package Android SDK Platform 28 in D:\sajid\AndroidSdk\licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
<======-------> 50% CONFIGURING [15m 0s]
:app
I solved this.
I earlier installed the Android SDK 8, 7.4.4, and 9 versions, but my mobile was 8.1. That’s why
it didn't start and it was downloading SDK 8.1. As I saw in the Android SDK folder, there was a new folder with some files.
Then I downloaded the 8.1 SDK, and it ran perfectly.
I think that was no problem with your compiler behavior, but I can suggest you to check if installing the app from USB is permitted in your phone's developer option and try to trigger the compiler with pressing return key (or enter) on the command line. That was working on mine.

Could not install the app on the device - react native on windows 10

Everytime I try to launch a react native project I got this error
Could not install the app on the device, read the error above for
details. Make sure you have an Android emulator running or a device
connected and have set up your Android development environment
I reinstalled nodejs, python and jdk using choco as suggested on official docs. Every single packages is installed as well as sdk 23.0.1
I can see my virtual device if I run adb devices USB debugging is activated and it's running android 6.
I setup ANDROID_HOME path in environment variables, I'm using same sdk path as you can see in the picture. I also setup another one for JAVA_HOME and Python.
My PATH looks like this:
I just don't understand what I'm supposed to do. I'm using a surface pro 4, Windows 10. I can run projects using expo. I literally tried everything, restart computer, start cmd using admin, create new virtual devices, uninstall everything and start from scratch, it just don't work.
You have pointed out two issues; first, make sure you have an android emulator running. To do that, you run adb devices and you say you can see you device.
The other issue is with the environment. To make sure your environment is setup properly for android, go to the root of your react-native project. Open the android project using android studio.
All errors with your environment will show up, use the automatic fixes provided by android studio. Clean the project in android studio. Close studio and go back to command line, run react-native run-android
Everything should work now.
When doing react-native start it will intentionally hang at "Loading dependency graph" (its not really hanging, its just waiting to receive build/bundle signals). This is correct. You have to open a second terminal then do react-native run-android.
If you get errors, then cd android in your project folder then run ./gradlew clean, then after that do another react-native start then react-native run-android.
Solution is to delete all java JDK and reinstall v8 / change JAVA_HOME to the new path.
Also changing gradle-wrapper.propertiesfile for each project you want to run
# update gradle to latest version
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
Sometimes it dosen't compile with v4 so I have to use v3. React native is definitely confusing.
after install dan update environment JDK now I can install app on my device