Jenkins Plugin Google Play Upload Android APK to Google Play fail: nullpointerexception - android

The Jenkin PlayStore upload plugin seems not working for me, always get the following weird error. Manually upload the jenkin apk builds works just fine. Any idea or guess why?
The following is the Jenkins output console, and thanks so much in advance.
Archiving artifacts
Authenticating to Google Play API...
- Credential: xxxxxxx
- Application ID: com.xxx.xxx
ERROR: Build step failed with exception
java.lang.NullPointerException
at org.jenkinsci.plugins.googleplayandroidpublisher.Util.getPublisherErrorMessage(Util.java:97)
at org.jenkinsci.plugins.googleplayandroidpublisher.ApkPublisher.publishApk(ApkPublisher.java:383)
at org.jenkinsci.plugins.googleplayandroidpublisher.ApkPublisher.perform(ApkPublisher.java:198)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1749)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Build step 'Upload Android APK to Google Play' marked build as failure

Looking at the source code it appears that a PublisherApiException is being thrown with no error messages.
This is super strange, because looking at the source this list should always be populated.
So I can't see any way this could happen with the current source. You might want to try updating your plugin, or running it in a debugger (or adding print statements) to see what is going on.

Related

App Crashes on Play Store but not Play Console

I uploaded an aab to the play console and finally got it listed on the play store. This app was written in Python and Kivy, and I was able to generate the aab by first running buildozer then running the script through Android Studio by following various instructions around the net.
I can download an apk from the play console which is generated from the aab, and it works just fine. However, when I install the app from the play store it closes as soon as it opens. However, I dont get a true crash report.
This is my first real app, and I'm a little lost on how to proceed.
Questions:
Any idea what's going on here?
What's the difference between the apk generated from the play console vs whatever is installed from the play store?
How can I diagnose this issue if I don't have access to the apk with the issue?
I got it to work by using a dev version of Buildozer to create the aab instead of using Android Studio.
The instructions can be found here by scrolling down to Release Builds:
https://github.com/Android-for-Python/Android-for-Python-Users#how-to-create-a-release-bundle-aab
Use Firebase Crashlytics, it logs crashes in the firebase console. You can use it in cases you can't access the apk. It requires some setup but is pretty easy. In your case, however, I think you can see the stacktrace in Android Studio if you set no filter and manually search for your app in LogCat.
Rather than aab upload file in .apk it will properly run.It is not good scenario to use apk bcz it increase the app size.When we use aab file to upload some files are not working bcz of this crash occurs.

fastlane: [!] Google Api Error: Invalid request - Package not found: com.example.todo

I am using React-native for my app. I have named my name reactamplify. I want to deploy my app to Google play-store. For automation deployment I am using first time fastlane. I found this documentation, follow the steps and give API grant access. In my React native app, I navigate to android folder then run this command fastlane init. Give json_key_file path my downloaded auth json file. But I got confused about package name. I search my app name in vscode com.reactamplify replace them into com.example.todo. Then run android folder fastlane supply init, I am getting this error: [!] Google Api Error: Invalid request - Package not found: com.example.todo. I really don't know how to fix it :(. Really lost TBH.
When I run fastlane supply. I got this image
PS: It would be awesome if someone gives me example with images
I found the reason. I need to upload at least one build to google Play store app manually. That’s why I got package name error.
In my case, I deleted the fastlane folder and then ran the following again:
fastlane supply init
For me i found that google play ignore the "com." in the package name! So when submitting a new release make sure to remove "com." from your package string.

How to Upload Android APK to Fabric Beta

What I want?
I have an Android App that I want to upload to Fabric Beta.
How do I want it ?
I want to upload my Android App to Fabric Beta using Fastlane.
What goes wrong ?
After running my fastlane fastlane beta command, I get a nice report that everything is fine and I should see my app on Fabric dashboard:
[16:06:57]: Uploading the build to Crashlytics Beta. Time for some ☕️.
[[16:07:03]: Build successfully uploaded to Crashlytics Beta 🌷
[[16:07:03]: Visit https://fabric.io/_/beta to add release notes and notify testers.
But when I go https://fabric.io/_/beta, my app DOES NOT appear there !
What else did I try?
Tried the official integration doc. Installed the Fabric plugin on Android Studio.Logged in with my credentials,selected my app bundle identifier and always get throwed to credentials screen from the "All Kits" screen.Looks like a bug to me.Didn't find solution for that anywhere.
Did I try to integrate Fabrik SDK by hand and run the app ?
Yes I did, and the app still didn't appear in the Fabric dashboard.Didn't see any related errors in the logcat.
What about uploading using Gradle Plugin?
That one was tricky because I had to fix numerous errors and provide fabric.properties file with my credentials, but eventually got a promising message :
Task :application:crashlyticsUploadDistributionGoogleProdStagingAlpha
Uploading /Users/yanbraslavsky/booking-app/application/build/outputs/apk/googleProd/stagingAlpha/application-google-prod-stagingAlpha.apk to Crashlytics...
BUILD SUCCESSFUL in 6s
And still no app in the Fabric dashboard.
What do I want now?
I have an Android App that I want to upload to Fabric Beta...
Fabric/Firebaser here -
This issue was solved over the Fabric support channel! When attempting to upload a Beta distribution to Fabric, first make sure that the app is onboarded properly (visible on your dashboard at fabric.io). If it isn't, the above can happen where you still get a successful upload result without being able to view the distribution.
If you've included all the Fabric dependencies and are still having trouble seeing the app on your dashboard, try running a clean of the project, then building, waiting some time, and running the app. If you still can't see the app after a few minutes, reach out to the Fabric support address with your package name/bundle ID.
Also make sure that your build.gradle is properly configured if you have multiple build configurations. In this particular app, the issue was in the applicationIdSuffix of one of the build configurations. Finally, check that you've used the correct API key and build secret from the Fabric organization settings - this ensures that you have permission to upload the Beta distribution and puts it in the right place.

How to fix App not installed error in Android

I develop android application and when create APk from this application (with Generate Signed APK) and when install this apk in other devices not install and show me this error on phone : App not installed
how can i fix it?
This is usually caused when you have a debug apk that is signed with a different certificate and you are trying to install a release version with a different certificate. If you have a debug apk on the device try uninstalling it and try again.
For me, **disabling Google Play Protect** options from play store app worked , and i was able to get rid of the App not Installed error.
Check the play protect option available in Google Play Store Navigation menu.
android:extractNativeLibs="true"
in AndroidManifest.xml file fixed the problem for me.
<application
// ...
android:extractNativeLibs="true"
Notes: I got this error when building with App Center and all the signing was handled by app center.
For easier debugging just drag and drop the apk file in the android emulator.
Your will get a more detailed message why the app is not installed.
Previously I tried all the Play protect things and checked the build.gradle file contains no release info in signingConfigs and that there's no signingConfig in buildTypes.release just as described in the other answers from this page.
delete build folder from your project and then build project again.. working for me
File an appeal with Google Play Protect
Proper way to create URL to download your APK file
You need to make a direct link to download application, not to a drive.
First, I uploaded my application on google drive and shared the link.
after submitting the apeal I instantly received a mail
Hi
You recently submitted an appeal for an app with Google Play Protect.
The link you have provided does not lead to an APK file or the file is
corrupted. Please submit a new appeal and check that you are providing
the link to the correct APK file.
Thank You, Google Play Protect Team
Upload your APK file to dropbox (didn't try any other platform)
Get sharable link (link setting should be Anyone with this link can view the file.)
Your link will something like this https://www.dropbox.com/s/xxxxxxxxxx/ApplicationName.apk?dl=0
Change the ending apk?dl=0 to apk?dl=1 (Changing it to 0 will make the link to direct download the APK, try it yourself and see.)
Your new link should be like this https://www.dropbox.com/s/xxxxxxxxxx/ApplicationName.apk?dl=1
Use any URL Shortner
Your acceptable link is ready
If you don't know what is your Application package name, then go to your AndroidManifest.xml
There will be line package="com.example.MyApplication"
After submitting it if everything goes correct you may receive a mail instantly from Google
Hi
You recently submitted an appeal for an app with Google Play Protect.
We have successfully received the appeal for your app. Our team will
review the app and any information you have provided.
Thank You, Google Play Protect Team
Don't expect any other reply from Google Play Protect Team, In my case, I didn't receive any mail, But the issue was solved, After a 2-3 business day the issue was fixed while installing the application I no longer received the Blocked by Play Protect warning. and App not installed
I know this is an old thread, but I have had the same "App not installed" issue that I have been struggling with, this is how I solved it.
Connect your device to your computer, and just before you start installing the app, run this command from commandline:
adb logcat > logcat.txt
And stop it right after you get the "App not installed" message. (Ctrl + c).
The reason for starting and stopping it just around the install process is because logcat is very "chatty".
Have a look in the generated text-file to find the error. It can be like finding the needle in a haystack, but I found my error just before "packageinstaller.InstallFailed" log-line.
The error looked like this:
10-10 21:36:43.402 1549 1940 E NativeLibraryHelper: Library 'libjsc.so' is not page-aligned - will not be able to open it directly from apk.
10-10 21:36:43.402 1549 1940 W NativeHelper: Failure copying native libraries [errorCode=-2]
10-10 21:36:43.403 1549 1940 E PackageInstallerSession: Commit of session 1728055717 failed: Failed to extract native libraries, res=-2
I fix this issue by correct the targetSdkVersion from build.gradle file.
My solution for this issue, I monitored the Logcat and could see the error because my app was not installed.
I received message DOWNGRADE VERSION, added a VersionCode in BuildGradle and for me it's working.

Unable to upload the APK expansion file on Google Play

I'm using unity android, and I'm trying to upload my app.
It's a 80Mo app, so I had to split it.
Here is how I set up the Other Settings in player prefs (unity3d):
Bundle identifier: com.CompanyName.APKName (that's an example obviously )
Bundle Version: 1.0
Bundle Version Code: 1
Minimum API: (lowest) 2.0.1
Device filter: Armv7 only
Install Location: Prefer Extern
Graphics Level: OpenGL ES 2.0
Internet: Auto
Write Access: Internal only
API: .NET 2.0 subs
The product name is different than the APK name.
My files are named:
- APK: APKName
- Expansion file: main.1.com.CompanyName.APKName
In the build settings, nothing is changed (Development Build is still False).
(I'm not using a patch file).
My problem is that when I upload the APK Expansion file, it gets stuck on "processing". Apparently it's an internal error that occurs, and google play is failing the upload but doesn't display anything on the screen. I've been trying to upload that for days now and I can't find anything that helps online.
EDIT: On chrome I get stuck to processing and with firefox, I get stuck to 99%...
I've see theses post StackOveflow post 1 StackOverflow post2 but nothing changes for me.
I'm following this tutorial: tutorial unity to google play
EDIT: I can't access my app through the old console... I get the following message:"Failed to load application list. Try again later."
Thanks for the help
Boris
Ok I did it!!!
I had to create another version of my app with a higher version number. Then I went to the old console, as my app wasn't accessible through the old console I had to upload again my first APK by clicking on upload apk. Once uploaded the old console shows an error saying that there is already an app with that package name. After closing the error message the app is accessible through the old console and therefore from there I was able to upload my version 2 (the new one) APK + main OBB. After that, from the old console, I deactivated the old version and deleted it. I went back to the new console design and this is it !!!!
Sorry for posting with a second account I'll delete the first one.
if you keep example work in you application package name you cannot upload apk into google play..

Categories

Resources