when building for Android target I get an CommandInvocationFailure with the following details:
AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/authenticator.xml').
The contents in Assets/Plugins/Android are:
Plugin.jar
AndroidManifest.xml
res
drawable
icon.png
xml
authenticator.xml
As I cannot see the file missing… I do not really know what to do anymore. I played around if the plugin itself had some errors but could not find any…
It would be great if you have any ideas on this. Any help is much appreciated!
Thank you!
The problem is that you can no longer place the res/ folder directly under Plugins/Android. Instead, you have to create an “Android library”, which is a fancy name of a particular folder structure that Unity will identify as a library.
A library can have a lib folder (with .JAR library references), a res/ folder with resources and compiled classes under bin/ folder.
You can use a simple editor script i created to “migrate” from a res/ folder into an android library (DISCLAIMER: backup or any other safety measures before running it!)
Thanks for your reply and also for the migration script!
Yes I am using version 5.2 - after migrating my library it now compiles successfully! Many thanks!
I do have a follow up question with the plugin though:
I am extending UnityAndroidActivity in my plugin - and that was never a problem - but now having the AndroidManifest in the plugin folder, I get 2 App-Installs on my phone… one crashing immediately and the other one also malfunctioning…
I am guessing Unity is not able to successfully use my definition of the main activity somehow…
Any ideas on this matter?
As I could not really get around this problem with the UnityPlayerActivity extension. I now moved all methods into another class and made them static. This actually works quite good
I could completely restore my plugin logic!
Thank you again for your help!