Unable to run react native project due to java version 10 - react-native

I have got the react native installation done but with latest jdk version that is v10.
Now when I try to run the project using the command react-native run-android, I am getting the following error,
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '10'.
I'm pretty much new to the MAC environment, How do I roll back to the previous working version of java in Mac?
How I can fix this issue?

You need a change in the Android
Gradle properties file.
PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties
Update your distributionUrl to the following
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip

Downgrade the Java version.
This is a problem with the latest version of java.

Related

framework version upgrade causing problem to my project

I was building a react native project and got an upgrade message when I run "yarn run ios":
simctl[5640:1381079] CoreSimulator detected version change. Framework version (857.14) does not match existing job version (857.13). Attempting to remove the stale service in order to add the expected version. error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. SyntaxError: Unexpected token I in JSON at position 0、
However, after this upgrade, there is something wrong with my project. Any suggestion how to back to the old version?
I tried to use other version of ios simulator and tried to clean the xcode build, but its not help.
I ran into a similar issue. The trick was
Quit all iOS simulators
Let Xcode install the newest iOS simulators
Run the project from the Xcode workspace.
After that I was able to start the simulator again from npx react-native run-ios --simulator='iPhone 14' or yarn run iOS

React Native SVG Build Failure due to incompatible versions

I'm attempting to build a coworker's code, which involves building with react-native-svg. Upon build, I get this error:
Task :react-native-svg:compileDebugJavaWithJavac FAILED
After narrowing it down, I discovered that this build failure only happens when I try and use version 13.0.0 and up of react-native-svg. For reference, I'm using React native version 0.64.4. This should be ok according to the version reference on their website:
version chart
I need version 13 at least, otherwise it's too laggy to properly test the code. What is odd to me is that my coworker is able to build just fine on the same codebase, but maybe that's a difference in operating systems (He is on Mac, I'm on Windows). Any help with this would be greatly appreciated!
from what I've read on the official github page https://github.com/software-mansion/react-native-svg, version 13.0.0 and above requires react native version >=0.69.0 due to support of fabric, any versions below it will break
svg version 13.0.0
I was in the same situation as you just now and had to opt for installing version 12.5.0 instead.

App center Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1

I'm using react native to build my apps and thought to give Microsoft app center a chance.
The main issue I have is that I cannot finish the build.
This should be a non-production build that will be tested by the QA team.
This is the error I get:
I have found the issue.
I was the Gradle version, there is no 7.3**
The latest version is 7.1.1 so when I changed the URL to gradle-7.1.1-all.zip It worked.

How to use titanium inspector using titanium 5.2.2?

I am using Appcelerator titanium CLI to build ios app. I want to debug the app With Chrome DevTools but it seems like it's not compatible with the version which I have installed currently.
As per ti-inspector documentation, I have installed the node package by the below command.
npm install -g ti-inspector
So, When I tried this into my titanium project directory I am getting this response which is unexpected.
tn-inspector
Unexpected error: undefined
NOTE: titanium version - 5.2.2
Useful GitHub link: https://github.com/omorandi/TiInspector
Need help to understand or mitigate this issue. Thanks in advance!!!.
That repo is 5 years old and might not be compatible with the current SDK. You can use this instruction: https://docs.axway.com/bundle/Appcelerator_Studio_allOS_en/page/debugging_android_apps_with_3rd-party_tools.html to use the internal dev tools connection.

react-native android app gives error , but iOS works

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.