Cannot generate valid Android apk
See original GitHub issueDescription
I’ve tried to change the package bundle from aab to apk, for generating the apk through Archive...
, but I couldn’t find the related option on the project properties, as I can on the Android project on a Xamarin Forms app (Android Options > Android Package Format). I’ve tried to force the Archive Manager
to generate a apk by manually editing the .csproj file, with the following lines:
<PropertyGroup>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidPackageFormat>pkg</AndroidPackageFormat>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidDexTool>dx</AndroidDexTool>
</PropertyGroup>
but it fails stating that Failed to create App archive 'AppName'. Invalid Android Archive (no .apk files)
.
Is there something I’m doing wrong here?
P.D: I don’t know if generating an apk is a expected current feature, or if it isn’t and this should be a feature request. Just tell 😄
Steps to Reproduce
- Create a blank MAUI app project.
- Manually edit the
.csproj
to add the former lines. - Ensure the build is configured for
Release
. - Try to archive the app.
Version with bug
Preview 12 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11
Did you find any workaround?
No.
Issue Analytics
- State:
- Created 2 years ago
- Comments:26 (12 by maintainers)
Top Results From Across the Web
APK not working made from Android Studio V 2.3.3
1 Answer 1 · Delete you build folder inside the App folder. · Goto Build>Generate Signed APk and provide recomended Details, make sure...
Read more >Why I can't generate a signed apk file in Android Studio?
Go to Build-> Generate signed bundle/apk. Follow below video for further process. https://youtu.be/MjpaSGEmQHs. Thank me later..!
Read more >Sign your app | Android Studio
In the Generate Signed Bundle or APK dialog, select Android App Bundle or APK and click Next. Below the field for Key store...
Read more >Known issues with Android Studio and Android Gradle Plugin
If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version...
Read more >Analyze your build with the APK Analyzer | Android Studio
Android Studio includes an APK Analyzer that provides immediate insight into the composition of your APK after the build process completes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, what is the crash?
You should check
adb logcat
output, some instructions here:https://docs.microsoft.com/xamarin/android/deploy-test/debugging/android-debug-log#accessing-from-the-command-line
I believe there was discussion of three separate problems here.
For the FastDeploy issue, closing this and moving to: https://github.com/xamarin/xamarin-android/issues/6945
If you have other Android-related issues, file them for us there, thanks!