Last friday I created some builds from my app from within Android Studio by simply clicking Build > Build APK. That created 4 files:
app-debug-unaligned.apk
app-debug.apk
app-release-unaligned.apk
app-release.apk
I then uploaded app-release.apk to the play store, which worked perfectly well (is is public now).
Today I wanted to do the same, but today I only get the files
app-debug-unaligned.apk
app-debug.apk
As you can see in the screenshot below the release APKs are from last friday ("maart" == "March" and "Vandaag" == "Today"), and I have never done any signed APK stuff:
On this SO-topic (from 2013, so pretty old) I read that you need to run Generate Signed Apk, create new key store paths, and more trouble. In the meantime I did remove the .idea/ folder (because that solved "APK path is not specified for module" error), but I wouldn't know why that would change anything.
So my main question is: how can it be that I could create an app-release.apk last friday, but today not anymore? And most importantly; how can I build the app-release.apkagain?
All tips are welcome!
Just to add some print screens of where are the features discussed in the comments. This following screens consider the Android Studio (IntelliJ IDEA) 2.0 Beta 6. It might serve as reference for other people not finding it.
The first one is Build > Generate Signed APK ... and the Build Variants dock opened.
Second one shows where the build variants dock is hidden.
Related
This may seem like a duplicate question, as there are 4 or 5 other exact questions. But I have tried the solutions to every other question like this with no luck.
Basically, I've been successfully generating signed APKs for weeks now, but out of the blue 3 days ago the signed APK is not being generated. Simply nothing gets generated, even though Android Studio says that it has successfully generated it.
I am using Android Studio 3.0.
I have tried totally uninstalling/reinstalling AS, I've made sure that both APK option checkboxes are checked during the signed APK generation dialog window.
I have many times restarted Android Studio and my computer, as well as cleaning/rebuilding many times. I do not know what to do from here.
I really need to get an update of my app out to Google Play but I cannot generate the new APK.
The apk is probably being generated but not on the path you expect. Look around the project subdirectories or search for apk using your operating system search tools.
I too faced the same issue, what you need to do is after migrating a project to Android studio 3.0, delete the already generated signed apk in path /project/app and generate the signed apk again, you will see a release folder in the same directory.
I'm having trouble uploading my .apk to Google Play Store. I've previously been able to upload multiple different builds up to last week, but today I get the error that I should zipalign my file first.
EDIT: Normally, I was able to generate signed and zipaligned .apk's that the AppStore accepted by just using Android Studios built-in "Generate Signed APK" wizard. This did not work today, and led to the following:
I've tried the following:
Manual zipalign of the app-release.apk generated by Android studio. When I try this, I get the error "VERIFICATION FAILED" at the end. Some googling says that providing full path to a location where you have write-access is important, so I've tried doing it with the specific path, but to no avail:
./zipalign -v -f 4 /Users/<username>/git/<projectname>/app/app-release.apk /Users/<username>/git/<projectname>/app/aligned.apk
I then tried to download the APK Signer 1.8.5 and use that to zipalign the .apk - and behold, success! It creates an aligned apk, and i'm able to verify it using both Android Studio's own zipalign tool by
./zipalign -c -v 4 app-release_ALIGNED.apk
and the APK Signer itself. However, when uploading I now get the error:
Failed to run aapt dump badging:
W/ResourceType(208730): Bad resource table: header size 0x80a3 or total size 0x80b50000 is larger than data size 0x7bcc4
ERROR: dump failed because the resource table is invalid/corrupt.
This, I haven't been able to find solutions for.
I then tried to recreate the circumstances I was previously able to upload APKs from by reverting to a previous commit/build, as well as reverting from AS 2.2 preview 3 to AS2.2 preview 2, but again - no luck.
Finally, I tried explicitly adding
zipAlignEnabled true
to my release config in Gradle, but that didn't help either.
I'm out of suggestions, and hoping someone can help? :-) Thanks
Finally, eureka!
I randomly stumbled upon this line in my root build.gradle:
classpath 'com.android.tools.build:gradle:2.2.0-alpha3'
Android Studio 2.2 preview 3 requires this gradle build tool upgrade, and I had just pressed "sure, go ahead" as always. I got curious, and tried to change it back to what had worked last,
classpath 'com.android.tools.build:gradle:2.2.0-alpha2'
and built the project in Android Studio preview 2 instead - and voila, it worked! It seems there is a bug with the alpha3 build.
I hope this helps someone. I know I'm a happy friday-camper, that's for sure! :-)
Note to self: Don't rely on canary-builds for production apps in the future, no matter how much my friends and collegues push.
Here are the things that I faced a few days ago: Try them one at a time:
After downloading Android Studio 2.2 Preview 2 - which was released during the IO conference, I ran my code successfully until when time came to release a newer version of the apk to the playstore. That was when hell broke loose!
I searched all over but I got nothing. So, someone suggested the following approach: After generating your signed apk, unzip it and delete META-INF folder then re-package it and manually sign it through the terminal. Packaging a file into .apk format is simple: just use a zip extension then rename the extension.
Although that seemed like it could have worked for me, it didn't. It worked for others though.
Finally, I realized that it was caused by a bug in the latest Android Studio Preview 2.
Thankfully, I still had my stable 2.1 version which I opened, loaded my project and Boom! It worked like I expected it to.
So, please try the last option, clean up your project first then try again. I know how frustrating this can be. Good luck!
My application's debug apk(one in bin folder) size is 25.8 MB, I'm not using proGaurd as of now, I have multiple libraries such as Facebook, Twitter, Google play services, Vuforia, and few other graphics related jars. So my problem is when I'm generating release version apk using export wizard I'm not getting correct apk file size. Everytime I generate apk for release version the size is different( like 19MB, 21MB, 23MB ,22MB,25MB). When I install this apk on device it is crashing. I have 8GB of RAM, I cleaned project before starting process, closed all running applications except eclipse , I also run CC cleaner and started eclipse from cmd prompt with 'eclipse-clean' command but still I wasn't successful to generate correct apk.
Any suggestions to solve my problems will be appreciated.
I searched throughly but I am admittedly a newbie when it comes to this IDE. I have spent hours at this stage and I'm unsure if it's a stability bug or something with the build settings.
I made an App, throughout the process I was able to generate the signed APK but due to naming violations on the play store I was forced to rename it, in the process of changing the project name something has broken the ability to generate a signed APK on this specific app.
PROCESS- I select the release options (in contrast to debug) and press build, the event log states- "Executing tasks: [:app:assembleRelease]" but does not generate a signed APK (I've looked in my selected destination and also in the /app/build/output folder).
When I open a relatively blank project and generate signed APK, it makes the apk. I've been through all the settings that I can find, to no avail. I've restarted and reinstalled AS.
The same thing happened to me. I had to open build/outputs/lint-results-release-fatal.html and correct the errors shown there. Then the APK was generated successfully.
It is likely a bug on Android Studio parsing lint output.
Using eclipse to generate Android app.
All of a sudden when I export a project - I get an apk file that's not valid.
e.g. missing AndroidManifest.xml and res folder.
It was working a few days ago and I didn't make any config changes.
When I test it in an emulator - the correct apk file is generated in the bin folder -
albeit without certificate signing etc.
A really hackish workaround is to go to Eclipse->Preferences->Android->Build and change the debug key to the cert you want to sign with. The downside is it's still built in debug mode. Eclipse can easily drive a good man insane trying to troubleshoot it. You might consider upgrading/reinstalling your version of Eclipse and/or reinstalling/upgrading to the latest ADT plugin.
If you don't have time to battle Eclipse, use the command line:
http://developer.android.com/tools/building/building-cmdline.html
How to compile APK from command line?