-
Notifications
You must be signed in to change notification settings - Fork 45
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
Mono.Cecil.ResolutionException: Failed to resolve AndroidX.AppCompat.Graphics.Drawable.DrawableWrapper #690
Comments
I have also attached a minimalist example to showcase the issue. |
I got the same, some classes are renamed in 1.6 compared to 1.5.1.1 |
i'm getting the same error |
Me too, but downgrading to 1.5.1.1 does not seem to fix it. |
It works in debug but when i change to release and run, that is when the error occurs. |
Me too, the same problem. I try downgrading to 1.5.1.1 but i still having this problem. |
The same to me. I can Build in Debug mode but when I choose Release then it fails: Severity Code Description Project File Line Suppression State |
Hello, i have the same problem. In Debug mode the app compile correctly, but the Release mode, show this error. Somebody solution this error? |
One "workaround" is to go into the android project properties -> Build -> Android -> Linker and set Linker Behavior to "Don't Link" (I'm working on VS for Mac). Obviously this isn't a solution but at least gets past the error. I tried adding the problematic assembly to the "Ignore assemblies" box that is having the issue but I couldn't get that to work. I've used this setting in the past when there's been other problematic assemblies similar to this issue |
What are the side effects of this? I hope someone is looking into this because I am unable to update my app in the store. Android forced me to update the target api which forced me to update Xamarin.AndroidX.AppCompat which will not allow me to build a release version. Frustrating. |
It'll make it bloated. the linker strips out unused objects. so if you don't strip anything out, your apk will contain everything under the sun in it. |
As commented above, the workaround for me has been also to configure "None" in "Linking". PD: In the Android.csproj will appear a line like this: |
compiling works fine in debug, but the (XamarinForms) app simple crashes when you try to run it. In my linked issue you can see that classes in the AndroidX update got renamed and XF needs an update. For those where it worked, do you use a pur Xamarin.Android app and NO forms? |
My app is a xamarin forms app. |
I have no idea why not linking should fix it as the classes are renamed: and in XF the Android Platform implements ClipDrawableWrapper in ShellSearchView.cs from DrawableWrapper and as the class is renamed you get the error at runtime |
Looking at the decompiled Java, Google did in fact rename these classes in 1.5.11.6.0Note that while turning off linking may let your application compile, it will not allow it to run. It will likely crash when XF tries to use this class. |
To be clear, it will crash even if not using that class directly from the app (Xamarin forms might use it internally)? |
Closing, as there is nothing else to be done for this in this repository. The issue is tracked in the Xamarin.Forms repository: xamarin/Xamarin.Forms#15668. |
Does anybody got this fixed? I can't build my app even by downgrading |
other AndroidX libs now depend on AppCompat 1.6.x, so make sure you use the latest version that depend on 1.5.1.x |
@jpobst Just a thought, could there be a breaking change check that would maybe stop the publishing of such nuget packages until the .NET net guidelines for deprecating and removing a class is followed? Something like providing a class with the old name that inherits from the new class but it's marked as obsolete for some time until it's safe to remove it. I know this is manual work to be done in this repo when you're clearly trying to automate the entire process but class renames and removals should be rare and I think .NET nuget packages should follow .NET guidelines even if Google doesn't. |
Unfortunately we maintain roughly ~500 Android packages that are constantly being updated, so doing anything manually is largely out of the question. I think a longer term solution that may help is dotnet/java-interop#1081. Even though these API (and others) are "public", Google considers them "internal" and therefore does not feel the need to maintain API compatibility. If this information was surfaced to C# consumers, they would be aware of the risk and would hopefully choose "safer" API to use. I suspect for this particular case, the Xamarin.Forms team had no idea this API was not considered "public", "stable" API. |
Hi, |
again, google renamed classes in AndroidX lib, and even if the app compiles, it crashes at runtime |
Is this particular instance/error going to be fixed manually before a generic fix is determined? I have not been able to build for months now, and I don't want to release something more than twice as big as before with possible unexpected crashes. |
As mentioned above, this is a Xamarin.Forms issue that is tracked here: |
Android application type
Classic Xamarin.Android (MonoAndroid12.0, etc.)
Affected platform version
VS 2022
Description
Ran migration to AndroidX, and application no longer compiles.
Dependencies here:
Error here:
Relevant log output
The text was updated successfully, but these errors were encountered: