Appcenter can't find APK file - android

I have this weird error, I've been using appcenter for a long time, but never experienced this.
I setup a build with appcenter which fetches from azure devops repo. The application is a Xamarin.Android native application. Once I run the build, everything goes well. Untill the signin step. When the step is about to start, I get this error:
##[error]No matching files were found with search pattern: /Users/runner/work/1/s/**/*.apk
Looks like the APK was not found, though the build runs successfully without error.
Please I need your help to figure out a solution to this issue.

In your csproj file for the Android Application project. Check whether <AndroidPackageFormat>apk</AndroidPackageFormat> is set to apk or aab. If it is aab then you need to change the search pattern to search for /**/*.aab instead. Otherwise, it will be looking for stuff that wasn't produced during the build.
To change the search path of appcenter, go to your build configurations and toggle the switch with label: “Build android app bundle”.

the change <AndroidPackageFormat>aab</AndroidPackageFormat> for <AndroidPackageFormat>apk</AndroidPackageFormat> works for me

If you are developing Android Apps and publishing them through Play Store, starting August 2021, new apps are required to target API level 30 (Android 11) and use the Android App Bundle publishing format. (aab)
If you want to know more about the Android App Bundle publishing format, here you have more information. As Cheesebaron is mentioning, if you are using AppCenter for building and packaging your Apps, just use the flag "Build App Bundle" in the Build configuration

Related

What is the difference between enabling Build App Bundle in Unity and enabling Build App Bundles in Unity Cloud Build?

I'm currently working on an Android app build and have some questions about making the .aab file.
I read this page and I usually generate the apk file but I'm trying to create the Android App Bundle this time. I saw people add a checkmark to the Build App Bundle section in Unity, but I also found there is the Build App Bundles section in the advanced options of Unity Cloud Build. I hadn't realized that I've added a checkmark to both of the section until other people told me, but in this case, do I just need to enable one of the Build App Bundles in Unity and Unity Cloud Build? Why I should not add checkmarks to both of the sections? (sorry if it's a dumb question)
Am I right by enabling Build App Bundle in Unity just creates ".aab" file and I can use the file in UCB when uploading the app to Google play, on the other hand, by enabling Build App Bundle in UCB uses ".apk" file which was generated in Unity project with Build App Bundle disabled, and the ".aab" file created in UCB is applied when the app is uploaded to Google Play?
I was told that other people can only download the ".apk" file, and I guess that's because I enabled both of the Build App Bundle in Unity and UCB. (please correct me if I'm wrong...)
The config in Unity Cloud Build overrides project settings when starting the build. There's no difference between the checkmarks you mention, it's just that the option chosen in Unity Cloud Build is the one that is relevant when you build on UCB.

Can't publish Xamarin.Forms App's APK file on Google Play Store

I want to publish my Xamarin.Forms App to Google Play Store. But when I upload the APK it gives me warning and disables roll-out option. It says we need to use Android App Bundle (.aab) format so that APK can be optimized for size and resources.
Currently, Visual Studio 2019 Archive option does not support the Android App Bundle. I have taken latest update of Visual Studio 2019 but still above format is not supported.
I googled and found some link to do this from the command prompt by modifying some settings in the Project file. But the build returns errors after couple of minutes with exit code 1.
This is frustrating as I can't publish it to Google Play Store. I have already published the iOS version of App.
Any help here will be very much appreciated.
Me and my team are currently releasing to Google Play with no problems our app as APK.
The App Boundle is a nice way to release smaller applications by delivering just what the device that downloads your application needs. The Xamarin Show published recently a video on this topic, that could be of interest for you:
https://www.youtube.com/watch?v=_IOZ0SUKZq4
Through the following images i show how we upload/publish our APK:
First, in the image below you see that APKs are still supported:
APK uploads correctly:
Then we are able to save and review the APK:
APK is uploaded with warning:
The warning states:
For now we just ignore the warning and go on to roll out:
In case that after following those steps your Start Rollout option is not yet enabled, it might be the case that you still have some other Listing Sections for your Application. After you introduce all the information required by Google, the Start Rollout option must be available.

How to optimize apk per ABI when using xamarin and visual studio?

I have a xamarin forms solution with visual studio 2019 on mac.
I try to publish my apk on google play console but it says that they are Unoptimised APK.
In visual studio, I went to Android project options > Android Build.
In release configuration, I checked Generate one package (apk) per select ABI. In the advanced tab, I checked the 4 supported ABI. Then I published and then uploaded 4 apks to google play console.
It doesn't seem to be enough, the website advises me to:
- Use the Android App Bundle to automatically optimise for device configurations (Not sure it is supported for xamarin solution)
- or manage it yourself with multiple APKs (which I did with no success)
I cannot ignore the warning, the button to go to next step is grayed.
Unfortunately Xamarin Android does not yet support App Bundles.
They are working on it and will be available soon:
https://github.com/xamarin/xamarin-android/issues/2727
The PR for the build task is already merged: https://github.com/xamarin/xamarin-android/pull/3146
if you want to try the preview version you can try this (from the Xamarin team):
you should be able to download a visx from our CI system via the Build Status section of our README.md (see https://github.com/xamarin/xamarin-android#build-status) and then picking a Job and going to the Azure Artifacts page. Or just use this to get the latest stable build https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/lastStableBuild/Azure/
Note that these will be the Open Source bits only. So some things (like fast deployment) won't work. But if you are building a release app that should be ok.
The only thing you can do until the App Bundles support will be released, is to use one APK per ABI and ignore the warning from Google Play
Until all your GRAY CHECKS in Google Play Console (on the left side menu ) become green, you will not be allowed to publish in play console and ignore the warning.
New in Visual Studio 2019 for windows 16.4 and for Mac 8.4
added support for building android app package aab format

Your Instant App APKs do not declare a valid

Am having a bad time with android in order to create new release
i have created a Signed APK with two option
then i zipped the .apk file,after trying to upload it to google console am getting the below error
Your Instant App APKs do not declare a valid 'android:targetSandboxVersion' attribute in their AndroidManifest. Using the 'com.android.feature' Gradle plugin to build your Instant App would add this attribute automatically.
Note : the file zipped and all the solutions asking to zip the file, no luck :(
You need to be clear if you are producing an Instant App or a normal Android app. I think this is what is confusing you, or maybe you just aren't being clear in the question.
Android Instant Apps are special Android apps that launch from a web page, and don't need a user to install them. To build them you need the Instant Apps SDK, and to follow the development instructions here. Android Studio will produce a zip for you, you don't need to do it manually
For normal Android apps, you don't need to zip your APKs. Just upload the APK itself to the Play Console.
I think you are probably making a normal Android app, but because you are zipping it, the Play console thinks you are uploading an instant app. So stopping Zipping your APK, and just upload it to the Play Console as a ".apk" file.
While you are at it, I'd recommend using APK V2 signing - it gives much faster installation on modern devices.

Android Build and Installation error: INSTALL_PARSE_FAILED_NOT_APK

Have these erro when i'm trying to build the apk to some devices. Have no idea whats going on.
I get that when i build and install apk on device at the first time.
Someone have some tips for that?
[[EDIT]]
Well, after creating a debug key on keystore, i can build and deploy the apk via ADP to the device. But, dont know why, the error just return...
And now, we have other error:
UPDATE:
I Fix that issue removing all Android SDK and Android Studio and ReInstall it.
The problem can be solved by addding the install flags -r -t in the Run/Debug Configuration Dialog like it's showed in the given image
You can find Run/Debug Configuration Dialog location here according to Jetbrains.
UPDATE: Depending on the Android Studio version the Run/Debug Configuration position in the IDE can be slightly different, but always refer Jetbrains to find whatever you are looking for
When you've installed an APK from another source, Android Studio warns you before overwriting.
For example, if I've developed an application, uploaded it onto the Google Play Store, downloaded it, then try to re-deploy that same application from Android Studio, I'll get this warning.
It's trying to tell you that the way the package is signed is different; it's warning you that another app might be masquerading as the original.
The reason is you are trying to install the application with the same package name.
If you have already downloaded the same application from the play store /app market, then simply uninstall that application and RE-RUN.
This error can also occur if you recently switched branch which had different build variants declared in build.gradle file and you didn't perform gradle sync.
For example you had release and debug and then you switched to branch which has releas, deubg and staging variants; your project will still build but while installing apk this error can pop up.

Categories

Resources