CommandInvokationFailure while using *.aar file in unity project
Hi, im trying to run android app on unity, but im getting errors.
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.my.app -S "C:\Users\Me\secondAarTest\Temp\StagingArea\android-libraries\unity-android-resources\res"
stderr[
C:\Users\Me\myapp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:92: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <TextView>
stderr[
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\activity_main.xml:26: error: No resource identifier found for attribute 'headerLayout' in package 'com.my.app'
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\activity_main.xml:26: error: No resource identifier found for attribute 'menu' in package 'com.my.app'
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:24: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/background_material').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:40: error: Error: No resource found that matches the given name (at 'style' with value '@style/cardbutton').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:40: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/add').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:47: error: Error: No resource found that matches the given name (at 'style' with value '@style/cardbutton').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:47: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/download').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:55: error: Error: No resource found that matches the given name (at 'style' with value '@style/cardbutton').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:55: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/cardboard').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:63: error: Error: No resource found that matches the given name (at 'style' with value '@style/cardbutton').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:63: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/freeview').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:75: error: Error: No resource found that matches the given name (at 'style' with value '@style/cardtext').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:84: error: Error: No resource found that matches the given name (at 'style' with value '@style/cardtext').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\card_layout.xml:92: error: Error: No resource found that matches the given name (at 'style' with value '@style/cardtext').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\content_fragment.xml:6: error: Error: No resource found that matches the given name (at 'background' with value '@color/PrimaryColor').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\description_view.xml:4: error: Error: No resource found that matches the given name (at 'style' with value '@style/heading').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\description_view.xml:11: error: Error: No resource found that matches the given name (at 'style' with value '@style/text').
C:\Users\Me\myApp\Temp\StagingArea\android-libraries\unity-android-resources\res\layout\financial_view.xml:4: error: Error: No resource found that matches the given name (at 'style' with value '@style/heading').
and more...
I tried to unpack *.aar and copy only files from it but with the same result (same console output) Non of my xml files or drawable contain spaces or illegal chars
Answer by Yury-Habets · Dec 29, 2015 at 08:15 AM
The issue seems to be with the files you add to Assets/Plugins/Android/res - there is a number of missing identifiers. Why do you add them if you are using an .aar plugin? There is a warning with this regard in the console. You should pack your resources into an Android library or an .aar instead.
I added design and appcompat *.aar files to Android folder and now and errors gone
Your answer
Follow this Question
Related Questions
Need some help with Unity Airpush plugin 0 Answers
Unable to package Android app resources, even when blank app. 100 following. 0 Answers
CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. 1 Answer
Android build problem 0 Answers
Unable to convert classes into dex format 12 Answers