Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Android app with shared Android resource lib crash with target API level 29 or 30 #10809

Closed
zijianhuang opened this issue May 21, 2020 · 1 comment
Labels
4.6.0 regression on 4.6.0 Android10 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression in-progress This issue has an associated pull request that may resolve it! p/Android t/bug 🐛
Milestone

Comments

@zijianhuang
Copy link

Description

To have multiple Android applications sharing the same resources mostly images, there's an Android class library containing the resources and assets, referenced by each Android app project. This has been working well with Xamarin.Forms 4.1-4.5. However, with Xamarin.Forms 4.6, the Android app crashes during startup.

Steps to Reproduce

Repository at https://github.com/zijianhuang/xamarinforms4bugs is demonstrating good ones in branch master and bad ones in branch ResourcesInLib.

The master branch is with Xamarin.Forms 4.6 and Android app project that contains Resources. This is working well.

The ResourcesInLib branch is with Xamarin.Forms 4.6 and Android class project that contain Resources. When the target API level is 28 (Android 9), things are OK. When the target API level is 29 or 30, the app crashes during startup.

After checking out the ResourcesInLib branch, build and run it, things are looking OK with the target API level is 28 (Android 9). Then you change to target API level 29 or 30, then build and run on a device, the app crashes on startup.

Expected Behavior

The app runs normally showing a button and a label

Actual Behavior

Crash.

Basic Information

Visual Studio Professional 2019, v16.6.0

  <ItemGroup>
    <PackageReference Include="Xamarin.AndroidX.AppCompat.Resources">
      <Version>1.1.0</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.Forms" Version="4.6.0.800" />
    <PackageReference Include="Xamarin.Google.Android.Material" Version="1.0.0" />
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.1.0" />
    <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0" />
    <PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0" />
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0" />
    <PackageReference Include="Xamarin.Forms.Visual.Material">
      <Version>4.6.0.800</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.6" />
  </ItemGroup>

Reproduction Link

https://github.com/zijianhuang/xamarinforms4bugs/tree/ResourcesInLib/

Remarks

Probably loosely related to issue #6327

@zijianhuang zijianhuang added s/unverified New report that has yet to be verified t/bug 🐛 labels May 21, 2020
@zijianhuang zijianhuang changed the title [Bug] Android with shared Android resource lib crash with target API level 29 or 30 [Bug] Android app with shared Android resource lib crash with target API level 29 or 30 May 22, 2020
@samhouts samhouts added this to the 4.6.0 milestone May 26, 2020
@samhouts samhouts added i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often Android10 labels May 26, 2020
@jsuarezruiz jsuarezruiz removed the s/unverified New report that has yet to be verified label Jun 3, 2020
@PureWeen
Copy link
Contributor

PureWeen commented Jun 8, 2020

This should be fixed by this PR

#10975

@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.6.0 regression on 4.6.0 Android10 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression in-progress This issue has an associated pull request that may resolve it! p/Android t/bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants