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

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.

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"
}
}

Cannot set configuration in Elastic Beanstalk

I have 4 Elastic Beanstalk deployments: 3 are Corretto 8 and the other one is Corretto 11.
On the Corretto 8 deployments, I can set new configuration without issue. On the Corretto 11 instance, however, any attempt to set a new configuration fails and causes a rollback.
The Corretto versions might not be the problem, but it's the only difference I can see. All 4 apps are Spring Boot apps that run as web servers (i.e embedded tomcat with exposed web ports). I am trying to set the exact same configuration name and value, and it only fails on the one instance.
The configuration I'm trying to set is pretty simple:
VALIDATE_RENEWALS = true
Even just trying to set DEBUG = true causes a failure and rollback.
I don't see a lot of information from the console about what's failing. Here is the event log:
2020-03-16 13:55:17 UTC-0600 INFO The environment was reverted to the previous configuration setting.
2020-03-16 13:54:45 UTC-0600 ERROR During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
2020-03-16 13:54:45 UTC-0600 ERROR Failed to deploy configuration.
2020-03-16 13:54:45 UTC-0600 ERROR Unsuccessful command execution on instance id(s) 'i-00553f4ac36afd327'. Aborting the operation.
2020-03-16 13:54:45 UTC-0600 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-03-16 13:54:45 UTC-0600 ERROR [Instance: i-00553f4ac36afd327] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
2020-03-16 13:54:20 UTC-0600 INFO Updating environment XXX's configuration settings.
2020-03-16 13:54:15 UTC-0600 INFO Environment update is starting.
I've also downloaded the full set of logs for the instance and don't see anything obvious. The app stdout doesn't have any errors or exceptions, it just starts normally and then gets terminated. None of the other log files have messages around the times above, so I'm really not sure what else I can look at.
Edit
The times don't line up but I do see this in eb-engine.log file:
2020/03/16 17:54:38.508634 [INFO] checking whether command is applicable to this instance...
2020/03/16 17:54:38.508658 [INFO] this command is applicable to the instance, thus instance should execute command
2020/03/16 17:54:38.508665 [INFO] check whether this is an enhanced env...
2020/03/16 17:54:38.508794 [INFO] Executing instruction: StageJavaApplication
2020/03/16 17:54:38.508858 [ERROR] GetArchivedFileType with file /opt/elasticbeanstalk/deployment/app_source_bundle failed with error open /opt/elasticbeanstalk/deployment/app_source_bundle: no such file or directory
2020/03/16 17:54:38.508868 [ERROR] An error occurred during execution of command [config-deploy] - [StageJavaApplication]. Stop running the command. Error: staging java app failed with error GetArchivedFileType with file /opt/elasticbeanstalk/deployment/app_source_bundle failed with error open /opt/elasticbeanstalk/deployment/app_source_bundle: no such file or directory

Multi-OS Engine build failed in Android Studio

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.

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.