-
Notifications
You must be signed in to change notification settings - Fork 525
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
AndroidPackagingOptionsExclude cannot be modified #8456
Comments
@t4e-dev can you add a <Project>
<ItemGroup>
<AndroidPackagingOptionsExclude Remove="$([MSBuild]::Escape('*.kotlin_*'))" />
</ItemGroup>
</Project> Or if you want to try removing all of them: If this works, @dellis1972 maybe we should consider moving this Or is what we are doing a bad idea, because it breaks |
We need some way to keep the stuff that kotlin.reflect.jvm needs. Perhaps the NuGet (assuming there is a binding) can make sure the required files are included. But there should be a way to override this. The |
Thanks for your quick support.
is still present in the diag log. So the instructions from the targets file are somehow ignored.
|
Placing this in the
The down side is you will have allot of kotlin files in your apk/aab, I assume most of which are not needed. |
Looking at the file list I see
I suspect only the |
Can you try this. It should preserve all the 'builtins' .
|
That did the trick! Thanks a lot. :-) Perfect support! Regarding the required files : Honestly I cannot really tell what the required files are. My best guess for a general product like Visual Studio is to look into the magic that happens when in an Android native application
in a build.gradle file are applied. |
This is fixed via #8459 |
Android application type
.NET Android (net7.0-android, etc.)
Affected platform version
VS2022 17.7.5
Description
We have a large former Xamarin Android application which we converted to .NET7.
The application is using some bindings which are using Kotlin and kotlin-reflect
The application works in DEBUG mode but when it gets packaged in RELEASE mode the app crashes on Android.
The exception in ADB log is :
After digging a lot around we discovered that debug APK and release APK have different content regarding kotlin modules.
This lead us to the csproj ItemGroup element AndroidPackagingOptionsExclude which was added with this PR : 7356
We played around with the element and tried to remove it with
in the main project. But our remove was ignored during build and the exclusion was still happening.
So we modified the Xamarin.Android.Common.targets file directly by commenting out the wildcard. This resulted into a working application again.
So we can confirm so far that the wildcard '.kotlin_ may be to restrictive and should be removed from the target file. The filter is removing the files *kotlin_builtins which are used by the package kotlin.reflect.jvm
Regarding the remove of the AndroidPackagingOptionsExclude in our csproj : Are we doing something wrong with the itemgroup above ?
Steps to Reproduce
Did you find any workaround?
Modifying xamarin.android.common.targets
Relevant log output
No response
The text was updated successfully, but these errors were encountered: