Xamarin forms invalid archive android ( no .APK files)

Viewed 2168

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

3 Answers

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

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

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.

Related