top of page
Search
  • Writer's pictureMadhu Kalva

Unity: Android build errors compilation

Updated: Dec 9, 2021

For all my games, I use:

  • MoPob mediation to monetize.

  • Unity Easy Mobile Pro asset to integrate MoPub ADs/mediation and to implement other generic features like app rating etc,.

For reference I am using Unity 2019.4.17f1.


Time to time I see few errors while building for Android. So, in this bog post I am compiling fixes for my future reference and to help for other devs who face these.



 

Could not find or load main class com.android.manifmerger.Merger

Still not sure what the root cause is for this issue, time to time this reappears and disappears. Things to do to fix this:

  • Perform this trick Failed to update Android SDK Package List

  • Get the latest SDK, NDK, and SDK tools from Android Studio that is pointing to Unity Android set up.

  • Last but not least, get latest assets and import them in my case they are - EasyMobilePro, GameAnalytics, Facebook SDK, GoogleMobileADs


No Java runtime present, requesting install.


After you install Unity for the first time, some times it throws this error.


From https://github.com/firebase/quickstart-unity/issues/849 post: "So first, I know this sounds really odd, but I've seen issues in MacOS in the past that are resolved simply by toggling the "JDK Installed with Unity" button. As in on or off doesn't matter, just that it changes. Try unchecking that and hitting build (without restarting Unity). If that works, that is one bug to start tracking and can help you get unstuck."

I tried toggle & untoggle couple of times and it fixed No Java runtime present, requesting install. issue.


 

Failed to update Android SDK Package List

step 1 - Disable all checkmarks in preferences and close editor. step 2 - Reopen the editor Enable all checkmarks in preferences after that hit the play button. Now it will start resolving dependencies for android and the problem will be solved





Error: unexpected element <queries> found in <manifest>


To fix this use gradle version that included queries in it, which seems to be above 3.4.3. So use this

classpath 'com.android.tools.build:gradle:3.4.3'

instead of

classpath 'com.android.tools.build:gradle:3.4.0'




 

Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K.


To fix this enable multidex via launcherTemplate.gradle

  • multiDexEnabled true

  • implementation 'androidx.multidex:multidex:2.0.1'




 

Your Android setup is not correct. See Settings in Facebook menu.


Just uncheck recommended Android SDK from Unity preferences and browse Android SDK to the exact same one Unity already using will fix this issue.




 

You uploaded a debuggable APK or Android App Bundle.

Sometimes when I upload android build that is built with Unity throws this error: You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs and Android App Bundles.

If you are using FacebookSDK which comes with Google Play services, it can be that in injects a Debuggable=true key in the Manifest, for whatever reason.


you can fix it by going to Assets -> Android -> AndroidManifest.xml

In there find 'android:debuggable="true"' and set it to false.



 

Google Play Console Error: This release is not compliant with the Google Play 64-bit requirement.


To fix this Go to Player Settings -> Other Setting -> Under Configuration

  • Select IL2CPP for Scripting Background.

  • Now you will see ARM64 under Target Architecture and check it.

  • Regenerate build and it shouldn't throw above error anymore.


833 views0 comments

Recent Posts

See All

Retention Tips:

Garding levels: Easy, Medium, Hard, etc Source: https://youtu.be/YSJvz6ilf60?t=371 Point out when something is difficult. Higher acceptance of failure difficult levels Change difficulty based on user

CPI Tips:

Watching AD to Game Install Funnel Source: https://youtu.be/AqO_kunQbGY?t=154 Keep contrast between key game elements Source: https://youtu.be/AqO_kunQbGY?t=312 Gameplay clarity, natural speed, and di

HC new comers resources

Voodoo Live Sessions Alexander Shea : Publishing Hyper-Casual Games In 2022 Raketspel : How To Increase Engagement In Hyper-Casual Games SuperSonic Super Sessions 3Cs in Hypercasual - Controls & Depth

bottom of page