-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Corrupt aapt_rules.txt when Creating a Package per Abi on Android #15800
Comments
Going by that original issue, this doesn't seem specific to the MAUI UI Project but a general issue with the Xamarin.Android.Build.Tasks that would affect anything. This seems like something that would go to the xamarin-android repo, if it's not already addressed in the newest versions of VS / Android SDK. @jonathanpeppers what do you think? Is there anything in this repo that needs to be addressed? |
This change should be in .NET 7 already: dotnet/android#7587 Are you able to record a |
Hi @yayameen. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
I will try to record a log and add it. I am targeting .NET 6 now, but I don't know that there is any reason not to move to .NET 7. I can try that as well. I was trying to get a new version of the software out the door, so I stayed with .NET 6 to reduce the number of moving parts. |
The above fix is not in .NET 6, so it would make sense if you see it there. It is a general good idea to move to .NET 7, because .NET 6 mobile workloads are out of support: |
Migrating to NET 7 seems to have worked. I ran into this issue at first ( xamarin/GooglePlayServicesComponents#694 ) but followed the work around. That being said, I can't say definitively that the bug was consistent before. I'm not sure if a race condition or some other build setting might have come into play. For now, I will consider this resolved with your amazing help. Thank You. |
I built many times successfully, but our build machine just encountered the same error using NET 7 targeting Android 33.0 |
Turning off r8 linking seemed to resolve the issue, but I can't say that workaround is reliable. |
Description
Seems to be related to: dotnet/android#7447
When AndroidCreatePackagePerAbi is set to True in a project, a build error occurs due a corrupt aapt_rules.txt file.
I was able to duplicate this in both Visual Studio 17.5.4 and Visual Studio 17.6.4 on different machines.
Sample of end of aapt_rules.txt:
Steps to Reproduce
Link to public reproduction project repository
None
Version with bug
7.0.86
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
31
Did you find any workaround?
Turning off AndroidCreatePackagePerAbi removes the build error, but then you end up with an APK 4 times larger, which contains architectures you do not need to target. In my circumstance the APK is over 100MB.
Side note: Nothing I do will prevent release mode from placing every architecture in the APK. In debug mode I can target a single architecture. I am targeting ARM64. I haven't tried other architectures. Creating an APK for each abi was my way of working around that issue.
Relevant log output
The text was updated successfully, but these errors were encountered: