How to debug why a Gradle build failed? - android

Information:
Gradle tasks [:app:assembleDebug]
C:\Users\davis\AndroidStudioProjects\tester\app\src\main\res\values\dimens.xml
Error:Error: Found item Dimension/abc_alert_dialog_button_bar_height
more than one time
Error:Execution failed for task ':app:mergeDebugResources'.
C:\Users\davis\AndroidStudioProjects\tester\app\src\main\res\values\dimens.xml:
Error: Found item Dimension/abc_alert_dialog_button_bar_height more
than one time
Information:BUILD FAILED
Information:Total time: 6.044 secs Information:2 errors Information:0
warnings Information:See complete output in console
Please suggest me any IDE or a solution.

Do what the error says.
The item abc_alert_dialog_button_bar_height is defined twice in dimens.xml. So go to dimens.xml and remove one abc_alert_dialog_button_bar_height

Related

Gradle Build Errors in Android Studio

It's my first time using Android Studio, or developing an Android app in general, so I'm sorry if it's an obvious error.
When I try to build my app I get errors, as seen below.
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources, :app:compileDebugSources]
H:\Stage_3\CEG3799_Individual_Research_Project\App\CEG3799\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(36) error: unknown element <activity> found.
Error:(36) unknown element <activity> found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
Failed to execute aapt
> Information:BUILD FAILED in 4s
> Information:6 errors
> Information:0 warnings
> Information:See complete output in console
The debug file it is referring to is https://pastebin.com/Yyc1wGDL. The main AndroidManifest.xml file is https://pastebin.com/kj978xd4. If I try and move my <activity> to inside my <application>, I get the following error instead.
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
This is the console / logs that I can find https://pastebin.com/pT1m0GLZ.
The build.gradle is at https://pastebin.com/6r5ys8Fi
Can anyone help advise me how to get this working? Thank you in advance
When you move <activity> inside <application> you'll have two <activity> tags with the same android:name="uk.ac.ncl.b5027438.CEG3799.MainActivity". delete one of these tags
Move the
<activity
android:name="uk.ac.ncl.b5027438.CEG3799.MainActivity"
android:configChanges="screenSize|orientation" />
inside the <application> node

Android Studio build issue-Concurrent Execution exception

Error coming while trying to build the project
Whenever I am trying to build my android studio project the following error comes:
Information:Gradle tasks [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Information:BUILD FAILED
Information:Total time: 37.323 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console
Anyone facing or resloved same kind of issue?
you can solve this by separating into smaller bucket of task
build assembleDebug
test
connectedAndroidTest
i had issues, when i ran assembleDebug and test together in Jenkins as a single task

when try to run application get error?

Information:Gradle tasks [:app:assembleDebug]
To run dex in process, the Gradle daemon needs a larger heap. It
currently has approximately 910 MB. For faster builds, increase the
maximum heap size for the Gradle daemon to more than 2048 MB. To do
this set org.gradle.jvmargs=-Xmx2048M in the project
gradle.properties. For more information see
https://docs.gradle.org/current/userguide/build_environment.html
Error:The number of method references in a .dex file cannot exceed
64K. Learn how to resolve this issue at
https://developer.android.com/tools/building/multidex.html
:app:transformClassesWithDexForDebug FAILED
Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_91\bin\java.exe'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 4 mins 31.676 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console

Error compiling android app after pull

I started to develop an android app to learn android week ago, and after a deep code refactor to implement clean code architecture i get this comple error:
Information:Gradle tasks [:app:clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]
/home/kazzzweb/Workspace/android/myrecipesapp/app/build/intermediates/manifests/instant-run/debug/AndroidManifest.xml
Error:(17, 23) No resource found that matches the given name (at 'icon' with value '#mipmap/ic_launcher').
Error:(17, 23) No resource found that matches the given name (at 'icon' with value '#mipmap/ic_launcher').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Information:Total time: 1.933 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console
I searched on google and stackoverflow but i didn't found anything, so i'll very greatful if someone can help me :). All the code with last changes is on github: MyRecipesApp, and im sure that has many errors so be patient please.
Thanks!

Error:Execution failed for task ' App:mergeDebugResources FAILED

I have converted Eclipse project into studio (.gradle file),import this project into studio i got below error,please help me to solve this problem.
Error:Error: Duplicate resources: E:\workspace\application\res\values\setting_color.xml:color/default_bg, E:\workspace\application\res\values\colors.xml:color/default_bg
:ApplicationFAILED
Information:BUILD FAILED
Information:Total time: 19.189 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console

Categories

Resources