Using Fabric with Multidex with an exported Unity project

后端 未结 2 657
野的像风
野的像风 2021-01-24 00:02

I have exported my Unity project to be able to use multidex. Problem is I have to set the android:name in the project\'s androidmanifest to \"android.support.multidex.MultiDexAp

2条回答
  •  清酒与你
    2021-01-24 00:07

    Was having the same problem.

    Ended up creating a new android studio project. Imported Fabric-(some version).jar and Fabric-init.jar which I got from the android plugins folder inside the Unity project.

    Decompiled the Fabric-init.jar and modified the FabricApplication.java class in order to extend from MultiDexApplication instead of Application.

    Built the project and extracted the new FabricApplication.class from the build folder in the Android Studio project/app.

    Replaced the FabricApplication.class inside the Fabric-init.jar of the Unity project with the new one.

    Left "io.fabric.unity.android.FabricApplication" as the application name in the manifest.

    Tested in android 4.4 and it worked. Not ideal though because I'll have to do it with every plugin update, but considering I'm a noob with this gradle thing (and Android projects in general), I'm beyond happy that at least it worked.

    If anyone comes up with a better approach, please let us know!

提交回复
热议问题