Google Play OBB Downloader issues

Hey all,

Thanks in advance for any help. I’m having huge issues with the Google Play OBB Downloader. I have other Prime31 plugins in my game and I have merged the AndroidManifest correctly (to my knowledge) with no issues. I have been able to build out apks. However, as soon as I imported the Google Play OBB Downloader, I can no longer finish making an apk.

I get this error:
Failed to re-package resources with the following parameters:
package -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “MySDKLocation/adt-bundle-mac/sdk/platforms/android-16/android.jar” -F bin/resources.ap_
etc…

I have tried updating my SDK and I’m running Unity 3.5, no dice. My SDK is at API 17–so as far as I know, it’s not an issue with being out of date. I do have the Prime31 SocialNetworkingAndroid plugin and the end of my error breaks right here:

Including resources from package: /Users/Patrick/Downloads/adt-bundle-mac/sdk/platforms/android-16/android.jar
applyFileOverlay for drawable
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
applyFileOverlay for mipmap
Processing image: res/drawable/app_icon.png
Processing image: res/drawable-hdpi/app_icon.png
Processing image: res/drawable/com_facebook_button_check_off.png
Processing image: res/drawable/com_facebook_button_check_on.png
    (processed image res/drawable/com_facebook_button_check_off.png: 123% size of source)
    (processed image res/drawable/com_facebook_button_check_on.png: 135% size of source)
Processing image: res/drawable/com_facebook_button_grey_focused.9.png
Processing image: res/drawable-hdpi/com_facebook_button_grey_focused.9.png
    (processed image res/drawable/com_facebook_button_grey_focused.9.png: 105% size of source)
Processing image: res/drawable-xhdpi/com_facebook_button_grey_focused.9.png
    (processed image res/drawable/app_icon.png: 99% size of source)
Processing image: res/drawable/com_facebook_button_grey_normal.9.png
    (processed image res/drawable-hdpi/com_facebook_button_grey_focused.9.png: 107% size of source)
Processing image: res/drawable-hdpi/com_facebook_butto

I figured it’s probably related to the social networking plugin but I haven’t been able to find out why. It would be greatly appreciated if anyone had insight. Thanks

Well if anybody else has issues like this, I found the fix. When you have other plugins in your project (in this case it was the SocialNetworkingAndroid plugin from Prime31) you have to merge some other conflicting xml files along with your AndroidManifest.xml

In this case, I had to merge:
Assets/Plugins/Android/res/layout/main.xml
Assets/Plugins/Android/res/values/strings.xml
Assets/Plugins/Android/res/values/styles.xml

hope this helps others!

Hi,
I have same problem here using Google Play OBB Downloader and Prime31 SocialNetworkingAndroid plugin. Any tips how to properly merge those files?

I am stuck on the same thing. Did you manage to fix it?

Bump =/ Same problem here.
I had Google Play OBB and Prime31 Social Plugin for IOS on my project and it was working perfectly. After I added the Prime31 Social Plugin for Android, it completely rewrote the AndroidManifest.xml, it just stopped building APKs.

Okay, we came up with another solution here.

The Prime31 and ObbDownloader plugins both refer to the same xml files to define their native app layout, and this creates a problem, because none of them tries to merge the main.xml, strings.xml or styles.xml, the last one installed will overwrite the previous one. Merging strings.xml and styles.xml is a piece of cake, but we had problems merging the main.xml because each plugin needs a different root node, thus making us search for another solution. I tried to contact madflyskills to find out how he managed to merge the main xml but I got no response.

We figured out that the ‘main.xml’ file isn’t a default name (such as index.html for an website). Each xml in the ‘res’ is indexed and can be accessed using “R.layout.xmlname”, so we should basically find the “main” reference on the java source and recompile to reference the new XML file.
Prime31 doesn’t share the java source so it’s a dead end, but the ObbDownloader comes with the source, and that’s where we changed the reference.

These are ‘kind-of’ the steps to fix the problem:

  1. Install ObbDownloader plugin
  2. Go to Assets/Plugins/Android/res/
  3. Copy layout/main.xml, values/strings.xml and values/styles.xml to your desktop.
  4. Install Prime31 social plugin
  5. Go to Assets/Plugins/Android/src/com/unity3d/plugin/downloader/
  6. Open the UnityDownloaderActivity.java with any text editor
  7. Find the line setContentView(Helpers.getLayoutResource(this, “main”)) and change the “main” to “obb_main”. (Any name will work as long as it contains lowercase letters a-z, numbers and underscore ‘_’ )
  8. Rename the main.xml on your desktop to your new name (ie: “obb_main.xml”)
  9. Paste the “obb_main.xml” to your Assets/Plugins/Android/res/layout folder
  10. Merge the styles.xml and strings.xml. When I say merge, I mean copy the inner nodes from the files on the desktop to the files in the res folder.
  11. Open the Readme file the ObbDownloader placed on your Assets folder.
  12. Follow the “To rebuild the code” steps to build the “obbdownloader.jar” (you can give it any name)
  13. Delete the “obfuscated_obbdownloader.jar” and place the compiled jar on the same folder.
  14. Try to build it.

Using such default name for the main layout files seems like a bad idea, and distributing a plugin that overwrites previous “default” files without a warning is even worse. Unity and Prime should be aware of that.

1 Like

danilonishimura buddy! you’re my hero!
Thank you for sharing the solution in such a detailed way!
Respect and honor to you!