flutter Android resource linking failed #mipmap/ic_launcher not found - android

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
E:\Programs\Flutter\<My_APP>\build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml:16: AAPT: error: resource mipmap/ic_launcher (aka com.example.<My_APP>:mipmap/ic_launcher) not found.
I try to removing icon from android manifest file it works but, I want flutter ic_launcher. Any idea, what is the cause ?

In case you've switched your app icon not only in terms of the image but also the name of it then you also need to change the icon name in the AndroidManifest.xml.
android:icon="#mipmap/'Your icon_name'">

it clearly says icon not found you need to either change name or rename your existing icon as ic_launcher

It happent because your launcer icon name and android_manifest icon name different.
first of all goto .....\android\app\src\main\res\mipmap-hdpi
then check the name of your icon is it is ic_launcer
then go to android>app>src>AndroidManifest.xml
Change
android:icon="#mipmap/your_icon_name"

I reinstall flutter and now it's works

Related

I am have an error in Manifest AAPT: error: resource mipmap/ic_launcher_round not found

PC\AndroidStudioProjects\TabLayout\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:12: AAPT: error: resource mipmap/ic_launcher_round (aka com.example.tablayout:mipmap/ic_launcher_round) not found
when you create your image assets make sure you choose debug mode or release mode. So make it a release mode and create your icon asset
Check your AndroidManifest.xml and find property android:roundIcon. Then remove this line, it's optional.
In case if you need android:roundIcon, just create it with in-IDE tools (right-mouse-click on resources directory, then "New" -> "Image Asset")
Android build failed due to mipmap/launcher_icon missing or path change. without launcher_icon app not install . drag and drop app icon to mipmap & re-run ur app.

How can I resolve the Android Studio Build Output error

Trying to build the app but have got the error: The error Confugure image asset1
Confugure image asset2
Confugure image asset3
ERROR:C:\Users\Alex\AndroidStudioProjects\Lm2\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:3: AAPT: error: resource mipmap/ic_launcher_background (aka com.example.lm2:mipmap/ic_launcher_background) not found.
How can I resolve this?
I hope you have
put your launcher icons into the mipmap folder where they should always go.
added your adaptive icon to the app’s manifest.xml for “android:icon” (android:roundIcon) attribute
.
Fist hand try: Clean your project and Rebuild
Probable Issue reason: Malformed XML:
Solution:
Check if you have anything duplicated by mistake in your XML
Try Analyze > Inspect Code it will redirect you to the exact error.

Jenkins - Execution failed for task ':app:mergeDebugResources'

I am trying to work with Jenkins however I cannot build the apk with it as I am having issue with AAPT2 and Gradle.
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.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-hdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-xhdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-mdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
I already read tons of SO question that may share same issue to my case saying that it has something to do with the file path being too long but I still cannot find any solution.
UPDATE
I tried to change Android Studio Gradle home similar to what Jenkins is using and received similar error which indicates that it may really have something to do with long file path.
I think the final question will be how to change Jenkins Gradle Home?
You need to replace \ with \\ if you are giving path with jenkins in Windows.
May be if file path is too huge or that is the root cause you can try mounting the directory to a short path
EDIT : Based on your modified question :
Open Jenkins dashboard. Navigate to Manage Jenkins-> Configure System. Under the Global properties section add another environment variable named GRADLE_USER_HOME as shown below.
I ran into this exact issue, but unfortunately changing the GRADLE_USER_HOME environment variable did not help, as aapt2 appeared to ignore the change and still used Windows/system32/... for the cache location.
The problem was how I was running Jenkins as a service. In the service.msc settings, it was set to Log On as a Local System account, which set the USER_HOME variables to C:\Windows\System32. Because of this, the reason the error said that the file did not exist was because Jenkins/gradle did not have access to the System32 folder.
My fix was to change the log on method to 'This account', then enter a user account so Jenkins wasn't logged on as system anymore.

Nativescript build failed

I'm trying to get my app on an android device. When I run
tns run android
I get this error :
/Users/coreelements/Projects/nativescript/myapp/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:32: AAPT: error: resource
drawable/icon (aka nl.coreelements.myapp:drawable/icon) not found.FAILURE: Build failed with an exception.* What went wrong:
Execution failed for task ':app:processDebugResources'.
Failed to process resources, see aapt output above for details.
I've already tried regenerating the app and splashes :
tns resources generate icons src/images/appicon.png
tns resources generate splashes src/images/appicon.png
What am I missing? I've also tried to buid/run in App Studio.
Just wrapping up the answer from #fransyozef:
App_Resources/Android/src/main/AndroidManifest.xml should point to the right drawable, in this case replacing android:icon="#drawable/icon" with android:icon="#drawable/appicon" solved the issue.
The solution above did not work for me, what did work is change
android:icon="#drawable/icon" to android:icon="#drawable/fileName", so replace /icon with /fileName of the image that is stored there.

React Native suddenly fail to build

So, I was doing some modification on my code this morning and it runs just like it used to. And then when I tried to run react-native run-android again after few hours, I got below error:
/Users/mimicreative/Documents/Kerja/Project/PictalogiDev/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/res/layout/abc_action_bar_title_item.xml:21:22-76: AAPT: No resource found that matches the given name (at 'style' with value '#style/RtlOverlay.Widget.AppCompat.ActionBar.TitleItem').
/Users/mimicreative/Documents/Kerja/Project/PictalogiDev/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/res/layout/abc_action_bar_title_item.xml:30:41-91: AAPT: No resource found that matches the given name (at 'layout_marginTop' with value '#dimen/abc_action_bar_subtitle_top_margin_material').
/Users/mimicreative/Documents/Kerja/Project/PictalogiDev/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/res/layout/abc_action_bar_view_list_nav_layout.xml:22:22-48: AAPT: No resource found that matches the given name (at 'style' with value '?attr/actionBarTabBarStyle').
So much line of error like above then at the end of the line I got this:
Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
How can I fix this? What causes the error?
For anyone having this issue, you just need to update the Android Support Repository using Android SDK Manager.

Categories

Resources