Search Unity

Multiple ClassNotFoundException after gradle build

Discussion in 'Editor & General Support' started by Prophet1111, Jun 27, 2019.

  1. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    24
    Hi,

    I'm using few plugins in my project (for example Easy Mobile, AdMob mediation etc.).
    After changing Unity version from 2018.1.3f to 2018.3.14f1 I'm experiancing a lot of problems.

    I've managed to figure out how to make gradle build work, but when I start the game I get multiple java.lang.ClassNotFoundException from different plugins.

    Here are few examples:


    06-27 14:04:22.093 21162 21299 E Unity : AndroidJavaException: java.lang.ClassNotFoundException: com.sglib.easymobile.androidnative.AppUtil
    06-27 14:04:22.093 21162 21299 E Unity : java.lang.ClassNotFoundException: com.sglib.easymobile.androidnative.AppUtil
    06-27 14:04:22.093 21162 21299 E Unity : at java.lang.Class.classForName(Native Method)
    06-27 14:04:22.093 21162 21299 E Unity : at java.lang.Class.forName(Class.java:453)
    06-27 14:04:22.093 21162 21299 E Unity : at java.lang.Class.forName(Class.java:378)
    06-27 14:04:22.093 21162 21299 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    06-27 14:04:22.093 21162 21299 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    06-27 14:04:22.093 21162 21299 E Unity : at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    06-27 14:04:22.093 21162 21299 E Unity : at android.os.MessageQueue.next(MessageQueue.java:394)
    06-27 14:04:22.093 21162 21299 E Unity : at android.os.Looper.loop(Looper.java:142)
    06-27 14:04:22.093 21162 21299 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
    06-27 14:04:22.093 21162 21299 E Unity : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sglib.easymobile.androidnative.AppUtil" on path: DexPathList[[zip file "/data/app/com.GGDS.idle.medieval.tycoon-qEYpsgvtIKkVCRpfk6sVcQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.GGDS.idle.medieval.tycoon-==/lib/arm, /data/app/com.GGDS.idle.medieval.tycoon-qEYpsgv



    06-27 14:04:24.201 21162 21299 W Unity : java.lang.ClassNotFoundException: com.google.games.bridge.TokenFragment
    06-27 14:04:24.201 21162 21299 W Unity : at java.lang.Class.classForName(Native Method)
    06-27 14:04:24.201 21162 21299 W Unity : at java.lang.Class.forName(Class.java:453)
    06-27 14:04:24.201 21162 21299 W Unity : at java.lang.Class.forName(Class.java:378)
    06-27 14:04:24.201 21162 21299 W Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    06-27 14:04:24.201 21162 21299 W Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    06-27 14:04:24.201 21162 21299 W Unity : at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    06-27 14:04:24.201 21162 21299 W Unity : at android.os.MessageQueue.next(MessageQueue.java:394)
    06-27 14:04:24.201 21162 21299 W Unity : at android.os.Looper.loop(Looper.java:142)
    06-27 14:04:24.201 21162 21299 W Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
    06-27 14:04:24.201 21162 21299 W Unity : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.games.bridge.TokenFragment" on path: DexPathList[[zip file "/data/app/com.GGDS.idle.medieval.tycoon-==/base.apk"],nativeLibraryDirectories=[/data/app/com.GGDS.idle.medieval.tycoon



    There are few of those and I get more when I use Notifications from Easy Mobile etc.

    I'm using latest Jar Resolver (and running it before building) not using proguard. I attatched my gradle template below.
     

    Attached Files:

  2. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    24
    I can see now, that my .apk file is 8MB smaller, than the one before Unity change.
    It seems it doesn't put aar/jar files to the build.
     
  3. toyancsayan

    toyancsayan

    Joined:
    May 4, 2017
    Posts:
    5
    and?