React Native won't launch the simulation - java

Every time I try to execute the "npx react-native run-android" script, I get the following error:
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
Tried playing around with different Android, JDK and Android SDK versions, but nothing helps. Is there a way to fix this problem?

Related

Keycloak server problem Could not find or load main class

I can't run keycloak server, when I try to run kc.bat in windows powershell or cmd with
.\kc.bat
I get the error
Error: Could not find or load main class io.quarkus.bootstrap.runner.QuarkusEntryPoint
Caused by: java.lang.ClassNotFoundException: io.quarkus.bootstrap.runner.QuarkusEntryPoint
I installed quarkus but it doesn't work even tho I installed it
There is an open bug related to this issue.
You have to edit kc.bat line 127 replace : with ;

"java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema" when accepting SDK licenses

Alright so I'm trying to build my React-Native app using Android Studio. I first ran into this error when building:
Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: C:\Users\jaspe\AppData\Local\Android\Sdk
When figuring that out I came across this answer which told me to accept the licenses. However in trying to do so I got the following error:
C:\Users\jaspe\AppData\Local\Android\Sdk\tools\bin>sdkmanager --licenses
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
To resolve which I found this post. I don't use brew, but I tried the second answer. It didn't work, sadly enough. Then I found out I didn't have a JDK installed, so I did that. But with the newest JDK installed I still get an exception:
C:\Users\jaspe\AppData\Local\Android\Sdk\tools\bin>sdkmanager.bat -licenses
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.xml.bind not found
And now I'm not sure what to do anymore. I found an answer explaining I needed to edit my project settings, but I think this doesn't apply to my project, and honestly I'm in a bit over my head. Does someone have experiences with these errors, and can help me fix them? I've spent the whole morning trying to figure this out, I'd expected building a runnable .APK as a demo would be easier...
You are using the wrong sdkmanager, tools directory has been deprecated
Open Android Studio and install the latest command-line tools:
This will create this folder in your Android SDK:
...\Android\Sdk\cmdline-tools\latest\bin
Now use the sdkmanager which is inside the bin directory to accept all the licenses:
C:\Users\jaspe\AppData\Local\Android\Sdk\cmdline-tools\latest\bin>sdkmanager.bat --licenses
#MatPag's answer has the solution I needed, but it took me a while to recognise it. Posting this answer for a specific case incase it helps someone else.
I was trying to setup Unreal Engine v4.25.4 when I encountered this error. I needed to run a batch script that came with Unreal Engine located at:
C:\Program Files\Epic Games\UE_4.25\Engine\Extras\Android\SetupAndroid.bat
which produced the error:
Android Studio Path: C:\Program Files\Android\Android Studio
Android Studio SDK Path: C:\Users\brianb\AppData\Local\Android\Sdk
Using sdkmanager: C:\Users\brianb\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
Update failed. Please check the Android Studio install.
Press any key to continue . . .
Even after I located the sdkmanager.bat script and executed it according to MatPag's answer, my AndroidSetup.bat script was failing.
Eventually I realised the AndroidSetup.bat was trying to call the sdkmanager.bat from the wrong location.
I edited the AndroidSetup.bat file (line 61) as follows to correct the path:
:: set SDKMANAGER=%STUDIO_SDK_PATH%\tools\bin\sdkmanager.bat
set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat

Error: Could not find or load main class C:.Program Caused by: java.lang.ClassNotFoundException: C:.Program java11, intellij IDEA and javafx 11

I am working on a project using Intellij IDEA, JDK 11 and openjfx 11. everything seems to have been configured properly but when I add the path to the Javafx jar and add the needed javafx modules for my project in the VM options and run the code, I the following error
Error: Could not find or load main class C:.Program
Caused by: java.lang.ClassNotFoundException: C:.Program
when I remove the modules and path configuration from the VM options, i get the following error Caused by: java.lang.ClassNotFoundException: javafx.fxml.FXMLLoader , which I think it's because I don't have
the javafx modules in the vm option which are is required when using javafx11
how do I fix this problem? have i done a wrong configuration? I have combed the internet for the past 24 hours but couldn't get the help I wanted. Looking forward to your help. Thanks

IOException with CSSLexer when trying to launchIOSDevice using Eclipse and Gluon

I've successfully tested a simple Gluon Mobile app on Desktop, Android devices and emulators as well as on an iOS emulator. However when launching : launchIOSDevice I get the following error:
IOException with com.sun.javafx.css.parser.CSSLexer$$Lambda$25: null
And the (reduced) stacktrace
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':launchIOSDevice'.
Caused by: java.lang.RuntimeException: IOException with com.sun.javafx.css.parser.CSSLexer$$Lambda$25: null
Caused by: java.io.EOFException
I get the exact same error when try :createIpa.
I have tried different Java and Gradle versions as well as multiple projects, but nothing seems to be portable to an iOS device.
I'm using
'org.javafxports:jfxmobile-plugin:1.3.10'
and
distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip
Has anyone encountered a similar error?
Solution was to delete the contents of the following folder
/Users/<user>/.robovm/cache/ios/arm64/release/Users/<user>/.‌​gradle/caches/module‌​s-2/files-2.1/org.ja‌​vafxports/ios-sdk/8.‌​60.9/<.>/unpacked/io‌​s-sdk/rt/lib/ext/jfx‌​rt.jar/com/sun/javaf‌​x/css/parser
and rerun :clean and :launchIOSDevice
The folder should contain up to CSSLexer$$Lambda$47.class.o for the grade task to build successfully.

libgdx bullet example

I try run this code
http://tinfig.com/git/gdx-bullet-demos/
In Windows it does not work and crashes with an error
Caused by: java.lang.RuntimeException: Couldn't load shared library: 'gdx-bullet' for target Windows 7, 32-bit
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:151)
at com.badlogic.gdx.physics.bullet.Bullet.init(Bullet.java:26)
at com.badlogic.gdx.physics.bullet.demo.screens.SimulationScreen.<clinit>(SimulationScreen.java:38)
At Android working fine.
How fix it?
Thanks.
look if you can see gdx-bullet.dll, put it in the current dir, and start the jvm with this parameter -Djava.library.path="."

Categories

Resources