Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Android *DEBUG* Build fails with no clear error message

Discussion in 'Android' started by Extrys, May 1, 2022.

  1. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    i have been trying to debug my game for so long in my current unity version to see whats the problem using the newer ones
    so, my problem is that using newer versions of unity makes my game run slower
    then i just want to compare profiling info to see whats different and what the problem may be

    Currently im using unity 2020.1.X (any of the 2020.1 let me do a proper android build for profile)


    Build androDebug failed after 9.95m.
    > Configure project :launcher
    WARNING: The option 'android.enableR8' is deprecated and should not be used anymore.
    It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
    > Task :launcher:preBuild UP-TO-DATE
    > Task :launcher:preDebugBuild UP-TO-DATE
    > Task :unityLibrary:preBuild UP-TO-DATE
    > Task :unityLibrary:preDebugBuild UP-TO-DATE
    > Task :unityLibrary:compileDebugAidl NO-SOURCE
    > Task :launcher:compileDebugAidl NO-SOURCE
    > Task :unityLibrary:packageDebugRenderscript NO-SOURCE
    > Task :launcher:compileDebugRenderscript NO-SOURCE
    > Task :launcher:generateDebugBuildConfig UP-TO-DATE
    > Task :unityLibrary:compileDebugRenderscript NO-SOURCE
    > Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
    > Task :unityLibrary:generateDebugResValues UP-TO-DATE
    > Task :unityLibrary:generateDebugResources UP-TO-DATE
    > Task :unityLibrary:packageDebugResources UP-TO-DATE
    > Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
    > Task :unityLibrary:processDebugManifest UP-TO-DATE
    > Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
    > Task :launcher:mainApkListPersistenceDebug UP-TO-DATE
    > Task :launcher:generateDebugResValues UP-TO-DATE
    > Task :launcher:generateDebugResources UP-TO-DATE
    > Task :launcher:mergeDebugResources UP-TO-DATE
    > Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
    > Task :launcher:extractDeepLinksDebug UP-TO-DATE
    > Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
    > Task :launcher:processDebugManifest UP-TO-DATE
    > Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
    > Task :launcher:mergeDebugShaders UP-TO-DATE
    > Task :launcher:compileDebugShaders UP-TO-DATE
    > Task :launcher:generateDebugAssets UP-TO-DATE
    > Task :unityLibrary:mergeDebugShaders UP-TO-DATE
    > Task :unityLibrary:compileDebugShaders UP-TO-DATE
    > Task :unityLibrary:generateDebugAssets UP-TO-DATE
    > Task :unityLibrary:packageDebugAssets
    > Task :launcher:mergeDebugAssets
    > Task :launcher:processDebugJavaRes NO-SOURCE
    > Task :unityLibrary:processDebugJavaRes NO-SOURCE
    > Task :unityLibrary:bundleLibResDebug UP-TO-DATE
    > Task :launcher:mergeDebugJavaResource UP-TO-DATE
    > Task :launcher:checkDebugDuplicateClasses UP-TO-DATE
    > Task :launcher:desugarDebugFileDependencies UP-TO-DATE
    > Task :unityLibrary:generateDebugRFile UP-TO-DATE
    > Task :unityLibrary:compileDebugJavaWithJavac UP-TO-DATE
    > Task :unityLibrary:bundleLibCompileDebug UP-TO-DATE
    > Task :launcher:javaPreCompileDebug UP-TO-DATE
    > Task :launcher:processDebugResources UP-TO-DATE
    > Task :launcher:compileDebugJavaWithJavac UP-TO-DATE
    > Task :launcher:compileDebugSources UP-TO-DATE
    > Task :launcher:mergeExtDexDebug UP-TO-DATE
    > Task :unityLibrary:bundleLibRuntimeDebug UP-TO-DATE
    > Task :launcher:dexBuilderDebug UP-TO-DATE
    > Task :launcher:mergeLibDexDebug UP-TO-DATE
    > Task :launcher:mergeProjectDexDebug UP-TO-DATE
    > Task :launcher:mergeDebugJniLibFolders UP-TO-DATE
    > Task :unityLibrary:BuildIl2CppTask
    Running il2cpp.exe in server GC mode.
    Building libil2cpp.so with AndroidToolChain
    Output directory: X:\Extrys\Work\Hyperstacks17\Temp\androDebug\gradleOut\unityLibrary\src\main\jniLibs\arm64-v8a
    Cache directory: X:\Extrys\Work\Hyperstacks17\Temp\androDebug\gradleOut\unityLibrary\build\il2cpp_arm64-v8a_Debug\il2cpp_cache
    ObjectFiles: 801 of which compiled: 0
    Total compilation time: 662 milliseconds.
    Cleaned up 0 object files.
    > Task :unityLibrary:mergeDebugJniLibFolders
    > Task :launcher:validateSigningDebug UP-TO-DATE
    > Task :unityLibrary:extractDebugAnnotations UP-TO-DATE
    > Task :unityLibrary:mergeDebugGeneratedProguardFiles UP-TO-DATE
    > Task :unityLibrary:mergeDebugConsumerProguardFiles UP-TO-DATE
    > Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
    > Task :unityLibrary:mergeDebugJavaResource UP-TO-DATE
    > Task :unityLibrary:syncDebugLibJars UP-TO-DATE
    > Task :unityLibrary:compileDebugSources UP-TO-DATE
    > Task :unityLibrary:mergeDebugNativeLibs
    > Task :unityLibrary:stripDebugDebugSymbols
    > Task :unityLibrary:copyDebugJniLibsProjectOnly
    > Task :unityLibrary:copyDebugJniLibsProjectAndLocalJars
    > Task :launcher:mergeDebugNativeLibs
    > Task :unityLibrary:bundleDebugAar
    > Task :unityLibrary:assembleDebug
    > Task :launcher:stripDebugDebugSymbols
    > Task :launcher:packageDebug FAILED
    54 actionable tasks: 12 executed, 42 up-to-date
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':launcher:packageDebug'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    > java.lang.OutOfMemoryError (no error message)
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    * Get more help at https://help.gradle.org
    BUILD FAILED in 2m 3s
    UnityEngine.Debug:LogError(Object, Object)
    Unity.Build.ResultBase:LogResult() (at Library/PackageCache/com.unity.platforms@0.10.0-preview.10/Editor/Unity.Build/ResultBase.cs:65)
    Unity.Build.Editor.<>c:<.cctor>b__34_0(BuildConfiguration) (at Library/PackageCache/com.unity.platforms@0.10.0-preview.10/Editor/Unity.Build.Editor/BuildConfigurationInspector.cs:42)
    Unity.Build.Editor.<>c__DisplayClass30_0:<Build>b__1() (at Library/PackageCache/com.unity.platforms@0.10.0-preview.10/Editor/Unity.Build.Editor/BuildConfigurationInspector.cs:128)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)


    I can do debug builds in newer unity versions, but i dont find why this is failing,
    then i try to do what the error says in Android Studio

    i open android studio i open the gradle generated in Temp folder, and i click "Run debug" option,
    BUT now the build doesnt fails!!
    but it also dont work on the device neitherm it just crashest at the begining without even showing more than a black screen

    Please help, im getting crazy with this
     
  2. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    Just tried to make it in mono, and seems that it works in mono, but still not find a way to make it work on il2cpp
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    It's says "java.lang.OutOfMemoryError (no error message)". If you're build from Android Studio, check gradle.properties file for org.gradle.jvmargs, and increase the number
     
  4. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    The problem is that when i do the build from android studio, it builds, but doesnt work on Quest

    i dont ven know if im using Android studio correctly i just click in the "Run" button pointing to the gradle folder, and it just does the apk and executes it into the device (wich doesnt works)

    i try to do the build on unity in order to make it work, for profiling
    if i increase the memory in the editor > preferences it oesnt work, i tested with 94k
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Are you talking about JVM heap size? You mean you've entered 94000 value there?
     
  6. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    Exact, and it even still failing
    but release doesnt, the problem is that i need Debug one
     
  7. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Can you show the contents of gradle.properties ?
     
  8. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    sure, i will do in a few hours when i get out of the work
     
  9. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    725
    @Extrys did you ever get this working for you or figure out what the issue was? We are running into that same error, but only on development builds.
     
    Extrys likes this.
  10. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    That was my exact problem, but only while using unity 2020.1.0f1
    i think it has to do with entities package, but in newer unity versions this is working properly
     
  11. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    725
    ok thanks, we are on a later version and not using entities so that can't be the case for us. Thank you for responding though.

    @Tomas1856 how can I debug this? I have tried using 48 GB of RAM for Gradle and still fails. It works in non-development mode, but it fails every time in development. I've been trying to figure this out for the past week now. I tried to build in Android Studio as well but that gives me the same error message.
     
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    I guess - export a gradle project and list all the files inside and see which are the biggest ones. 48GB sounds like an overkill.