googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.25k stars 343 forks source link

[BUG] ARM64 excluded when building in BatchMode #474

Closed huran438 closed 2 years ago

huran438 commented 2 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

We have build machine based on TeamCity, this machine is building various types of builds. The types are:

In our script we dynamically switching target architecture in script:

public static void BuildMaster()
    {
        Log("Started");

        if (!Validate()) return;

        UpdateVersion();

        AddressableAssetSettings.CleanPlayerContent();
        BuildCache.PurgeCache(false);
        AddressableAssetSettings.BuildPlayerContent();

        // Player Settings Setup

        PlayerSettings.SetScriptingBackend(EditorUserBuildSettings.selectedBuildTargetGroup,
            ScriptingImplementation.IL2CPP);

        PlayerSettings.Android.androidIsGame = true;

        PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARMv7 | AndroidArchitecture.ARM64;

        PlayerSettings.Android.useCustomKeystore = true;

        PlayerSettings.Android.minifyRelease = true;
        PlayerSettings.Android.minifyDebug = true;

        EditorUserBuildSettings.androidCreateSymbolsZip = true;

        PlayerSettings.Android.forceInternetPermission = false;

        EditorUserBuildSettings.buildAppBundle = true;

        PlayerSettings.SetArchitecture(BuildTargetGroup.Android,
            (int)(AndroidArchitecture.ARMv7 | AndroidArchitecture.ARM64));

        IncrementBuildVersion();

        PlayerSettings.SplashScreen.showUnityLogo = false;

        DefineSymbols.Add("FINAL_BUILD");

        // Build Player Options

        BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions
        {
            scenes = GetEnabledScenes(),
            locationPathName = GetFilePath(BuildType.Master),
            target = EditorUserBuildSettings.activeBuildTarget,
            options = BuildOptions.CompressWithLz4HC
        };

        //Start Build

        BuildFMODFiles();

        BuildPipeline.BuildPlayer(buildPlayerOptions);
        GenerateBuildReport(ref buildPlayerOptions);

        DefineSymbols.Remove("FINAL_BUILD");

        Log("Finished");
    }

After MASTER or RELEASE build finished i can see that symbols.zip contains both arm64 and arm7 debug symbols, but libraries in build are stripped. It looks like mainTemplate.gradle excludes arm64. But why? Also it's not cleared when GPSR regenerates mainTemplate.gradle (on which step? before building or after). I tried to call Force Resolve from code before build and after setting target platform architecture, but didn't find this method.

One interesting thing: everything works normally when we call our BuildMaster method manually from editor.

Please answer the following, if applicable:

100%

What happened? How can we make the problem occur? image

google-oss-bot commented 2 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

paulinon commented 2 years ago

Hi @huran438,

In order to identify what's causing this, could you provide a minimal, reproducible example of your project along with the complete steps to replicate the issue?

huran438 commented 2 years ago

@paulinon Hello! Tried to reproduce issue on empty project, but cant reproduce it. Will write back in the next few days. Thanks for fast response!

google-oss-bot commented 2 years ago

Hey @huran438. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

huran438 commented 2 years ago

@paulinon Hello again. Sorry for late response.

Here you can see build.bat (for batch mode build of project) and build log. After running batch mode build I can see this changes in files image image

Then I'm launching editor GUI and see these changes: image

It looks like when you are in batch mode without GUI and changing project settings - the plugin does not catch this changes. And after launching GUI it resolves this changes. It will be amazing to force resolve dependencies before build via function like: GooglePlayServicesResolver.ForceReolve(); I think that it might fix problem.

Also i tried to setup clean project to reproduce issue, but i couldn't repeat the issue.

More Info: AndroidDependencies.xml.txt

We are using Odin Validator before build, And Odin AOT dll generation, also we use Build Report Tool after build. Also i attached AndroidDependencies.xml which we use. And for now we have only one plugin called TouchConsole Pro from assets store

build.bat.txt debug_build_log.txt

paulinon commented 2 years ago

Hi @huran438,

Currently, I don't have enough information to replicate this behavior. It would be helpful if you can provide a sample project that demonstrates this issue so that we can analyze what's causing this.

google-oss-bot commented 2 years ago

Hey @huran438. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

huran438 commented 2 years ago

Finally i found method PlayServicesResolver.ResolveSync(true); It resolved issue.