flutter gradle task assembleDebug failed - linux

Launching lib/main.dart on Android SDK built for x86 in debug mode...
lib/main.dart:1
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/home/jerry/.gradle/daemon/5.4.1/Projects/dicee-flutter-master/android/app/src/main/AndroidManifest.xml:29:13-31:63: AAPT: error: resource drawable/launch_backgroung (aka co.appbrewery.dicee:drawable/launch_backgroung) 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.
Get more help at https://help.gradle.org
BUILD FAILED in 23s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

You probably made a typo when trying to modify your AndroidManifest.xml file.
# Bad
drawable/launch_backgroung
# Good
drawable/launch_background

Related

Flutter: FAILURE: Build failed with an exception

Since the last update of Android Studio (today is 23th of August 2020), each time I create a new flutter project I can't run it. Even if I do not modify a line of code and only create a blank new project then run it.
All my previous flutter project can be run in my VD without any problem. But I can't work on new projects because of this build failure.
I emptied cache using the menu 'File/Invalidate Caches / Restart ...'
I upgraded Flutter using "flutter upgrade --force' then 'flutter run -v' like in this post but it did not work for me.
I learn flutter via courses online but I don't know what to do to solve this problem.
Do you have a solution ?
Thank you
Here is what happens in the console (with a new flutter application project):
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml: AAPT: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-hi\values-hi.xml: AAPT: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-de\values-de.xml: AAPT: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-lo\values-lo.xml: AAPT: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-pt\values-pt.xml: AAPT: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-lt\values-lt.xml: AAPT: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-hr\values-hr.xml: AAPT: error: file failed to compile.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Users\Steeve\Documents\Flutter\androidstudio\proj\boule_app\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-lv\values-lv.xml: AAPT: error: file failed to compile.
* 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 24s
Exception: Gradle task assembleDebug failed with exit code 1
Delete the androidstudio folder from the C:\Users\Steeve\Documents\Flutter\ directory.

Execution failed for task ':compileDebugJavaWithJavac'

I cannot build the app after i installed cordova googleMaps. Getting the following error "Execution failed for task ':compileDebugJavaWithJavac'.".
If i uninstall google maps then i would be able to build without any problem .
Complete error:
1 error
:compileDebugJavaWithJavac
FAILED
BUILD FAILED
Total time: 2.676 secs
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
D:\Lenus Phase-2\lenus\platforms\android\src\plugin\google\maps\PluginUtil.java:
135: error: cannot access AbstractSafeParcelable
Builder builder = LatLngBounds.builder();
^
class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeP
arcelable not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova run android (exit code 1).

Build error: java.io.FileNotFoundException After Android Studio2.2.1

Error:Execution failed for task ':library:mergeDebugAndroidTestResources'.
Error: java.io.FileNotFoundException: D:\Project\library\build\intermediates\res\merged\androidTest\debug\drawable-mdpi-v4\abc_scrubber_control_to_pressed_mtrl_000.png (请求的操作无法在使用用户映射区域打开的文件上执行。)
Update gradle version and build success.

Unable to build shaderc with new experimental gradle plugin android studio

I am trying to build shaderc from NDK 12's third party folder. It build properly with "com.android.tools.build:gradle:2.1.3" but gives following error for "com.android.tools.build:gradle-experimental:0.8+"
process_begin: CreateProcess(NULL, "", ...) failed.
C:/SDKL/ndk-bundle/sources/third_party/shaderc/third_party/Android.mk:124: *** target pattern contains no `%'. Stop.
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':framework:generateJsonModelRelease'.
Build command failed.
Error while executing 'C:\SDKL\ndk-bundle\ndk-build.cmd' with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\GVRVV\GVRf\Framework\framework\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\GVRVV\GVRf\Framework\framework\src\main\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDEBUG=0 APP_PLATFORM=android-19 NDK_OUT=C:\GVRVV\GVRf\tools\Framework\framework.externalNativeBuild\ndkBuild\release\obj NDK_LIBS_OUT=C:\GVRVV\GVRf\tools\Framework\framework\build\intermediates\ndkBuild\release\lib -j4 NDK_DEBUG=1 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -n}
process_begin: CreateProcess(NULL, "", ...) failed.
C:/SDKL/ndk-bundle/sources/third_party/shaderc/third_party/Android.mk:124: *** target pattern contains no `%'. Stop.
Link: https://developer.android.com/ndk/guides/graphics/shader-compilers.html

Cant run an Android Studio project with Apache POI libraries

For the second time I decided to give a try to Android Studio.
So I imported a project that uses Apache POI libraries, and others.
This is my dependencies:
compile 'com.google.http-client:google-http-client-gson:1.19.0'
compile 'com.google.code.gson:gson:2.1'
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/commons-codec-1.9.jar')
compile files('libs/commons-logging-1.1.3.jar')
compile files('libs/google-api-client-1.16.0-rc.jar')
compile files('libs/google-api-client-android-1.16.0-rc.jar')
compile files('libs/google-api-services-drive-v2-rev111-1.16.0-rc.jar')
compile files('libs/google-http-client-1.16.0-rc.jar')
compile files('libs/google-http-client-android-1.16.0-rc.jar')
compile files('libs/google-http-client-jackson-1.16.0-rc.jar')
compile files('libs/google-http-client-jackson2-1.16.0-rc.jar')
compile files('libs/google-oauth-client-1.16.0-rc.jar')
compile files('libs/jackson-core-2.1.3.jar')
compile files('libs/jsr305-1.3.9.jar')
compile files('libs/log4j-1.2.17.jar')
compile files('libs/poi-3.11-20141221.jar')
When I try to run, I have this error:
04:27:59.765 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
04:27:59.766 [ERROR] [org.gradle.BuildExceptionReporter]
04:27:59.767 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
04:27:59.768 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':app:dexDebug'.
04:27:59.769 [ERROR] [org.gradle.BuildExceptionReporter] > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_75\bin\java.exe'' finished with non-zero exit value 2
When compiling with --stacktrace --info --debug, I get this:
04:27:59.754 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"SIMPLE","text":"UNEXPECTED TOP-LEVEL EXCEPTION:","position":{},"original":"UNEXPECTED TOP-LEVEL EXCEPTION:"}
AGPBI: {"kind":"SIMPLE","text":"com.android.dex.DexException: Multiple dex files define Lcom/google/api/client/util/StreamingContent;","position":{},"original":"com.android.dex.DexException: Multiple dex files define Lcom/google/api/client/util/StreamingContent;"}
I noticed that when I remove the poi-3.11-20141221.jar everything works fine.
I searched for a long time this issue but I'm starting to get sick of it and considering seriously to return to eclipse for good.
So my question is:
What I am suppose to do to get my project works in Android Studio with POI libaries?
Thank you
I get it!!!
I realize the problem was using Apache POI, google drive and Google Play service libraries in the same project. All these libs introduce too many methods in my project.
To avoid the compile error, I just enable the multiDex in the build gradle:
defaultConfig {
multiDexEnabled = true
}
And it works! So happy now :)
I found this solution here:
Unable to execute dex: method ID not in [0, 0xffff]: 65536

Resources