Build error: java.io.FileNotFoundException After Android Studio2.2.1 - android-studio

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.

Related

flutter gradle task assembleDebug failed

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

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.

Getting this error while running ionic code in Android studio - AGPBI: {"kind":"error","text":"No resource identifier found for attribute

I am working with Ionic project and I need to run this project with my android studio. I have resolved all the issues which are coming in the gradle file but when I am trying to run the code getting below error
error - No resource identifier found for attribute 'appComponentFactory' in package 'android'
enter image description here
above image is when I have fixed all the issue
but getting below error on runtime
**AGPBI: {"kind":"error","text":"No resource identifier found for attribute \u0027appComponentFactory\u0027 in package \u0027android\u0027","sources":[{"file":"/Users/naya-pc/Documents/Ionic/xyz/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml","position":{"startLine":57}}],"original":"","tool":"AAPT"}
/Users/naya-pc/Documents/Ionic/xyz/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:58: error: No resource identifier found for attribute 'appComponentFactory' in package 'android'
:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt**
Also, I have tried the basic technique to resolve this type of issue
1. clean project
2. rebuild project
3. invalidate the cache and restart
but still getting the same issue.
I have changed almost every gradle file with the new one and old one but getting the same issue below are my gradle and they are working gradle.
compile "com.android.support:support-v4:22.0.0"
compile "com.android.support:appcompat-v7:22.0.0"
compile "com.facebook.android:facebook-android-sdk:4.+"
compile "com.google.gms:google-services:+"
compile "com.google.android.gms:play-services-tagmanager:+"
compile "com.google.firebase:firebase-core:+"
compile "com.google.firebase:firebase-messaging:+"
compile "com.google.firebase:firebase-crash:+"
compile "com.google.firebase:firebase-config:+"
compile "com.google.android.gms:play-services-base:15.0.1"
compile "com.google.android.gms:play-services-ads:15.0.1"
compile "com.google.android.gms:play-services-auth:15.0.1"
compile "com.google.android.gms:play-services-identity:15.0.1"
Please help me if you have any solution for this issue.

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