- Android resource linking failed : Unity Error :unexpected element found in #1551
- Comments
- AliAhmadUnityDev commented Jan 13, 2021
- Step 0: Are you in the right place?
- [REQUIRED] Step 1: Describe your environment
- [REQUIRED] Step 2: Describe the problem
- Steps to reproduce:
- Relevant Code:
- Android resource linking failed ( error: failed linking references.)
- 1 Answer 1
- Unity Android build — 7.15.1 (Theme.AppCompat.NoActionBar not found.) #227
- Comments
- Vah94 commented Mar 25, 2019 •
Android resource linking failed : Unity Error :unexpected element found in #1551
Comments
AliAhmadUnityDev commented Jan 13, 2021
Step 0: Are you in the right place?
For general technical questions, or help with project-specific issues like setting up ads in
your app, reach out to our support team on the
Developer Forum.
For assistance with your AdMob account, reach out to
AdMob Support.
For feedback on our documentation,
send your feedback by pressing the Send Feedback button at the top right of the
documentation page you are on.
For issues related to the code in this repository, continue filing this GitHub issue.
Once you’ve read this section and determined that your issue is appropriate for
this repository, please delete this section.
[REQUIRED] Step 1: Describe your environment
- Unity version: 2018.4.8 LTS
- Google Mobile Ads Unity plugin version: 5.4.0
- Platform: Android
- Platform OS version: All Android versions
- Any specific devices issue occurs on: Occurs On all devices
- Mediation ad networks used, and their versions: No
[REQUIRED] Step 2: Describe the problem
Android resource linking failed : Unity Error :unexpected element found in
-1
I am using getting this error when building with Admob (Google Mobile Ads SDK for unity) and Facebook Audience Network SDK for unity. If I use one of these separately in project then there comes no error but if I use both of these, then I start getting this error on build. However I have tested and can confirm that this error doesn’t appears on Unity 2020 versions but it comes in all Unity 2018 as well as 2019 versions. Please help me out to solve this error.
I can share the Project complete file if required but it can be easily reproduced by adding Admob unity SDK and Facebook audience network unity sdk and building the project for Android platform.
I am Using:
Unity Editor 2018.4.30 LTS version
Admob SDK (Google Mobile Ads SDK) version 5.4.0
FAcebook Audience Network version 6.2.0
Scripting Backend: IL2CPP
JDK: jdk1.8.0_271
Steps to reproduce:
This error can be reproduced By importing GoogleMobileAds SDK (5.4.0) and Audience Netwrok SDK (6.2.0) in a project in unity having editor versions 2018 or 2019.
Relevant Code:
`CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_271\bin\java.exe -classpath «C:\Program Files\UnityInstallFolder\Unity_2018.4.30\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar» org.gradle.launcher.GradleMain «-Dorg.gradle.jvmargs=-Xmx4096m» «assembleRelease»
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:processReleaseResources’.
Android resource linking failed
D:\Projects\ADS Packages\ReportingProjectSample\Temp\gradleOut\build\intermediates\merged_manifests\release\AndroidManifest.xml:36: AAPT: error: unexpected element found in .
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.
BUILD FAILED in 6s
]
stdout[
Task :preBuild UP-TO-DATE
Task :GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE
Task :GoogleMobileAdsPlugin.androidlib:preReleaseBuild UP-TO-DATE
Task :GoogleMobileAdsPlugin.androidlib:checkReleaseManifest
Task :GoogleMobileAdsPlugin.androidlib:processReleaseManifest
Task :preReleaseBuild UP-TO-DATE
Task :GoogleMobileAdsPlugin.androidlib:compileReleaseAidl NO-SOURCE
Task :compileReleaseAidl NO-SOURCE
Task :GoogleMobileAdsPlugin.androidlib:packageReleaseRenderscript NO-SOURCE
Task :compileReleaseRenderscript NO-SOURCE
Task :checkReleaseManifest UP-TO-DATE
Task :generateReleaseBuildConfig UP-TO-DATE
Task :prepareLintJar UP-TO-DATE
Task :generateReleaseSources UP-TO-DATE
Task :GoogleMobileAdsPlugin.androidlib:compileReleaseRenderscript NO-SOURCE
Task :GoogleMobileAdsPlugin.androidlib:generateReleaseBuildConfig
Task :GoogleMobileAdsPlugin.androidlib:generateReleaseResValues
Task :GoogleMobileAdsPlugin.androidlib:generateReleaseResources
Task :GoogleMobileAdsPlugin.androidlib:packageReleaseResources
Task :GoogleMobileAdsPlugin.androidlib:generateReleaseRFile
Task :GoogleMobileAdsPlugin.androidlib:prepareLintJar UP-TO-DATE
Task :GoogleMobileAdsPlugin.androidlib:generateReleaseSources
Task :GoogleMobileAdsPlugin.androidlib:javaPreCompileRelease
Task :GoogleMobileAdsPlugin.androidlib:compileReleaseJavaWithJavac
Task :GoogleMobileAdsPlugin.androidlib:bundleLibCompileRelease
Task :javaPreCompileRelease UP-TO-DATE
Task :mainApkListPersistenceRelease UP-TO-DATE
Task :generateReleaseResValues UP-TO-DATE
Task :generateReleaseResources UP-TO-DATE
Task :mergeReleaseResources
Task :createReleaseCompatibleScreenManifests
Task :processReleaseManifest
Task :processReleaseResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use ‘—warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
21 actionable tasks: 13 executed, 8 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action 1[T] progress, System.String error) (at :0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action 1[T] progress) (at :0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action 1[T] progress) (at :0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) Rethrow as BuildFailedException: Exception of type ‘UnityEditor.Build.BuildFailedException’ was thrown. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at :0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at :0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:288) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
The text was updated successfully, but these errors were encountered:
Источник
Android resource linking failed ( error: failed linking references.)
After i add GDPR code to my app in (MainActivity.java) seccion , After i try to rebuild project i get this error :
C:\Users\jalal\Desktop\codecanyon-20549858-fast-cleaner-battery-saver-with-admob-ads\Main File\Fast Cleaner & Battery Saver\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:7: error: resource android:attr/colorError not found. C:\Users\jalal\Desktop\codecanyon-20549858-fast-cleaner-battery-saver-with-admob-ads\Main File\Fast Cleaner & Battery Saver\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:11: error: resource android:attr/colorError not found. C:\Users\jalal\Desktop\codecanyon-20549858-fast-cleaner-battery-saver-with-admob-ads\Main File\Fast Cleaner & Battery Saver\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:15: error: style attribute ‘android:attr/keyboardNavigationCluster’ not found. error: failed linking references.
I already checked her and i don’t found any solution , Thank you
1 Answer 1
Look at the error reported:
values-v26.xml:7: error: resource android:attr/colorError not found
This one (and the next few) are all because these android attributes were only added in API 26 (that’s why they’re referenced from values-v26). You need to update your compileSdkVersion to at least 26, although I’d highly recommend updating to the newest API 28.
Источник
Unity Android build — 7.15.1 (Theme.AppCompat.NoActionBar not found.) #227
Comments
Vah94 commented Mar 25, 2019 •
In build only Facebook unity last sdk
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\2018.3.9f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath «C:\Program Files\Unity\2018.3.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar» org.gradle.launcher.GradleMain «-Dorg.gradle.jvmargs=-Xmx4096m» «assembleRelease»
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:processReleaseResources’.
Android resource linking failed
Output: error: resource style/Theme.AppCompat.NoActionBar (aka com.mycompanu.mylovelygame:style/Theme.AppCompat.NoActionBar) not found.
error: resource style/Theme.AppCompat.Dialog (aka com.mycompanu.mylovelygame:style/Theme.AppCompat.Dialog) not found.
error: failed linking references.
Command: C:\Users\Vahe.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\66b9d4c22098ba0339166200a0a8a768\aapt2-3.2.0-4818971-windows\aapt2.exe link -I
C:\Users\Vahe\AppData\Local\Android\Sdk\platforms\android-28\android.jar
—manifest
C:\Users\Vahe\Desktop\TestAndroid\Temp\gradleOut\build\intermediates\merged_manifests\release\processReleaseManifest\merged\AndroidManifest.xml
-o
C:\Users\Vahe\Desktop\TestAndroid\Temp\gradleOut\build\intermediates\processed_res\release\processReleaseResources\out\resources-release.ap_
-R
@C:\Users\Vahe\Desktop\TestAndroid\Temp\gradleOut\build\intermediates\incremental\processReleaseResources\resources-list-for-resources-release.ap_.txt
—auto-add-overlay
—java
C:\Users\Vahe\Desktop\TestAndroid\Temp\gradleOut\build\generated\not_namespaced_r_class_sources\release\processReleaseResources\r
—custom-package
com.mycompanu.mylovelygame
-0
apk
-0
.unity3d
-0
.ress
-0
.resource
-0
.obb
—output-text-symbols
C:\Users\Vahe\Desktop\TestAndroid\Temp\gradleOut\build\intermediates\symbols\release\R.txt
—no-version-vectors
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
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.
BUILD FAILED in 3s
]
stdout[
:checkReleaseClasspath UP-TO-DATE
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:compileReleaseAidl NO-SOURCE
:compileReleaseRenderscript
:checkReleaseManifest UP-TO-DATE
:generateReleaseBuildConfig
:prepareLintJar UP-TO-DATE
:mainApkListPersistenceRelease UP-TO-DATE
:generateReleaseResValues UP-TO-DATE
:generateReleaseResources
:mergeReleaseResources
:createReleaseCompatibleScreenManifests
:processReleaseManifest
:splitsDiscoveryTaskRelease UP-TO-DATE
:processReleaseResources FAILED
13 actionable tasks: 6 executed, 7 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action 1[T] progress, System.String error) (at :0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action 1[T] progress) (at :0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at :0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
The text was updated successfully, but these errors were encountered:
Источник