• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Running Signed APKs from Android Studio

Background:
  • I have two build types: release and debug.
  • I have two flavors: full and demo.
Problem:

I am using Build->Generate Signed APK… to compile and build a release version of Demo/Release. That goes fine. However, I can't figure out how to run the resulting APK from within Android Studio. More specifically, using the "Run" command (with the Build Variant value set to the desired variant) causes the following error:

app-demo-release-unsigned.apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog.​

I get this error despite the fact that there *is* an app-demo-release.apk also (i.e., a signed version). In fact, I get that same error whether or not either APK (app-demo-release.apk, app-demo-release-unsigned.apk) exists.

How can I run a release app, as generated with Build->Generate Signed APK…, from within Android Studio? Alternatively, how can I specify where to find the APK I would like to have deployed (e.g., as part of the Run/Debug Configuration)? (Note that setting the Build Variant value doesn't fully specify the APK.)

Thanks,
Barry
 
Barry, i can not answer your question directly but have you tried to install the app using adb from the command prompt? Make sure you have an emulator running, drop into cmd (I assume you use windows), go to the folder where you have placed your .apk and type the following, adb install -r your.apk .Should you get the error that adb is unrecognised, either type the full path of where it can be found or add this path to the evironment variableS
 
Theo,

Thanks for your reply. Yes, I am aware that adb can be used to install APKs. I'm trying to figure out if that's necessary or if there's a way to install (release) APKs (signed using Generate Signed APK) from within Android Studio. Seems like there should be... it would be a major oversight if there isn't.

Barry
 
Back
Top Bottom