[Solved] Unity IAP - CommandInvokationFailure: Failed to recompile android resource files.

Hi,

I’ve got problem with Unity IAP and Android.

After I have imported Unity IAP package from Services windows I cannot build android apk.

I’ve installed latest JDK 1.8 build 121 and Android SDK 25. Also tested on SDK 24

Can anyone help me?

This is error I get after compiling for Android:

CommandInvokationFailure: Failed to recompile android resource files.
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/javac -bootclasspath "/Users/Rafal/Library/Android/sdk/platforms/android-25/android.jar" -d "/Users/Rafal/Android/Projekty/Unity3D/Super Max/Temp/StagingArea/bin/classes" -source 1.6 -target 1.6 -encoding UTF-8 "com/android/vending/billing/R.java" "com/super/max/R.java" "com/unity/purchasing/R.java" "com/unity/purchasing/googleplay/R.java"

stderr[
com/super/max/R.java:8: error: <identifier> expected
package com.super.max;
            ^
com/super/max/R.java:8: error: class, interface, or enum expected
package com.super.max;
                 ^
com/super/max/R.java:8: error: class, interface, or enum expected
package com.super.max;
                  ^
3 errors
]
stdout[

]
exit code: 1
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg, Int32 retriesOnFailure)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

Were you able to build to Android before you integrated IAP? If you delete the Unity Purchasing folder and disable the IAP service, are you able to build to Android again?

Which version of Unity are you using?

Yes I could Build and run on Android. When i remove Unity Purchasing i can also Build and run.

Im using unity 5.5.0f3

Also im not using any other plugins yet (except iTween)

I have fixed the problem.

It seems that I cannot use “super” word in Bundle Identifier.

After change Bundle Identifier from com.super.max to com.platform.max it worked.

3 Likes