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
Related
I am trying to create ionic 3 custom native plugin. I have one more aar file which I need to add that aar file through plugin. I did in a same way. But now I am facing issue while running the code through android studio. I can see below error.
Information:Gradle tasks [clean, :CordovaLib:generateDebugSources, :CordovaLib:generateDebugAndroidTestSources, :CordovaLib:mockableAndroidJar, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
/Users/mobilesolution/.gradle/caches/transforms-1/files-1.1/widget-debug.aar/bcf9996b5e370c6ae472fa0793a77af4/res/values/values.xml
Error:(62, 5) error: style attribute 'attr/windowActionBar (aka io.ionic.starter:attr/windowActionBar)' not found.
Error:(62, 5) error: style attribute 'attr/windowNoTitle (aka io.ionic.starter:attr/windowNoTitle)' not found.
Error:resource style/Theme.AppCompat.Light (aka io.ionic.starter:style/Theme.AppCompat.Light) not found.
Error:resource style/ThemeOverlay.AppCompat.Dark.ActionBar (aka io.ionic.starter:style/ThemeOverlay.AppCompat.Dark.ActionBar) not found.
/Users/mobilesolution/Documents/Vishal Gole/LiquidPay/IonicApp/PayApp/platforms/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml
Error:(61) style attribute 'attr/windowActionBar (aka io.ionic.starter:attr/windowActionBar)' not found.
Error:(62) style attribute 'attr/windowNoTitle (aka io.ionic.starter:attr/windowNoTitle)' not found.
Error:resource style/ThemeOverlay.AppCompat.Light (aka io.ionic.starter:style/ThemeOverlay.AppCompat.Light) not found.
Error:failed linking references.
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 1s
Information:12 errors
Information:0 warnings
Information:See complete output in console
Please do let me know what am I doing wrong.
Please do let me know if you need any other information.
when building an app with some videos (mp4) inside raw/ directory i get this error:
raw_frenulectomia.mp4.flat: error: failed to read data meta data.
error: failed parsing overlays.
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
Caused by: java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for
details
with previous version, everything compiled allright. any idea ?
thanks
Aapt2 is enabled by default when you use android plugin for gradle 3.0.
This is to
improve incremental resource processing
as stated here.
But if you are facing issues with it, you can switch back to previous version by adding this in gradle.properties
android.enableAapt2=false
After migrating my existing project to Android Studio 3.0, it is not compiling. Below are the log details:
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 27s
Information:11 errors
Information:0 warnings
Go to your gradle.properties write the below code and Sync your project
android.enableAapt2=false
Is your username in OS cyrillic? If so - you need to change the .gradle resource folder in settings to path which does not contain cyrillic symbols.
In ->Settings-> Build, Execution -> Gradle change Service directory path to "C:/Users/Public/.gradle"
this problem occur when there is something wrong in your XMl file
1:- remove all unnecessary XML files from your code
2:- Reopen and Check XML files
If there is Still Problem
Go to your gradle.properties write the below code
android.enableAapt2=false
and then Go to your build.gradle(app) write the below code and Sync your project
aaptOptions {
cruncherEnabled = false
}
Note android.enableAapt2=false is deprecated, and will be removed by the end of 2018, so this doesn't solve the problem, is just a temporary workaround
In every project I'm getting same following error
Information:Gradle tasks [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]
Error:Execution failed for task ':app:mergeDebugResources'.
Error: Some file crunching failed, see logs for details
Error:Some file crunching failed, see logs for details
Information:BUILD FAILED
Even if I'm creating new project, without adding anything I'm getting above error, also getting an
Cannot resolve symbol 'R'
in every project.
Please check any resource file is missing or not.
Otherwise go to Build in the top menu and click on Clean Project.
If this also not works then restart Android Studio.
Sometimes this error comes due to the path of the project file.
Try relocating your project with short path address and then try to build the project.
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!