Skip to content

Conversation

@jonpryor
Copy link
Contributor

@jonpryor jonpryor commented Aug 25, 2017

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59036

When building a project with $(AndroidEnableMultiDex)=True, an
obj/$(Configuration)/multidex.keep file is generated, which is a
list of Java classes, one per line, which should be placed into the
"main" .dex file for the application.

Unfortunately, commit 6829b7d results in a multidex.keep file which
places all types onto a single line, instead of one class per line.
This results in breaking multidex, as when this happens, nothing
ensures that the required types are in the main .dex file, which
could prevent the app from launching on the target device.

Fix the <CreateMultiDexMainDexClassList/> task by always appending a
newline after every type which should be preserved.

@jonpryor
Copy link
Contributor Author

@dellis1972: How should this best be tested? Would we want a "normal" MSBuild tooling test, which would check for newlines in the output? Or should we update an existing test to set $(AndroidEnableMultiDex)=True, for some on-device testing?

@dellis1972
Copy link
Contributor

@jonpryor there is already a number of MultiDex tests we can add this check too.
I can do that this week if you like. We can merge this as is if its urgent.

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59036

When building a project with `$(AndroidEnableMultiDex)`=True, an
`obj/$(Configuration)/multidex.keep` file is generated, which is a
list of Java classes, one per line, which should be placed into the
"main" `.dex` file for the application.

Unfortunately, commit 6829b7d results in a `multidex.keep` file which
places all types onto a single line, instead of one class per line.
This results in *breaking* multidex, as when this happens, nothing
ensures that the required types are in the main `.dex` file, which
could prevent the app from launching on the target device.

Fix the `<CreateMultiDexMainDexClassList/>` task by always appending a
newline after every type which should be preserved.
@jonpryor jonpryor force-pushed the jonp-fix-multidex.keep branch from d468082 to 13b8f94 Compare August 28, 2017 16:48
@jonpryor
Copy link
Contributor Author

I updated the BuildTest.BuildMultiDexApplication() test.

@jonpryor jonpryor merged commit 9ead848 into dotnet:master Aug 28, 2017
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Sep 6, 2017
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59036

When building a project with `$(AndroidEnableMultiDex)`=True, an
`obj/$(Configuration)/multidex.keep` file is generated, which is a
list of Java classes, one per line, which should be placed into the
"main" `.dex` file for the application.

Unfortunately, commit 6829b7d results in a `multidex.keep` file which
places all types onto a single line, instead of one class per line.
This results in *breaking* multidex, as when this happens, nothing
ensures that the required types are in the main `.dex` file, which
could prevent the app from launching on the target device.

Fix the `<CreateMultiDexMainDexClassList/>` task by always appending a
newline after every type which should be preserved.
Aguilex pushed a commit that referenced this pull request Sep 6, 2017
[Xamarin.Android.Build.Tasks] Insert newlines between types (#790)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants