Im on my way to deploy my Javafx application to Android, I followed the tutorial Empty bin,libs,src folders after creating Android project using Javafx android-tools, I used the Ensemble sample from dalvik-sdk, but after performing assembleDebug, an error was thrown:
* What went wrong:
Execution failed for task ':android:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\AndroidSDK\build-tools\21.1.1\dx.bat -JXmx2g --dex --no-optimize --core-library --output C:\FXSamples\MultiProject\android\build\intermediates\dex\debug --input- list=C:\FXSamples\MultiProject\android\build\intermediates\tmp\dex\debug\inputList.txt
Any idea?
make sure that JVM 1.8 u40 is configured in your machine.
check here
Related
I cloned a react-native project from github and below are the steps that I followed in order to make it work on my local ubuntu 20.04 machine:
(The project was expo managed earlier, but now it is ejected because there are android and ios folders)
created my local feature branch -> git checkout -b feature
installed all the packages in package.json -> yarn install
ran npx react-native run-android to run the app on android emulator
1st Encountered error:-
Could not write standard input to Gradle build daemon.
java.io.IOException: Stream closed
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please read the following process output to find out more:
-----------------------
Unrecognized VM option 'MaxPermSize=512m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
In order to solve this issue, I used this https://stackoverflow.com/a/69630720/11685381 answer and removed -XX:MaxPermSize=512m from my gradle.properties
2nd Encountered error:-
Again used npx react-native run-android and ran into another build error:-
* What went wrong:
Could not open settings generic class cache for settings file '/home/user/project/android/settings.gradle' (/home/user/.gradle/caches/6.9/scripts/5bii70nilhgbvb8zyo7v963b7).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
To fix this, I used this solution: https://www.codegrepper.com/code-examples/whatever/BUG!+exception+in+phase+'semantic+analysis'+in+source+unit+'_BuildScript_'+Unsupported+class+file+major+version+61
3rd Encountered error:-
Again ran npx react-native run-android and ran into these 2 build error this time:
1: Task failed with an exception.
-----------
* Where:
Build file '/home/user/project/node_modules/expo-gl-cpp/android/build.gradle' line: 307
* What went wrong:
Default side-by-side NDK installation is not found.
Set $ANDROID_NDK_HOME environment variable correctly or setup ndk.dir in local.properties.
> NDK is not installed
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':expo'.
> compileSdkVersion is not specified. Please add it to build.gradle
To solve the 1st issue i.e. NDK is not installed (it is installed though), I created a local.properties inside project/android directory and pasted the following path:
sdk.dir=/home/user/Android/Sdk
ndk.dir=/home/user/Android/Sdk/ndk/24.0.8215888
4th Encountered error:-
> Task :app:generatePackageList FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
* Where:
Script '/home/user/project/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' line: 131
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
To solve this, I tried this solution: https://stackoverflow.com/a/68180959/11685381 but this again downloaded the gradle 6.9 which I had earlier also, and again to the 2nd Encountered error
I've been doing this since 2 days, can someone please help me out here what am I doing wrong?
Try updating build.grade from
classpath("com.android.tools.build:gradle:3.5.3")
To
classpath("com.android.tools.build:gradle:3.5.4")
It's just an example. try to update Gradle.
Whenever I try to run 'react-native run-android'
I got failure:
Execution failed for task ':app:packageDebug'
I tried checkout to previus commits.
I tried removing android/app/build and re-build
I tried removing debug.keystore and initiated it again.
none of them solved the problem.
I successfully run my app before in android virtual device, and I've already uploaded my app to google play store, and it works.
I haven't seen this error before. My code worked totally fine before:
I removed some font files in android/src/main/assets/fonts. This maybe the reason.
I ran "react-native run-ios". This may be the reason.
Task :app:packageDebug FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
117 actionable tasks: 5 executed, 112 up-to-date
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:packageDebug'.
4 exceptions were raised by workers:
java.io.UncheckedIOException: java.io.IOException: Execution of compression failed.
java.io.UncheckedIOException: java.io.IOException: Execution of compression failed.
java.io.UncheckedIOException: java.io.IOException: Execution of compression failed.
java.io.UncheckedIOException: java.io.IOException: Execution of compression failed.
BUILD FAILED in 22s
at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (/Users/leonkong/Desktop/dev/CoddingHippo/Native_Makkcha/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39)
at buildAndRun (/Users/leonkong/Desktop/dev/CoddingHippo/Native_Makkcha/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
at then.result (/Users/leonkong/Desktop/dev/CoddingHippo/Native_Makkcha/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)
Build Success message. And running app on virtual device by android studio 2
Clean Gradle
cd android
./gradlew clean
I just restarted my computer and ran ./gradlew assembleRelease again in the project's android folder and it worked.
I also face issue.
I just open Android Studio - Clear Build - Run app.
Works for me
I followed these steps
Uninstall app from emulator
Remove build from android
Run ./gradlew clean in android
Run react-native start --reset-cache
Run react-native run-android
It worked for me
I've been trying to follow the react-native tutorial on udemy, but I've been having trouble getting started: When I try to run the react-native run-android, I've been getting this error:
app:installDebug FAILEDnstallDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: Could not create ADB Bridge.
ADB location: C:\Users\(USERNAME)\AppData\Local\Android\Sdk\platform-tools\adb.exe
I've been using the latest android studio client; I have been using an emulator to simulate a Google Nexus 5, and using the java version that is compatible for the project (the latest, 9.0.9, has been causing problems). I have no familiarity with Genymotion, as it has not been mentioned in the class or is said to be a necessary application; any solutions involving this has not been of any use so far.
Thanks for reading.
I am using android studio 3.0.1, and I got an error:
Error:Could not determine the dependencies of task
':app:compileDebugJavaWithJavac'. Could not create service of type
AnnotationProcessorDetector using
JavaGradleScopeServices.createAnnotationProcessorDetector().
Can you help me to understand the above error and let me know how to fix it in android studio 3.0.1?
It might be a similar issue to mine. Sometimes gradle deamon has not been stopped after your last gradle command execution failed and you got:
* What went wrong:
Execution failed for task ':xxx:compileJava'.
> Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().
To fix that you should run:
./gradlew --stop
and it should display how many deamon workers were active and be able to run gradle task again:
Stopping Daemon(s)
1 Daemon stopped
it seems this issue depend on some errors in your network or firewall please make sure you have full access internet
Run the following command in the terminal:
gradle --stop
https://github.com/gradle/gradle/issues/3708
I could run but I couldn't debug my Java web project on NetBean IDE.
And the error:
D:\2_HOAN CHINH\1_HOC KY II\Java programming\Bai tap\MVC2_VnMart\nbproject\build-impl.xml:845: The following error occurred while executing this line:
D:\2_HOAN CHINH\1_HOC KY II\Java programming\Bai tap\MVC2_VnMart\nbproject\build-impl.xml:851:
java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap
at org.netbeans.api.debugger.jpda.AttachingDICookie.findAttachingConnector(AttachingDICookie.java:250)
at org.netbeans.api.debugger.jpda.AttachingDICookie.create(AttachingDICookie.java:123)
at org.netbeans.api.debugger.jpda.JPDADebugger.attach(JPDADebugger.java:280)
at org.netbeans.modules.debugger.jpda.ant.JPDAConnect$1.run(JPDAConnect.java:228)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1411)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1991)
BUILD FAILED (total time: 0 seconds)
java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap
Check your Bootstrap class. It might be on the wrong folder.
According to this message:
"org.netbeans.modules.debugger.jpda.ant.JPDAConnect$1.run(JPDAConnect.java:228)"
This is a issue of ANT that does not run smoothly under your NetBeans.
So you may try to install another NetBeans distribution and run the project on it.