Android Build Step: CommandInvocationFailure

Hi,

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!

Regards
Mario

You are probably using Unity 5.2, right?

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!)

The script can be found here: https://dl.dropboxusercontent.com/u/31384095/Unity/UpdateResAndroid.unitypackage

Let me know if that helped you out :slight_smile:

1 Like

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?

Thanks a lot!

Mario

1 Like

2 apps in the launcher means you have two definitions of the main activity somehow (2 definition of an activity marked as the main one).

Can you check if you have the manifest more than once? or check its contents to see its valid ?

1 Like

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 :slight_smile:
I could completely restore my plugin logic!
Thank you again for your help! :slight_smile: