-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore split configs when bundle config moves shared libraries to base.apk #8987
Conversation
tests/MSBuildDeviceIntegration/Tests/BundleToolNoAbiSplitTests.cs
Outdated
Show resolved
Hide resolved
EnvironmentHelper.ApplicationConfig app_config = EnvironmentHelper.ReadApplicationConfig (envFiles); | ||
|
||
Assert.That (app_config, Is.Not.Null, "application_config must be present in the environment files"); | ||
Assert.AreEqual (app_config.ignore_split_configs, true, $"App config should indicate that split configs must be ignored"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add additional code like
Assert.IsTrue (appBuilder.Install (app), $"{app.ProjectName} should install");
RunProjectAndAssert (app, appBuilder);
Assert.True (WaitForActivityToStart (app.PackageName, "MainActivity",
Path.Combine (Root, appBuilder.ProjectDirectory, "logcat.log"), 30), "Activity should have started.");
To make sure the app actually installs and runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the run code in a separate test InstallAndRun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the AdbStartActivity
method does not check if the app started. It just does a launch,
You are better off using
RunProjectAndAssert (app, appBuilder);
Assert.True (WaitForActivityToStart (app.PackageName, "MainActivity",
Path.Combine (Root, appBuilder.ProjectDirectory, "logcat.log"), 30), "Activity should have started.");
* main: (22 commits) Bump to dotnet/android-tools@1c09dcc (#9026) Bump to dotnet/java-interop@ccafbe6 (#9025) [Mono.Android-Tests] Fix repo URL in redirect tests (#9035) [ci] Update checkout path for nightly build (#9028) [ci] Fix android source path for MAUI test job (#9030) Link Code of Conduct (#9034) [ci] Update sdk-insertions trigger to manual only (#9029) Update java-interop and android-tools submodule mentions (#9023) LEGO: Merge pull request 9022 [Xamarin.Android.Build.Tasks] fastdev works with aab files (#8990) Use new binutils URL (#9019) Localized file check-in by OneLocBuild Task: Build definition ID 17928: Build ID 9686669 (#9011) LEGO: Merge pull request 9015 [api-merge] Update "constant" values to mirror latest API levels (#9004) [Mono.Android] Fix wrong value for `ApplicationExitInfoReason.Other` (#9003) [Mono.Android] Fix omitted Gl* constants. (#9009) [manifest-attribute-codegen] Generate custom attribute declarations (#8781) [tests] Reduce default build output verbosity (#9002) [templates] Update Wear OS en template string (#9005) [build] Do not provision JDK 8 (#8999) ...
f1f4018
to
5b87b56
Compare
* main: (26 commits) Make APK and shared library alignment configurable (#9046) [r8] update proguard rule to keep .NET runtime classes (#9044) Explicitly align to 4k (#9041) [trimming] preserve custom views and `$(AndroidHttpClientHandlerType)` (#8954) Ignore split configs when bundle config moves shared libraries to base.apk (#8987) Bump to dotnet/android-tools@1c09dcc (#9026) Bump to dotnet/java-interop@ccafbe6 (#9025) [Mono.Android-Tests] Fix repo URL in redirect tests (#9035) [ci] Update checkout path for nightly build (#9028) [ci] Fix android source path for MAUI test job (#9030) Link Code of Conduct (#9034) [ci] Update sdk-insertions trigger to manual only (#9029) Update java-interop and android-tools submodule mentions (#9023) LEGO: Merge pull request 9022 [Xamarin.Android.Build.Tasks] fastdev works with aab files (#8990) Use new binutils URL (#9019) Localized file check-in by OneLocBuild Task: Build definition ID 17928: Build ID 9686669 (#9011) LEGO: Merge pull request 9015 [api-merge] Update "constant" values to mirror latest API levels (#9004) [Mono.Android] Fix wrong value for `ApplicationExitInfoReason.Other` (#9003) ...
Fixes: #8979
When bundle configuration uses standard settings for split configs, the per-ABI library
directory (which contains all of our DSOs/assemblies/blobs etc) will be placed in a per-ABI
split config file named
split_config.{ARCH}.apk
and we use the fact to optimize startuptime.
However, if a custom build config file with the following settings is found, Android bundletool
doesn't create the per-ABI split config file, and so we need to search all the files in order
to find shared libraries, assemblies/blobs etc:
The presence or absence of split config files is checked in our Java startup code which will
notice that split configs are present, but will not check (for performance reasons, to avoid
string comparisons) whether the per-ABI split config is present. We, therefore, need to let
our native runtime know in some inexpensive way that the split configs should be ignored and
that the DSOs/assemblies/blobs should be searched for in the usual, non-split config, way.
Since we know at build time whether this is the case, it's best to record the fact then and
let the native runtime merely check a boolean flag instead of dynamic detection at each app
startup.