I keep getting "Failed to re-package resources" errors when trying to build an Android apk in Unity 5.4.1f1:

CommandInvokationFailure: Failed to re-package resources. /Users/admin/Library/Android/sdk/build-tools/23.0.3/aapt package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "/Users/admin/Library/Android/sdk/platforms/android-23/android.jar" ...

I followed the instructions and integrated the Unity plugins per http://docs.pushwoosh.com/docs/unity-plugin

Exporting the project to Android Studio gives the following errors:

Error:(8, -1) android-apt-compiler: [PushwooshUnityPlugin] /Unity/Android_build/AndroidStudiobuild/PushwooshUnityPlugin/AndroidManifest.xml:8: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

I also get an Unresolved class 'IntentReceiver' a couple lines below in the same AndroidManifest.xml: <receiver android:name="com.pushwoosh.unityplugin.IntentReceiver"/>

I tried deleting the following files (that came with the PushWoosh Unity pacakge) from the Unity Assets/Android/Plugins directory: android-support-v4.jar play-services-base-9.6.1.aar play-services-basement-9.6.1.aar play-services-gcm-9.6.1.aar play-services-iid-9.6.1.aar play-services-location-9.6.1.aar

Unity manages to compile an apk project but then I don't get any push notification in my app, so I think these files are required.

Can someone help? I have wasted 2 days trying to sort this out (I am novice to Android libraries)

asked 27 Dec '16, 08:34
olivierbizarre's gravatar image

olivierbizarre
215

edited 27 Dec '16, 08:35

Hello !

Could you please try manually copying Assets/Editor, Assets/Plugins, Assets/Pushwoosh folders from the Sample Project into yours ?

Please do not forget to merge contents of Assets/Plugins/Android/PushwooshAndroidManifest.xml into Assets/Plugins/Android/AndroidManifest.xml

Please follow the link below to get the AndroidManifest sample.

https://github.com/Pushwoosh/pushwoosh-unity/blob/master/PushwooshUnitySample/Assets/Plugins/Android/AndroidManifest.xml

I tried deleting the following files (that came with the PushWoosh Unity pacakge) from the Unity Assets/Android/Plugins directory: android-support-v4.jar play-services-base-9.6.1.aar play-services-basement-9.6.1.aar play-services-gcm-9.6.1.aar play-services-iid-9.6.1.aar play-services-location-9.6.1.aar

Unity manages to compile an apk project but then I don't get any push notification in my app, so I think these files are required.

These libraries are essential for push notification functionality, so you should not remove it from your project, otherwise your device will not be able neither to register for pushes nor to receive it.

permanent link
answered 27 Dec '16, 11:31
Alex's gravatar image

Alex
1615

Well, I ended up creating a new project from scratch and got the PushWoosh SDK notification to work on Android :-) As soon as I added the Chartboost SDK to my project I got into the nightmare of Unity errors: "CommandInvokationFailure: Failed to re-package resources." It seems the 2 SDKs have library incompatibilities. I ended up deleting the asset Android/Plugins/play-services-basement-9.0.0.aar that Chartboost added to my Unity assets and it seems to work now. Only remaining problem is that my app icon appears twice on an Android device - I will look into my manifest again...

permanent link
answered 28 Dec '16, 08:44
olivierbizarre's gravatar image

olivierbizarre
215

Thanks - I re-did the integration exactly per your instructions, but am still having the same problem trying to build an Android build in Unity. (It's working fine for iOS BTW - I can build an iOS build and receive push notifications). I have also integrated the Chartboost SDK - which is working fine.

Here are the errors I am getting when trying to generate an apk in Unity:

CommandInvokationFailure: Failed to re-package resources. /Users/admin/Library/Android/sdk/build-tools/23.0.3/aapt package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "/Users/admin/Library/Android/sdk/platforms/android-23/android.jar" -F bin/resources.ap_ --extra-packages com.unity.purchasing.amazon:com.chartboost.sdk.unity:com.android.vending.billing:com.unity.purchasing.googleplay:com.pushwoosh:com.pushwoosh.unityplugin.badges:com.pushwoosh.unityplugin:com.unity.purchasing:com.google.android.gms.base:com.google.android.gms:com.google.android.gms:com.google.android.gms.gcm:com.google.android.gms.iid:com.google.android.gms.location:com.unity3d.ads.android -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/AmazonAppStore/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/GoogleAIDL/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/GooglePlay/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/Pushwoosh/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/PushwooshBadges/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/PushwooshUnityPlugin/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/common/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-base-9.6.1/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-basement-9.0.0/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-basement-9.6.1/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-gcm-9.6.1/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-iid-9.6.1/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-location-9.6.1/res" -S "/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res"

stderr[ /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <relativelayout> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:61: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <textview> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <relativelayout> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <relativelayout> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <view> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <view> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:19: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <view> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml:10: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <view> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_audio_toggle.xml: note: using v17 attributes; synthesizing resource com.pixelbizarre.CrashyCars:layout/unityads_button_audio_toggle for configuration v17. /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_pause.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <view> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_button_pause.xml: note: using v17 attributes; synthesizing resource com.pixelbizarre.CrashyCars:layout/unityads_button_pause for configuration v17. /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_view_video_play.xml:92: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <include> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <linearlayout> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <linearlayout> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_view_video_play.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <textview> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_view_video_play.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <textview> /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/unityads-release/res/layout/unityads_view_video_play.xml: note: using v17 attributes; synthesizing resource com.pixelbizarre.CrashyCars:layout/unityads_view_video_play for configuration v17. /Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-basement-9.0.0/res/values/values.xml:3: error: Attribute "imageAspectRatioAdjust" has already been defined

/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-basement-9.0.0/res/values/values.xml:3: error: Attribute "imageAspectRatio" has already been defined

/Users/admin/Dropbox/mycompany/Unity/MyGame/Temp/StagingArea/android-libraries/play-services-basement-9.0.0/res/values/values.xml:3: error: Attribute "circleCrop" has already been defined

]

In Android Studio I see this errors Error:(8, -1) android-apt-compiler: [PushwooshUnityPlugin] /Users/admin/Dropbox/mycompany/Unity/Android_build/AndroidStudiobuildDec27/PushwooshUnityPlugin/AndroidManifest.xml:8: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

It seems that the AndroidManifest.xml inside PushwooshUnityPlugin.aar is conflicting with other manifests?

permanent link
answered 27 Dec '16, 17:43
olivierbizarre's gravatar image

olivierbizarre
215

edited 27 Dec '16, 18:00

Hello,

This is quite strange. It seems that your issue requires a deeper investigation, so may I ask you to contact our support team applying the following form:

https://www.pushwoosh.com/contact-us

Please also attach your AndroidManifest.xml so we could assist you better.

Regards, Alex.

(28 Dec '16, 07:43) Alex Alex's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×446
×91
×88

question asked: 27 Dec '16, 08:34

question was seen: 1,578 times

last updated: 28 Dec '16, 08:44