Xamarin forms invalid archive android ( no .APK files)
Asked Answered
I

4

5

I have tried all the suggested solutions in stack overflow. I am not getting any error while deploying or while building my solution. Build is successful each time.

I am using visual Studio 2022 (preview).

Its my .csproj config. This is the error

enter image description here

Invincible answered 4/12, 2021 at 16:28 Comment(1)
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.Magpie
K
6

You could also solve the error by deleting obj and bin folders under main and android folders.

Kimono answered 29/3, 2022 at 15:34 Comment(3)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Magpie
This worked for me using VS 2022. I exited VS, deleted the Bin and Obj folders under the Android project only, and restarted VS. Build and archive then worked successfully.Unexpressed
Just doing a full solution build, prior to a publish of project fixed it for me.Urena
F
4

If you are getting error for (.aab) package format, check your .Android.csproj file, and make sure this entry exists:

 <AndroidPackageFormat>aab</AndroidPackageFormat>

And then follow the steps below:

  1. Exit Visual Studio
  2. Delete all bin and obj folders from your project
  3. Start Visual Studio
  4. Open your project
  5. Clean Solution
  6. Rebuild Solution
  7. Archive android project

I hope this helps.

Flibbertigibbet answered 30/5, 2022 at 10:5 Comment(0)
C
3

You can recheck your .Android.csproj file, and try to remove

 <AndroidPackageFormat>aab</AndroidPackageFormat>

If the problem persist, try the following method:

1.right your android project and click property > Build > Output path;

2.change

..\bin\yourappname-android\Release\AnyCPU

by

 ..\bin\yourappname-android\AnyCPU
Commercial answered 6/12, 2021 at 2:3 Comment(6)
I just changed the path forth and back in Properties > Build > Output, i.e. keeping the original value, and the problem fixed for me, didn't need to use a different path.Irate
Thanks Jessie but in my .Android.csproj I haven't seen anywhere that <AndroidPackageFormat>aab</AndroidPackageFormat> and I had tried that changing output path solution earlier too but had' not worked for me but this problem has been fixed now. I have done it multiple times like cleaning obj and bin then first build it in debug mode and then rebuild in release mode and the archive I am not sure how but after multiple attempts it worked.Invincible
Congrats. Thanks for your support for xamarin.Commercial
Did anyone ever find a proper solution for this issue?Wristlet
Yeah I'm sitting here after half an hour baffled by my "I don't know what I did I just kept trying to archive until it worked" solution... So proud of being a xamarin.forms developer... Sometimes turning it off and on again works. Sometimes.Candent
tried select solution-right click-archive all , worked for me once, strange issuesBs
B
0

I changed the ApplicationDisplayVersion and ApplicationVersion values in the csproj file and it worked. Looks like VS will not publish the same version twice, which is a good feature because I used to forget to increment the versions when developing in Xamarin.

Braga answered 21/3 at 16:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.