Multi-OS Engine build failed in Android Studio - libgdx

I'm recently getting an error building a Multi-OS engine project using LibGDX in Android Studio. This is the output from the Multi-OS Engine console:
ERROR: Failed to upgradeonly on device, Unknown error
Command failed: [/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant, -jar, /Users/camilo/.moe/moe-sdk-1.3.0-beta-2/tools/ios-device.jar, --app-path=/path/to/my/project/ios-moe/build/moe/xcodebuild/Debug-iphoneos/MyApp.app, --wait-for-device, --launch-arg=-args, --launch-arg=--debug, --install-mode=upgradeonly]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ios-moe:moeLaunch'.
> Process exited with non-zero exit value
* Try:
:ios-moe:moeLaunch FAILED
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
My gradle looks like this:
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'org.multi-os-engine:moe-gradle:1.3.3'
}
}
LibGDX version = 1.9.6
Nonetheless the Application is installed in the device, but I cannot see the logs in the console. When I change the build target to Simulator it works just fine.

Problem solved, my iPhone has updated to 10.3.1 and Xcode didn't have the DeveloperDiskImage corresponding to the latest iOS version, so I had to update Xcode too to version 8.3.1.

Related

when use this library :----- react-native-tesseract-ocr

D:\OCR2>npm run android
OCR2#0.0.1 android
react-native run-android
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
at makeError (D:\OCR2\node_modules\execa\index.js:174:9)
at D:\OCR2\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\OCR2\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\OCR2\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
D:\OCR2> npm i rn-text-detector --save
added 1 package, and audited 974 packages in 3s
102 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
D:\OCR2>npm run android --warning-mode=all
OCR2#0.0.1 android
react-native run-android
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file 'D:\OCR2\node_modules\react-native-tesseract-ocr\android\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
Plugin with id 'maven' not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
Get more help at https://help.gradle.org
BUILD FAILED in 6s
at makeError (D:\OCR2\node_modules\execa\index.js:174:9)
at D:\OCR2\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\OCR2\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\OCR2\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
D:\OCR2>
i found a soluation
android/build.gradle
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
kotlinVersion = "1.5.31" //use this line -----------
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}

Build failed with an exception Execution failed for task ':app:processDebugResources'. >

Launching lib\main.dart on Snap 4G2 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Android resource linking failed
Output: error: resource android:attr/fontVariationSettings not found.
C:\Users\rajesh.yadav\AndroidStudioProjects\microfinance\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:337: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: C:\Users\rajesh.yadav.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\333594338724db9cac843ec5e02726f3\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\rajesh.yadav\AppData\Local\Android\sdk\platforms\android-27\android.jar\
--manifest\
C:\Users\rajesh.yadav\AndroidStudioProjects\microfinance\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\rajesh.yadav\AndroidStudioProjects\microfinance\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
C:\Users\rajesh.yadav\AndroidStudioProjects\microfinance\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
BUILD FAILED in 2m 25s
Finished with error: Gradle task assembleDebug failed with exit code 1
You're using compile SDK version 27 (that's why android-27\android.jar is passed to AAPT2), but you or one of your dependencies is using resources from SDK version 28 (i.e. fontVariationSettings and ttcIndex). Update your compile SDK version in your build.gradle file to version 28.

Setup libGDX project using MOE plugin

How to setup the libGDX project using MOE plugin.
If i try to select ios-moe at the setup of libGDX project then my build fails with following error.
Generating app in
/Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame Executing
'/Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame/gradlew
clean --no-daemon' To honour the JVM settings for this build a new JVM
will be forked. Please consider using the daemon:
https://docs.gradle.org/2.10/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project
'SampleGame'.
Could not resolve all dependencies for configuration ':classpath'.
Could not find com.intel.gradle:moeGradlePlugin:1.1.0.final-1.
Searched in the following locations:
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
Required by: :SampleGame:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info
or --debug option to get more log output.
BUILD FAILED
Total time: 8.492 secs Done! To import in Eclipse: File -> Import ->
Gradle -> Gradle Project To import to Intellij IDEA: File -> Open ->
build.gradle To import to NetBeans: File -> Open Project...
I had the same problem from time to time. Use the newest version of the multi os engine, which requires no local installation.
Multi-OS Engine Release 1.1.0
Samples Repository on GitHub

LibGDX - HTML5 Run&Deploy

I'm using Android Studio.
I want to run and deploy my application on HTML5.
I'm entering the command "gradlew.bat html:superDev" on the Terminal, but it gives me that error message:
Execution failed for task ':core:compileJava'. Could not find tools.jar
How can I solve this problem?
Here's the full error message:
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Configuration on demand is an incubating feature.
:core:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:compileJava'.
> Could not find tools.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I had the same issue.
You need install jdk Download here
You need configure your variable environment: JAVA_HOME
Or you can copy tools.jar from %JAVA_HOME\lib to Android Studio\lib

Gradle build / test failed - kryo.KryoException: Buffer overflow

While running a Gradle build, tests are failing.
PS:
1. Gradle is using the correct JDK (1.6) to build.
2. I tried this with JDK 1.7, same error comes there as well.
3. I don't see this error when I build it locally (with JDK 1.6) on a linux/windows
4. machine but one of the machine is giving me this error.
My ?s
1. What can be done to fix the com.esotericsoftware.kryo.KryoException: Buffer overflow error.
2. Why Gradle process failed, even when test section in build.gradle says:
test {
ignoreFailures=true
//more code here for test section...
//..
}
Any hints/help appreciated. Error snapshot is shown below:
:test
Unexpected exception thrown.
org.gradle.messaging.remote.internal.MessageIOException: Could not read message from '/0:0:0:0:0:0:0:1:53371'.
at org.gradle.messaging.remote.internal.inet.SocketConnection.receive(SocketConnection.java:88)
at org.gradle.messaging.remote.internal.hub.MessageHub$ConnectionReceive.run(MessageHub.java:230)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
at com.esotericsoftware.kryo.io.Input.require(Input.java:162)
at com.esotericsoftware.kryo.io.Input.readByte(Input.java:255)
at org.gradle.messaging.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:64)
at org.gradle.messaging.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:53)
at org.gradle.messaging.remote.internal.inet.SocketConnection.receive(SocketConnection.java:83)
... 5 more
> Building > :test > 84 tests completed
:test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> Process 'Gradle Worker 6' finished with non-zero exit value 139
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
It's an internal error. Best chance is to try with the latest Gradle version.