when create apk file error found ':app:mergeDebugResources' - java

When I am making apk file from my android for the first time.
I have this error.Can anyone help me?
**Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Required by:
project :app
No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.
No cached version of com.android.tools.build:aapt2:3.6.2-6040484 available for offline mode.
* 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 4s
5 actionable tasks: 5 executed**

This error usually occurs due to the Gradle running in offline mode:-
Disable the offline mode of Gradle by going to File - Project Settings - Build, Execution, Deployment - Gradle - Remove --offline in Command Line options.(Or, simply click the -//- icon in the Gradle window.)
Then, connect to the internet and run Gradle build.
After the build has run once, you can enable the offline mode again.

Related

Issue after update Flutter project to JAVA 11

After the update of my Flutter project to JAVA 11 suddenly I got this error when I try to run the app on any device.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileQa4DebugJavaWithJavac'.
> Could not resolve all files for configuration ':app:androidJdkImage'.
> Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JdkImageTransform: /Users/enzoftware/Library/Android/sdk/platforms/android-30/core-for-system-modules.jar.
> jlink executable /Applications/Android Studio Preview.app/Contents/jre/jdk/Contents/Home/bin/jlink does not exist.
* 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 56s
Exception: Gradle task assembleQa4Debug failed with exit code 1
I tried doing flutter clean, install again the SDK for API 30 and reinstalling everything from scratch but the problem persist.
Any suggestions are welcome.
Change version of JAVA 8 because JAVA 11 isn't good for using Flutter. I was on sam

flutter: i can not build android apk

I'm trying to create my APK app but it fails and prints this error in android studio terminal:
C:\flutter\bin\flutter.bat --no-color build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: E:\flutter\2021\my_flutter_app\build\app\intermediates\flutter\debug\libs.jar.
> Transform's input file does not exist: E:\flutter\2021\my_flutter_app\build\app\intermediates\flutter\debug\libs.jar. (See https://issuetracker.google.com/issues/158753935)
* 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 9m 19s
Running Gradle task 'assembleRelease'... 562.4s (!)
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
in the debugging mode the app work!!
I hope you can help me with the solution to fix the error

Cordova run android keeps on failing

I'm building my first cordova app and I'm trying to install it on my Android phone to check if everything is working.
But I keep getting the same error message over and over again:
C:\LesCordova\project_cordova>cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Android-SDK (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: C:\Android-SDK
Subproject Path: CordovaLib
Subproject Path: app
Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.versionedparcelable:versionedparcelable:1.0.0, androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.core
:core:1.0.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerla
yout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core
:core-common:2.0.0, androidx.annotation:annotation:1.1.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lif
ecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.
0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
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 1s
7 actionable tasks: 1 executed, 6 up-to-date
Command failed with exit code 1: C:\LesCordova\project_cordova\platforms\android\gradlew cdvBuildDebug -b C:\LesCordova\project_cordova\platforms\android\build.gradle
I already tried to change the android.useAndroidX property to true, but it changes back to false.
I already deleted the platform/android directory.
I realy hope someone knows what I'm doing wrong, because I'm running out of time...
Thank you!
Greetings Joyce

Error while debugging first app in flutter using a real device

I'm using VS code without Android studio in Ubuntu 20.04. While running the first app in flutter in debugging mode in an real device produced this error given below. I also tried to change my JDK version but it didn't worked.
Launching lib/main.dart on Nokia 6 1 Plus in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* 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 12s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 18.3s
Exception: Gradle task assembleDebug failed with exit code 1
Please suggest a solution!
Your gradle sync has failed for some reason.
Do this
File > Open
Navigate to your project
You will see an android folder there open that as project in a new window
Check the gradle sync issues and resolve those

Fail to run desktop app with desktop:run LIBGDX

I am using android studio idea for my libgdx project. I configured custom desktop configuration setting
Tasks: desktop:run
Gradle Project: mygame
Running android works fine but running this configuration brings the following error
9:08:42 PM: Executing task 'desktop:run'...
Executing tasks: [desktop:run]
Configuration on demand is an incubating feature. WARNING:
Configuration 'compile' is obsolete and has been replaced with
'implementation'. It will be removed at the end of 2018 Gradle now
uses separate output directories for each JVM language, but this build
assumes a single directory for all classes from a source set. This
behaviour has been deprecated and is scheduled to be removed in Gradle
5.0 at build_4irp102idy0ifcnkhwn53osnp$_run_closure3.doCall(D:\LibgdxProjects\Tembo\desktop\build.gradle:22)
(Run with --stacktrace to get the full stack trace of this
deprecation warning.)
FAILURE: Build failed with an exception.
What went wrong: java.lang.NullPointerException (no error message)
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 2s 9:08:45 PM: Task execution finished 'desktop:run'.
Important details
Gradle version: 4.4
How can i fix this. I tried downgrading my gradle version but the minimim supported is 4.4
NOTE: running gradlew desktop:run on project root works.
currently this version of gradle is not supported you can use version 2.3.3
There is an activity to upgrade to Gradle 4.6 which you can follow up here
https://github.com/libgdx/libgdx/issues/5177

Categories