1
votes

Hello I am using unity 2018.4.33f1. I upgrade the gradle version from 3.4.0 to 3.6.0 as https://developers.google.com/ar/develop/unity/android-11-build#unity_20193_and_20194 mention here. When i build apk it works perfectly. For google Playstore I need .aab file and for .aab file it show the error i don't want to revert back gradle version

FileNotFoundException: Temp\gradleOut\build\outputs\bundle\release\gradleOut.aab does not exist System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at :0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <267278aa48b840c7a0e7281223ea050e>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <267278aa48b840c7a0e7281223ea050e>:0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <267278aa48b840c7a0e7281223ea050e>:0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <267278aa48b840c7a0e7281223ea050e>:0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:288) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:1

1
Have you tried this?: forum.unity.com/threads/…Lotan
its for unity 2019.4 i am using 2018.4 in unity 2018 custom launcherTemplate.gradle file not existMuhammad Abdullah
Tried above link solution but same errorMuhammad Abdullah

1 Answers

1
votes

I had the same issue here.

I checked that gradle 3.4.3 allows to build with <queries> element, but it has a lot of ANR in armv7 devices, so now I'm trying gradle 3.6.x as that documentation says (I use 3.6.4 instead 3.6.0 because probable it has some fixes, but that isn't matter), and I got this new issue.

The solution is at the end of the link provided by Lotan: https://forum.unity.com/threads/bundle-release-launcher-aab-does-not-exist-2019-4-16f1.1025302/#post-6780950, but there is no code, so I'll extend it here.

Unity generates a "gradleOut-release.aab", but new gradle versions look for a "gradleOut.aab" instead, so you need to rename it :).

You just have to change your defaultConfig in launcherTemplate from:

defaultConfig {
    minSdkVersion **MINSDKVERSION**
    targetSdkVersion **TARGETSDKVERSION**
    applicationId '**APPLICATIONID**'
    ndk {
        abiFilters **ABIFILTERS**
    }
    versionCode **VERSIONCODE**
    versionName '**VERSIONNAME**'
}

to

defaultConfig {
    minSdkVersion **MINSDKVERSION**
    targetSdkVersion **TARGETSDKVERSION**
    applicationId '**APPLICATIONID**'
    ndk {
        abiFilters **ABIFILTERS**
    }
    versionCode **VERSIONCODE**
    versionName '**VERSIONNAME**'

    // MLR: rename aab for gradle 3.6.x
    tasks.whenTaskAdded { task ->
        if (task.name.startsWith("bundle")) {
            def renameTaskName = "rename${task.name.capitalize()}Aab"
            def flavor = task.name.substring("bundle".length()).uncapitalize()
            tasks.create(renameTaskName, Copy) {
                def path = "${buildDir}/outputs/bundle/${flavor}/"
                from(path)
                include "gradleOut-release.aab"
                destinationDir file("${buildDir}/outputs/bundle/${flavor}/")
                rename "gradleOut-release.aab", "gradleOut.aab"
            }

            task.finalizedBy(renameTaskName)
        }
    }
    // MLR: End of rename
}

I'm not sure if 3.6.x will fix the ANR (maybe the problem us the Facebook SDK 9.0.0).