Skip to content Skip to sidebar Skip to footer

How To Correctly Import Multiple Unity Module In Single Android App Avoiding Name Conflict Between Different Unity Module In Android Studio?

I have already imported two unity module . Triangle module and cube module . public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedI

Solution 1:

I tried multiple things but failed . It seems impossible . Its like trying to keep two file in the same folder .But the problem is both the file has same name . You cannot use two module as both the modules comes with few common files which has to be placed in common folder .So based on the order of your dependency android build system picks one of them and pack it in apk.

Solution 2:

If you look closely you are calling UnityPlayerActivity.class from both the buttons - which is the default name given to Activity in Unity built code. The way to work this around is by renaming the java class in the Unity exported Android Projects.

Before you build CubeModule and TriangleModule, check the Class name and refactor it to another name. Don't forget to rename that name in Android Manifest as well.

Now when you bring it into you app code, you will be refer to those class name and initiate particular unity modules correctly.

Post a Comment for "How To Correctly Import Multiple Unity Module In Single Android App Avoiding Name Conflict Between Different Unity Module In Android Studio?"