Error with AndroidManifest.xml when building

Hi Everyone, im struggling with this since yesterday and i cannot find any workoarround.

im having the following error when trying to make a build
I’ve tried changing the version of my android sdk, and modifying the androidmanifest. but i cant find a solution.

Any hints on this would be really appreciated.

CommandInvokationFailure: Failed to re-package resources.
C:\Users\carlo\AppData\Local\Android\sdk\build-tools\26.0.0-preview\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “C:/Users/carlo/AppData/Local/Android/sdk\platforms\android-24\android.jar” -F bin/resources.ap_

stderr[
AndroidManifest.xml:10: error: Error: No resource found that matches the given name (at ‘label’ with value ’ @anon_76954444 /app_name’).

AndroidManifest.xml:10: error: Error: No resource found that matches the given name (at ‘icon’ with value ‘@drawable/app_icon’).

AndroidManifest.xml:10: error: Error: No resource found that matches the given name (at ‘banner’ with value ‘@drawable/app_banner’).

AndroidManifest.xml:11: error: Error: No resource found that matches the given name (at ‘label’ with value ’ @anon_76954444 /app_name’).

]
stdout[
Configurations:
(default)

Files:
AndroidManifest.xml
Src: () AndroidManifest.xml

Resource Dirs:
Including resources from package: C:\Users\carlo\AppData\Local\Android\sdk\platforms\android-24\android.jar
applyFileOverlay for drawable
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
applyFileOverlay for font
applyFileOverlay for mipmap
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg, Int32 retiresOnFailure)
UnityEditor.HostView:OnGUI()

I am not sure this is the issue, but you’re using a preview version of the Android SDK tools:
C:\Users\carlo\AppData\Local\Android\sdk\build-tools\26.0.0-preview

Don’t do that; instead, use stable versions that are known to work. Try this and see if it helps. You can simply remove or move the preview folder into some other location so that Unity won’t pick it up as the one to use.

Iam also getting same error

given name (at ‘label’ with value ’ @anon_76954444 /app_name’).

/Volumes/Workspace/Drawy Internal/Temp/gradleOut/AN_Res/build/intermediates/manifests/aapt/release/AndroidManifest.xml:20: error: Error: No resource found that matches the given name (at ‘icon’ with value ‘@drawable/app_icon’).

/Volumes/Workspace/Drawy Internal/Temp/gradleOut/AN_Res/build/intermediates/manifests/aapt/release/AndroidManifest.xml:20: error: Error: No resource found that matches the given name (at ‘label’ with value ’ @anon_76954444 /app_name’).

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:AN_Res:processReleaseResources’.

com.android.ide.common.process.ProcessException: Failed to execute aapt

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 12s
]

This is a known issue when building with Gradle - libraries cannot include references to resources that they don’t define.
See more information about this in this troubleshooting page: Unity - Manual: Gradle for Android

When i set package name as my project name, it gives an errors which says:
D8: Program type already present: com.MyCompany.MyGame.BuildConfig

When i leave package name as it is, it gives an errors which says:
Resource ‘string/app_name’ not found in AndroidManifest.xml:10

So which one should i remove from AndroidManifest.xml ? I’m sorry if it’s a stupid question…

Resource not found
An AndroidManifest.xml file, either the main one or in a library, references a non-existing resource. Often it is the application icon or label string that is set by a library. This can happen if you have copied your main manifest to a library project without removing those references.

Remove the attribute from one of the Android Manifests – normally the one from the library.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.unity.ads" android:versionName="1.0" android:versionCode="1">
  <application>
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
    </activity>
    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-1010101010101010~1010101010" />
  </application>
</manifest>

getting same error can any solution yet ??? resource string/app_name (aka com.google.unity.ads:string/app_name) not found

Getting the same error. Did anyone find solution?