Prashant Rajput
Prashant Rajput

Reputation: 81

Xamarin forms invalid archive android ( no .APK files)

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

Upvotes: 5

Views: 5138

Answers (4)

jjthebig1
jjthebig1

Reputation: 638

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.

Upvotes: 0

Fahad Ali Qureshi
Fahad Ali Qureshi

Reputation: 175

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.

Upvotes: 4

Hamid Israfilov
Hamid Israfilov

Reputation: 111

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

Upvotes: 6

Jessie Zhang -MSFT
Jessie Zhang -MSFT

Reputation: 13833

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

Upvotes: 3

Related Questions