-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Make XA0119 an error for App Bundles in…
… Debug (#4841) Fixes: https://developercommunity.visualstudio.com/content/problem/1076396/fatal-signal-11-sigsegv-code-1-segv-maperr-fault-a.html Context: #4071 (comment) Context: https://forums.xamarin.com/discussion/comment/414288/#Comment_414288 A few reports have come in from users about the crashes that happen when `$(AndroidPackageFormat)`=`aab` in the Debug configuration. There was already a build warning for this scenario, but since it is known that this scenario currently produces a crash, changing the warning to an error will improve the visibility of the known limitation and save user's time. Example of the current crash: D Mono : DllImport attempting to load: '__Internal'. D Mono : DllImport error loading library '__Internal': 'Could not load library: Library '/system/lib64/libmonodroid.so' not found.'. W Mono : DllImport unable to load library '__Internal'. F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5f656b6f766e59 in tid 17118 (dsingleviewapp1), pid 17118 (dsingleviewapp1) I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone I /system/bin/tombstoned: received crash request for pid 17118 I crash_dump64: performing dump of process 17118 (target tid = 17118) F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** F DEBUG : Build fingerprint: 'google/blueline/blueline:9/PQ3A.190505.002/5450365:user/release-keys' F DEBUG : Revision: 'MP1.0' F DEBUG : ABI: 'arm64' F DEBUG : pid: 17118, tid: 17118, name: dsingleviewapp1 >>> com.contoso.androidsingleviewapp1 <<< F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5f656b6f766e59 F DEBUG : x0 0000000000000012 x1 0000007fcf419058 x2 0000000000000012 x3 0000007fcf002020 F DEBUG : x4 0000000000000010 x5 0000000000000010 x6 fefeff7ecdff1f1f x7 7f7f7f7fff7f7f7f F DEBUG : x8 0000000000000000 x9 67fd524936ad3dce x10 00000000000003ef x11 000000007fffffef F DEBUG : x12 0000000000000012 x13 00000000ffffffff x14 0000007fcf418cc4 x15 0000007fcf41885c F DEBUG : x16 000000728cc9acf0 x17 0000007326bf2afc x18 0000007fcf41885a x19 0000000000000000 F DEBUG : x20 0000000000000000 x21 0000000000000040 x22 000000728cc73908 x23 000000728cbd3955 F DEBUG : x24 000000728cbf0067 x25 000000000000002e x26 000000728cbee031 x27 000000728cbd3953 F DEBUG : x28 005f656b6f766e59 x29 0000007fcf4194e0 F DEBUG : sp 0000007fcf419480 lr 000000728cba1b74 pc 000000728cba1b84 F DEBUG : F DEBUG : backtrace: F DEBUG : #00 pc 0000000000272b84 /data/app/Mono.Android.DebugRuntime-bnHNXx4CyZU9L_ryuctu_A==/lib/arm64/libmonosgen-64bit-2.0.so W ActivityManager: Force finishing activity com.contoso.androidsingleviewapp1/crc647d7dcab8da8ee782.MainActivity E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_09 I BootReceiver: Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE) Other changes: Adjust the wording of the message slightly to align with the fact that it is now an error and to reflect that it is the shared runtime in particular that causes the current issue. Using `$(EmbedAssembliesIntoApk)`=`false` with `$(AndroidUseSharedRuntime)`=`false` currently succeeds on device, so this error can likely be removed or changed back to a warning about fast deployment whenever the shared runtime feature is removed. Move the message string to the `.resx` file and switch to the `<AndroidError/>` task to make the message localizable.
- Loading branch information
1 parent
dc830f7
commit 17cc49e
Showing
19 changed files
with
136 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
### XA0119 error for unsupported use of Android App Bundle format in Debug configuration | ||
|
||
The Android App Bundle publishing format is not currently compatible with the | ||
recommended fast deployment settings for Debug configuration deployments. | ||
Previously, projects that had **Android Package Format** | ||
(`AndroidPackageFormat`) set to **aab** in the Debug configuration along with | ||
the recommended **Use Shared \[Mono\] Runtime** setting would produce a build | ||
warning, but they would also fail to launch on device. | ||
|
||
Since this configuration is not currently supported, Xamarin.Android now emits a | ||
build error for it instead of warning: | ||
|
||
``` | ||
error XA0119: Using the shared runtime and Android App Bundles at the same time is not currently supported. Use the shared runtime for Debug configurations and Android App Bundles for Release configurations. | ||
``` | ||
|
||
To resolve this error, change the **Android Package Format** setting in the | ||
Visual Studio project property pages to **apk** for the Debug configuration. | ||
This corresponds to the `apk` value for the `AndroidPackageFormat` MSBuild | ||
property in the _.csproj_ file: | ||
|
||
```xml | ||
<PropertyGroup> | ||
<AndroidPackageFormat>apk</AndroidPackageFormat> | ||
</PropertyGroup> | ||
``` | ||
|
||
This error is only relevant for Debug configuration builds. Release | ||
configuration builds can continue to use the Android App Bundle packaging | ||
format. | ||
|
9 changes: 9 additions & 0 deletions
9
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.