Unity IAP plug-in: Class not found com.amazon.AmazonIAPPlugin
I'm trying to use the Unity plug-in for IAP. I install everything in place, but i'm getting this error in adb logcat. Exception: java.lang.ClassNotFoundException: com.amazon.AmazonIAPPlugin I/Unity (28638): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0 I/Unity (28638): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue args) [0x00000] in :0 I/Unity (28638): at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObject] (System.String methodName, System.Object args) [0x00000] in :0 I/Unity (28638): at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObject] (System.String methodName, System.Object args) [0x00000] in :0 I/Unity (28638): at UnityEngine.AndroidJavaObject.FindClass (System.String name) [0x00000] in :0 I/Unity (28638): at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in :0 I/Unity (28638): at UnityEngine.AndroidJavaClass..ctor (System.String className) [0x00000] in :0 I/Unity (28638): at AmazonIAP..cctor () [0x00024] in /Users/victor/Desktop/pluginsTest/Assets/Plugins/AmazonIAPAndroid it says that can found the classe. What I should do now?
I am also receiving this error. Using Unity 4.3.1f1. Can confirm the problem is when AmazonIAP.cs attempts to reference AmazonIAPPlugin.jar: using( var pluginClass = new AndroidJavaClass( "com.amazon.AmazonIAPPlugin" ) ) _plugin = pluginClass.CallStatic ( "instance" );
Hello ipicnic and matmideveloper, We have attempted to reproduce the problems that you are describing with getting a java.lang.classnotfoundexception for com.amazon.IAPPlugin.class on both of your respective versions of Unity on Mac OS X and am unable to reproduce the problem. I was able to get the plugin(version 1.1.0) dropped into an empty Unity project, build for Android and I was able to log in, make item data requests, and initialize a purchase request using our SDKTester. This class is defined within the AmazonIABPlugin.jar file that is a part of our plugin. As discussed in the Unity manual for Android plugins, this jar file has to be located in Assets->Plugins->Android , otherwise Unity will not be able to invoke the JNI code that you guys are referring to correctly. For reference, please refer to :
Hi, We are able to reproduce the problem while using java 7 tool chain. It seems to be working with JDK 1.6. We are following up with the concerned team to fix the issue. In the meantime, we have uploaded the old working version of the plugin in the below path to unblock the devs
http://d20osnoojuwey9.cloudfront.net/unity/Amazon_IAP_Unity_Plugin.zip Thanks for bringing this issue to our notice. Message was edited by: Sujoy@Amazon
I have the same issue. OSX Mavericks No java 7. willemkokke$ java -version java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode) If I add the in-app-purchasing-1.0.3.jar from the older version that's posted earlier, the error goes away, however other than the OnSdkAvailable event no callbacks are triggered. AmazonSDKTester does receive all the request and replies, but the unmodified test app does not call the Event Handlers. The older version does work, so I'll be using that for now, but hopefully this helps to narrow down what causes it so I can use the latest version.