-
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
Android.Content.Res.Resources+NotFoundException when using an external library #3342
Comments
Alright, if I do a weird trick:
Then is will run and work as expected. However, I do not see any bug related to that in the 16-2 milestone. |
Thanks @dellis1972. It seems that #3329 is not included in 9.4.0.34, so I don't think it's related. (But I don't know :) ) |
@jschmid looking at your stack trace:
Can you reproduce the problem with your repro project if you change it to use MvvmCross instead of Xamarin.Forms? |
@jonathanpeppers I added a new branch with MvvmCross. The sample works with Xamarin.Android 9.1, 9.3, 9.4.0.34. |
@jschmid circling back on this, does the problem still occur with the latest preview? Xamarin.Android 10.x. Would you be able to share the APK file that is crashing? You can email me at what is listed on my Github account if you don't want that public. |
Thanks @jonathanpeppers. It still crashes with 9.4.1.0. I could not make it work with 10.0.0.4. It crashes on I've sent you APKs by emails. |
Will be discussing further over email, the APK I'm seeing a different error:
But I can find the type in the assembly in the APK it's looking for. So I wonder if it could be related to AndroidPreloadAssemblies=False. |
@jschmid and I did some troubleshooting over email, and we found the issue was their solution had a Xamarin.Android app project referencing another app project. The only case this has ever been supported is with Android Wear, which is a special case to embed the Wear app's APK into What was happening was the wrong I filed #3638 to see what we can do to better prevent developers doing this. @jschmid let me know otherwise, but I think you solved your issue by moving your solution around. Closing, thanks! |
Thanks @jonathanpeppers for the investigation. We will find a way to make it work now. |
@jschmid Did you find any solution for this ? Can you please share it with me if you got it ? |
@SagarPanwala as @jonathanpeppers said:
luckily for us it was easy to "unwrap" the projects and remove this wrong reference. We now have upgraded to Xamarin.Android 10 and it works fine. |
When running our project with Xamarin.Android 9.3.0.23, the app crashes with a
Android.Content.Res.Resources+NotFoundException
as soon as we try to use a resource that is bundled by an external library.At first, I though this was caused by the library itself that was not correctly bundled, but then realized that it failed with any external library. This happens for example with Acr.UserDialogs or Plugin.Fingerprint.
Steps to Reproduce
Unfortunately, I do not have a working (crashing) example. I tried to make a repro project, but it works as expected.
Expected Behavior
Xamarin.Forms app can use resources from external libraries.
Actual Behavior
Version Information
From Visual Studio for Mac
=== Visual Studio Community 2019 for Mac ===Version 8.1.5 (build 9)
Installation UUID: c647d718-5745-4cd4-a94d-56ba562963eb
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.6.0.25 (d16-0 / 50f75273)
=== Mono Framework MDK ===
Runtime:
Mono 5.18.1.28 (2018-08/223ea7ef92e) (64-bit)
Package version: 518010028
=== NuGet ===
Version: 5.0.2.5988
=== .NET Core ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.2.5
2.1.8
2.1.2
2.0.5
2.0.0
SDK: /usr/local/share/dotnet/sdk/2.2.300/Sdks
SDK Versions:
2.2.300
2.2.107
2.1.504
2.1.302
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Sdks
=== Xamarin.Profiler ===
Version: 1.6.10
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Xamarin.Android ===
Version: 9.3.0.23 (Visual Studio Community)
Commit: HEAD/d0b48056f
Android SDK: /Users/jonas/Library/Android/sdk
Supported Android versions:
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.1
SDK Build Tools Version: 29.0.0 rc1
Build Information:
Mono: mono/mono@3a07bd426d3
Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
LibZipSharp: grendello/LibZipSharp/d16-1@44de300
LibZip: nih-at/libzip@b95cf3f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/jonas/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android Device Manager ===
Version: 1.2.0.44
Hash: aac645b
Branch: remotes/origin/d16-1
Build date: 2019-05-29 19:55:24 UTC
=== Xamarin Designer ===
Version: 16.1.0.467
Hash: f1657e133
Branch: remotes/origin/d16-1-new-document-model
Build date: 2019-06-18 21:57:42 UTC
=== Apple Developer Tools ===
Xcode 10.2 (14490.120)
Build 10E125
=== Xamarin.Mac ===
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.
=== Xamarin.iOS ===
Version: 12.10.0.157 (Visual Studio Community)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:47-0400
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Build Information ===
Release ID: 801050009
Git revision: bd0ab28ba941b19b39322247db020dcd0fb305d0
Build date: 2019-07-03 17:15:21+00
Build branch: release-8.1
Xamarin extensions: 8cc25b5cb090e6c23b62a7901000c299977eb08d
=== Operating System ===
Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
Thu Apr 25 23:16:27 PDT 2019
root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
We are otherwise using Xamarin.Forms 4.0 and MvvmCross 6.2.3.
When using Xamarin.Android 9.1.8 it works fine. It started crashing with Xamarin.Android 9.2, and also 9.3 now. (I could not try with 9.4 preview because it does not compile, see #3343)
I am testing with Android 9, so it does not seem related to #3314.
Workarounds ?
I tried to disable AAPT2 like explained in the release notes. It does not help.
For now we can compile with Xamarin 9.1 and it works, but it does not look good for the future.
The text was updated successfully, but these errors were encountered: