New build profiles is an embarrassment

Glad to hear it. More improvements to these workflows coming soon!

I’m using unity 6000.24f1 and it seems to work when building apk but not when building aab.

which part isn’t working?

PlayerSettings.bundleVersion = "7.0.0";
PlayerSettings.Android.bundleVersionCode = 7;

When building via the CLI, doing the above will still apply the APK, but not the AAB.

For example, in a build profile
bundleVersion is 6.0.0 and the
bundleVersionCode is 6
If I apply the above code when I build via CLI, the
APK will be 7.0.0 / 7 and the AAB will still be 6.0.0 / 6.

That doesn’t sound right, can you please report this as a bug and let me know the reported bug number.

It’s hard to send a report to our project about what’s happening, so I’ll create a reproducible project and send it to you.

This may take a while, so if you see the issue before then, please let me know.

The reported bug number is IN-92517. Please check

1 Like

Sorry for the interruption. Is this bug report being reviewed?

The bug hasn’t been processed yet, once it has been I’ll have it passed on to the team to take a look. Thanks for making a repro project!

1 Like

Hey Doseon, our team were able to reproduce but it looks like it has already been fixed, the fix should be available within the next couple of releases (look to 6.0.36).

2 Likes

Yes I have checked, thank you.

When I tried to do it again with it fixed, I still had the same thing, so I thought it wasn’t fixed.

While trying to figure it out, I switched to the APK build profile once and then switched back to the AAB build profile and it worked fine.

If anyone else is experiencing the same thing, this might help.

Changing PlayerSettings.bundleVersion works for Build profiles when one is activated. However, I now have a similar problem, which is not solved in any easy way: I have approximately 10-15 build profiles (different target platforms, and different configurations with scripting symbols etc). I want to bump my app version number from for example 1.3.0 to 1.4.0, and I want to not have to do this manually 16 places. I have created an editor script to help me with this, but it is an ugly hack. Is there any better way to do this? Inherited settings would of course help a lot… Or at least some editor script access to what we see in the edior UI.

My editor script is:

        private static void SetNewVersion(string inputText)
        {
            PlayerSettings.bundleVersion = inputText;
            // Save project:
            AssetDatabase.SaveAssets();


            // There is no API for changing build profile settings, without switching to each and every build profile
            // first, which requires recompilation in Unity. So we manipulate the text files instead:
            var folderForBuildProfiles = "Assets/Settings/Build Profiles";
            var buildProfiles = AssetDatabase.FindAssets(
                "t:BuildProfile",
                new[] { folderForBuildProfiles });

            if (buildProfiles.Length == 0)
                throw new Exception($"No build profiles found in folder {folderForBuildProfiles}");

            foreach (var buildProfileGuid in buildProfiles)
            {
                var buildProfilePath = AssetDatabase.GUIDToAssetPath(buildProfileGuid);

                // Load as text, overwrite the line with version number, and save back to disk:
                var lines = File.ReadAllLines(buildProfilePath);

                var foundVersionLine = false;
                for (var i = 0; i < lines.Length; i++)
                    if (lines[i].Contains("    - line: '|   bundleVersion: ", StringComparison.Ordinal))
                    {
                        lines[i] = $"    - line: '|   bundleVersion: {inputText}'";
                        foundVersionLine = true;
                        break;
                    }

                if (!foundVersionLine)
                    throw new Exception($"Could not update version in file {buildProfilePath}");

                // Save back to disk:
                File.WriteAllLines(buildProfilePath, lines);
                Debug.Log($"Updated {buildProfilePath} with new version number {inputText}");
            }

            EditorUtility.DisplayDialog("Success", $"Version number set to {inputText}", "OK");
        }
1 Like

I am having the same Issues.

Further for Android/iOS bundleVersionCodes which are a requirement to bump with each build currently do not set in my BatchMode BuildPipeline anymore. Things get even more complicated, since serialization of BuildProfiles does only trigger in the EditorWindows correctly. I tried marking them as Dirty and Save, but that does not help either. I can not deliver my games at the moment because of this. Every Upload to Google/Apple gets cancelled for non-bumped versions.

My work-around is going to be edit the serialized files in a pre-built step like you do as well. Which is an annoying hack. Editing BuildProfiles should be available through Scripting and/or we should be able to assign those values somehow.

However this only started for me a few weeks ago, before that BuildProfiles adopted my version numbers just fine. It might have been “fixed” along with the last fixes that regarded using the correct SceneOverrides during BatchMode Builds with Profiles?

probably mentioned already, but:

  • How is Scene list a “Platform” ?
  • Why push “ads” in prominent locations “Learn about devops” (maybe in hope of misclicks to get site view count higher…?) : (

*6000.0.32f1

Scene List is actually template of other platform. All Platform might be better header. But currently now what all platform are shared seem to be scene list mainly