[Solved] Unity In-App Purchasing ClassNotFoundException Android.

I’m trying to integrate IAP following the tutorial:
https://unity3d.com/pt/learn/tutorials/topics/analytics/integrating-unity-iap-your-game-beta

Running the editor works correctly.

When I export to the eclipse, I have the following error:

02-17 22:36:34.501: I/ActivityManager(814): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=ccom.project.name/.UnityPlayerActivity (has extras)} from uid 10052 on display 0
02-17 22:36:34.592: I/ActivityManager(814): Start proc com.project.name for activity com.project.name/.UnityPlayerActivity: pid=13868 uid=10510 gids={50510, 9997, 3003} abi=armeabi-v7a
02-17 22:36:34.967: I/LaunchCheckinHandler(814): Displayed com.project.name/.UnityPlayerActivity,cp,ca,415
02-17 22:36:34.967: I/ActivityManager(814): Displayed com.project.name/.UnityPlayerActivity: +415ms
02-17 22:36:37.418: I/Unity(13868): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
02-17 22:36:37.593: I/Unity(13868): AndroidJavaException: java.lang.ClassNotFoundException: com.unity.purchasing.googleplay.GooglePlayPurchasing
02-17 22:36:37.593: I/Unity(13868): java.lang.ClassNotFoundException: com.unity.purchasing.googleplay.GooglePlayPurchasing
02-17 22:36:37.593: I/Unity(13868): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
02-17 22:36:37.593: I/Unity(13868): at com.unity3d.player.UnityPlayer.a(Unknown Source)
02-17 22:36:37.593: I/Unity(13868): at com.unity3d.player.UnityPlayer$b.run(Unknown Source)
02-17 22:36:37.593: I/Unity(13868): Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.unity.purchasing.googleplay.GooglePlayPurchasing” on path: DexPathList[[zip file “/data/app/com.project.name-1/base.apk”],nativeLibraryDirectories=[/data/app/com.project.name-1/lib/arm, /vendor/lib, /system/lib]]
02-17 22:36:37.832: I/Unity(13868): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

Obs:
The APK has been published as BETA in GooglePlay
Google Play Games and Admob plugins are working perfectly!
My Unity version is: 5.3.2.f1

What do I need to run the IAP?




I am investigating this, it appears to be a configuration problem with the Android project Unity generates.

Same issue:
Didn’t find class “com.unity.purchasing.googleplay.GooglePlayPurchasing” on path: DexPathList[[zip file "/data/app/ "],nativeLibraryDirectories=[/data/app/ , /data/app/ /base.apk!/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

Version: 5.3.4f

Please try using the Unity 5.4 beta where this issue should be fixed.

Resurrecting. Getting the same issue on 5.4b11

Bump. Issue persists on b14

My mistake, the fix has not yet landed into the beta. To workaround this you can manually add Unity IAP’s Android Archives to your project - specifically the JAR files within each.

1 Like

Can you describe it more detailed. Which file is not added to the android project.

you can read this answer.

1 Like

Yes, that answer should fix your exported android project.

1 Like