Search Unity

[Solved] Unity In-App Purchasing ClassNotFoundException Android.

Discussion in 'Unity IAP' started by phpnato, Feb 18, 2016.

Thread Status:
Not open for further replies.
  1. phpnato

    phpnato

    Joined:
    Aug 16, 2013
    Posts:
    14
    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?
     

    Attached Files:

  2. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    I am investigating this, it appears to be a configuration problem with the Android project Unity generates.
     
  3. jimrota

    jimrota

    Joined:
    Dec 31, 2014
    Posts:
    15
    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
     
  4. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Please try using the Unity 5.4 beta where this issue should be fixed.
     
  5. InsaneGoblin

    InsaneGoblin

    Joined:
    Jun 2, 2013
    Posts:
    239
    Resurrecting. Getting the same issue on 5.4b11
     
  6. InsaneGoblin

    InsaneGoblin

    Joined:
    Jun 2, 2013
    Posts:
    239
    Bump. Issue persists on b14
     
  7. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    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.
     
    nicholasr likes this.
  8. S2NLimit

    S2NLimit

    Joined:
    Apr 19, 2016
    Posts:
    1
    Can you describe it more detailed. Which file is not added to the android project.
     
  9. bazhi

    bazhi

    Joined:
    Jan 21, 2016
    Posts:
    1
  10. Banderous

    Banderous

    Joined:
    Dec 25, 2011
    Posts:
    669
    Yes, that answer should fix your exported android project.
     
    nicholasr likes this.
Thread Status:
Not open for further replies.