Installation error: Unknown failure - android

I just opened a new Android project thorugh eclipse, I want the application to run on my samsung galaxy s4 which has KitKat 4.4.2 on it, so I opened the project so as Target SDK is 5.0.1 and the compilation will be done with 4.4.2, just when the project opens I get errors, i fixed it by accesing both appcompat and the projects project.properties and changing the target to apk-21. the errors vanish. But ! when I try to debug with my phone or with the emulator it fails, - Installation error: Unknown failure - thats the error, as I looked through the web I saw many people that get through this problem and non of the solutions was posted solved my problem. I will be really glad if someone could help me solve this annoying thing. Thank! !

I had the similar kind of issue and I have resolved the issue following the steps below:
File >> Settings >> Build, Execution, Deployment.
Next click on Instant Run and uncheck "Enable Instant Run to hot swap code/resource changes on deploy".
Apply and OK.
Try building the app again now. It should work now. Enable the Instant Run feature again if you want to.

We had a similar issue in Android Nougat.
Reason happened to be renaming the Project Folder.
Build -> Clean Project
Build -> Rebuild Project
Try this out in case you have altered anything related to Project Structure or Gradle Settings.

It happened for me also. Try to unplug your device and reconnect again. Once done, run adb devices in your command prompt to see if the device is detected successfully.
If yes, then clean and run the project. This worked for me. Give it a try.
Second Option
Try to delete your debug certificate and then restart the eclipse. Do Project clean - build and run the application
Debug certificate path depends on platforms. Find it in
Preferences - Android - Build - Default debug keystore.

Related

Android Studio - Can't debug on my Device

I'm facing this issue with multiple devices. And i have no idea how to fix that.
Whenever i try to install an app from Android Studio into my Device i ends up getting this error.
I tested this on Vivo, Mi, and some other devices but i got the same error.
Please lemme know if there's a solution to it. Or at least help to get a basic idea why this is happening to my Android Studio.
My Version of Android studio is v.2.3.1
Try disabling instant run
Settings> Build, Executions,Deployment> Instant Run
There are two chances:
1.USB Debugging off :
Enable Developer Option of your device,
Switch On USB Debugging
2.In Android-Studio : File -> Invalidate Caches / Restart
Clean the project and rebuild the project.

Application Installation Failed in Android Studio

Yesterday my app was running perfect from Android Studio but today when I started working on my app and running it i am getting error message continuously
Installation failed with message Failed to establish session.
Screen :
On click OK getting error message
Session 'app':Error Installing APKs
And App is not exist(already Uninstalled) in device. Please suggest me what to do ?
Again in this issue also I found Instant Run buggy. When I disable the Instant run and run the app again App starts successfully installing in the Device without showing any error Window.
I hope google will sort out these Issues with Instant run soon.
Steps to disable Instant Run from Android Studio:
File > Settings > Build,Execution,Deployment > Instant Run > Un-check
(Enable Instant Run to hot swap code)
If you use MIUI ROM
Go to the developer option and in that disable MIUI optimization.You will be asked to reboot your phone.
Reboot it and then run the app.
Your APK file is missing . So , Clean Project >> Build APK >> Run the project .
For those who uses Xiaomi phones, follow these steps:
Settings-> Additional Settings-> Developer options
Turn off MIUI Optimization and reboot your phone
Last Disable verify app over USB
Your device will respond properly.
Also enable install via USB
I had the same issue in Android studio 2.3 when I tried to test the app using Xiaomi's Mi5 and Mi4 phones. Disabling instant run didn't help me. So here is what I did.
Turn Off MIUI optimization in the Developer Options in the phone.
Then the device will be rebooted and then you'll be able to test the app over the phone.
Using this method you can still use instant run option in android studio. So this will fix your problem at least temporary. Hope that we'll be able to use MIUI optimization in the near future updates :)
In my case, it was because my emulator ran out of disk space.
In my case, it was very a silly and funny mistake. I, accidentally without actually knowing, checked "Android Debug Bridge, Use libUsb backend". Actually it should stay unchecked..
In Mac Pro, Go Preferences - > Build, Execution,Deployment -> Debugger.
**** For MAC OSX/Windows ****
Goto *
Android Studio - Preferences (In OSX)
Android Studio - File -> Settings (In Windows)
in the menu bar then select
Build,Execution,Deployment - Instant run
then uncheck it and rebuild it will works
Finally I've SOLVED it!
Below a temporary solution. Issue was reported to Google.
First of all I found in Run log that Android Studion 2.3 tries to install app-debug.apk from many slices, like this:
$ adb install-multiple -r
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_1.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\dep\dependencies.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_0.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_2.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_9.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_4.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_3.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_5.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_8.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_7.apk
E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_6.apk
E:\Android_Projects\ActivityLifecycle\app\build\outputs\apk\app-debug.apk
Then I tried to install only app-debug.apk from command line by:
adb install -d E:\Android_Projects\ActivityLifecycle\app\build\outputs\apk\app-debug.apk
App was installed successfully but was failed to run on my phone.
And finally:
I recompiled app-debug.apk from command line as:
gradlew.bat assembleDebug
Repeat installation of app-debug.apk from command line and became happy:
adb install -rd E:\Android_Projects\ActivityLifecycle\app\build\outputs\apk\app-debug.apk
This is definitely some gradle problem in AndroidStudio 2.3.
Go to Build --> Clean Project --> Run
Thats all it takes.
I had the same issue in MIUI. Enabling OEM unlocking worked for me without disabling MIUI optimization.
Below is a screenshot of my Redmi 3s prime developer options setting:
In my own case, it was because my phone was out of space. For people that are facing this problem right now, if Clean Project + Build APKs does not work, check the available space on your phone or emulator.
I hope this helps.. Merry coding!
I found the solution go to
settings>build,execute,deployment>instant run>Enable instant run to hot swap code /resource change on deploy(unchecked this option)
This will work on 3.4 android studio too. thanks
Try disabling the Instant run in Settings.
Easily can be solved this problem.
Ex:- in Huawei GR3 mobile,
Goto Setting in your mobile -> Storage -> Storage Cleaner
Change your applicationId in the android/app/build.gradle file.
For example:
// Change this
applicationId "com.example.myAndroidApp"
//
// to this
applicationId "com.example.somethingElse"
Then Sync your gradle then you can able to install your app,
if the previous applicationId is your production id the again change it the previous one now the device will allow to install the app.
Hope this may help you....
This is caused by "instant run" feature, you can disable it by:
Open the Settings or Preferences dialog. Navigate to Build, Execution, Deployment > Instant Run.
Uncheck the box next to Enable Instant Run and u are ready to go.
At me such error arose after renaming of a folder with the project.
Disabling Instance Run helped, but what if you do not need to disable it?
I deleted all the tags mentioning the old folder name from the file myproject\app\build\intermediates\restart-dex\debug\build-info.xml
The error has disappeared.
Just do the following step...
Build>Clean Project
after that Run project again, this worked for me
I also had the problem after globally changing the project name, applicationid and the folders containing the java files.
Disabling Instant run helped, but was not a good option, so this helped:
close Android Studio
deleted those files and folders: rm -Rf .gradle .tags local.properties .idea/workspace.xml .idea/caches/* .idea/libraries app/build
start Android Studio and let it resync everything
press run
Faced same issues on MIUI phone resolved by making MIUI account and enable install by USB.
just close your emulator and run again the problem will be solved happy coding
Sometime app doesn't show on home screen,So
Check your apps by going to setting - > apps -> and then uninstall from app setting might this work.
Here's my solution (there's no need to deactivate instant run) Do all these steps in the stated order:
1- Gradle Build (root level)
gradle
2 - Gradle build + clean (app level)
gradle app
3 - Choose app on the top bar (left of Run 'app')
4 - Clean Project:
Navigate to Build > Clean Project
And it should work now! You shouldn't disable instant run if you follow these steps
In my case Instant Run hided the real cause of the problem which was INSUFFICIENT_SPACE due to small data partition and I also got "failed to establish session" error. After disabling Instant Run, the real problem was revealed and after fixing it and enabling Instant Run it worked.
Allow or enable "Installation from USB" in the developer options.
One problem in MAC(or may be other operating systems) can also be solved with this
You need disable "Use libusb backend" in preferences--> debugger
Please tell others if this was useful for you.
Thanks to the following user and their answer: https://stackoverflow.com/a/58095554/3726185
Go to USB Debugging and disable MIUI Inspection and allow the phone to reboot. Things should be fine from here
For me I had to close the emulator and then select cold boot when re-opening it.
Before trying anything else in this post, I would do Build >> Clean Project. It solved my problem and it is the simplest solution. Sometimes, the cleaning doesnt get some links, so I also recommend you to restart your devices, either virtual or physical.
If it doesnt work out, try turning of Instant Run by File > Settings > Build,Execution,Deployment > Instant Run > Un-check
Only after trying this two simple solutions, I would try the others.

Session 'app' error while installing APK

I am having difficulty importing a project written on Android Studio 1.1 into Android Studio 2.1.2. I keep getting this error whenever the gradle is building before testing the app on a tablet. Below is a screen shot of the error. Does anyone know what the problem could be?
I have tried adb kill-server followed by adb start-server as well as some other gradle versions compatible with the project. Other than this, I have not been able to find many more suggested solutions to the problem ("session 'app': error installing APK").
Additionally, I have tried uploading a basic Hello World project which successfully built the gradle.
Error message from Grable Build
I was facing similar kind of problem.There is image of error attached.Error is highlighted in red.
Turning off the Instant run removed error for Android Studio 2.3 and 3.1.4.
Best step to resolve this error is-
Uncheck the instant run in File >Settings >Build,Execution,Deployment > Instant Run
Note: The top answers recommend to disable Instant Run. Try this before exploring my listed solutions to prevent wasting more time than needed.
Here are some possible solutions:
1) Make sure that your phone is properly connected to your PC with a USB cable: Before going over these fixes, make sure that you have at least connected your phone to your computer properly. If it's properly connected, your phone should be charging.
2) Make sure that your device's driver software is up-to-date: Simply go to your File Explorer and then right click Computer. Then, select Manage (requires administrator privileges). In your Computer Management window, find a tab on the left pane that says Device or Device Manager. Search for your device from there. Mine was under Portable Devices and the name started with SAMSUNG, so finding your device shouldn't be too hard. Right click the device, and then select Update Driver Software.... I chose the Search automatically for updated driver software option, since it's much easier.
3) Enable USB debugging under your Developer Options: For my Samsung Galaxy S9, I found mine under Settings > Developer Options. From there, enable USB Debugging. If you can't find your Developer Options, find your build number within the settings and tap it 7 times consecutively. I found mine under Settings > About Phone > Software information.
4) Make sure you've allowed USB debugging for your specific computer: Although you may have your USB Debugging option enabled, you still need to allow USB debugging for your specific computer. A popup should appear asking Allow USB debugging? and providing the computer's RSA key fingerprint. Before pressing OK, make sure your check Always allow from this computer, so that you don't have to go through this again in the future. If you think you've done this but yet your device is still marked as OFFLINE, select the Revoke USB debugging authorization option in 'Developer Options'. Then, re-allow your computer for USB Debugging. If the popup doesn't appear, reconnect your phone to the Computer (pull the cable out and put it back into your Phone).
5) Trying cleaning AND rebuilding your project: In Android Studio, open up the Build tab at the top left and try both the Clean and Rebuild options.
If none of the above works out: Reinstall Android Studio by Uninstalling the program and re-downloading the setup file here. Scan for any viruses that may be affecting your computer. Check for any sort of error while reinstalling Android Studio. If none of the methods presented in this answer work, fetch for support here.
Good luck.
Follow this steps to overcome the issue.
Disconnect all devices connected to System/Close all emulators
running on System.
Turn Off Instant Run feature from settings.
Perform a clean build.
Turn ON Instant Run feature from settings.
Perform a clean build.
Connect your device/start your Emulator and ensure it is online.
Run the Project by selecting the device/emulator.
NOTE:-
1) You should not have different instances of Android Debug Bridge(adb) running on system.
2) If using Genymotion then make sure that you use the custom sdk path mentioned in the Genymotion settings the which you mentioned in the settings of Android Studio.
Follow all the steps and I am sure you will get the issue fix.
You can clean your project with gradle wrapper of your project. In linux:
$./gradlew clean
In windows:
>gradlew.bat clean
This error happens due to Gradle not synced with the project. go to Tools- Android- Sync Project with Gradle files. Then Run it again.
On newer Android Studio versions, go to File-> Sync project with gradle files
Very Simple.
Follow this :
Build -> Clean Project
Then
Build -> Rebuild Project.
This is a terrible problem, i have facing it so much time, First of all when you run on emulator or real device please make sure that it is not show device is offline in Android monitor, see picture below due to bad cable connection device is showing offline, so make sure first that it is online.
If it's Okay then clean your project and Rebuild your project. You can do it from Build -> clean project / Build-> Rebuild project
Still problem occurs then try to Restart android studio. This is generous error happens due to above cases.But i solve it this way as described.
None of the above worked for me, the simplest solution was to go to
File > invalidate caches/restart > invalidate and restart
This issue seems to be bug in Android Studio.
I tried all other workarounds but the issue was appearing randomly.
I also have custom named apk for output. But Android studio was randomly picking custom apk name and default apk name.
Adding Gradle-aware Make solved the issue.
Following are the steps.
Menu Run -> Edit Configuration
Select "app" configuration
Add Gradle-aware Make to Before Launch actions
You are done.
Following article helped me in finding the solution
https://android.jlelse.eu/android-studio-3-1-how-to-fix-it-b49f72eb054f
It's a bit late for reply but, i've figured out how to solve this problem on Android Studio 3.1.
You can have "Instant Run" checked, what you need to do it's just to build an APK
and then retry to Run your app.
Hope this help!
In my case, my project location contained the special character.
E:\Android_Projects\T&PUIET,KUK\app\build\outputs\apk\app-debug.apk
close android studio > rename folder containing the special character(here T&PUIET,KUK ) > restart android studio.
Hope this Solution helps!
Clean and Rebuild is working fine for this problem and it is good also than other solutions.
In my case my device didn't have enough memory. After trying out a number of the suggestions here, I finally noticed the notification on my phone about low memory. The notification had been there for hours apparently.
I could install app on Nexus, but couldn't on Samsung. Nothing helped me except the change of the USB cable.
mi users if you are facing this type of issue follow these steps:
Step 1 : generate developer options as follow
Settings>>About Device>>Click 7 times on MIUI Version>> It will Generate Developer Options.
Now Enable Following...
Step 2: Setting>Additional setting> Developer options> Enable USB Debugging
Step 3: Setting>Additional setting> Developer options> Enable Install via USB
Note: Its Will get Enable Only If You Insert SIM In MI Device/Phone.
Step 4: Setting>Additional setting> Developer options> Enable Verify apps over USB.
all done now run the project and test....
non mi user:
just enable once instant run options from the settings--> Build,Execution, Deployment-->Select Instant Run and Enable Check Click On OK...
Its Will Work....
Try to this way :
1) In Instance Run is Enable then desable it.
2) Save it and Rebuild the project.
3) Check devices is online or USB debugging On your device.
4) Then Run It App On your devices.
Note :
If you use mobile device is MI (Xiaomi) Then Check :
=> setting>Additional setting> Developer options> Install via USB (ON it)
=> setting>Additional setting> Developer options> USB debugging (ON it)
=> setting>Additional setting> Developer options> Verify apps over USB (ON/Off it)
Trying cleaning AND rebuilding your project: In Android Studio, open up the Build tab at the top left and try both the Clean and Rebuild options.
This problem occurs when you copy paste class and didn't change package name.
Means Package name are different. Build has no problem to build but its problem to install.
After trying the different solutions from the different answers, I tried changing the USB debugging cable, and the problem resolved finally.
In my case, going to Settings>Build, Execution, Development>Compiler>Command-line options and removing the --dry-run flag fixed it for me. Not sure why that was there in the first place, but it solved it for me.
I was facing same problem.Tried every think mentioned here in blog.
But it was basic error to permit device "allow installing app from USB" which did it for me.
I had similar problem. In my device I have two accounts and the app was remained installed in another account. I have deleted app from both of the accounts and it was done.
I was able to resolve it simply by opening the notification bar of the android phone , clicking on "tap for more options" and selecting PTP
i was also getting the same error repeatedly but could not solve it as i am complete new to android development.
But then it came to my mind that the error is appearing because its not able to install the apk in the device as the error says.
So i make sure that my Oneplus3 is in debugging mode and also allowing file transfer when connected via USB.
And this solved the problem.
Also previously it was not doing the instant run but now it does.
So check whether your android device is allowed to transfer files while connected via USB. This might help.
Here is gradle console updates:
5:01 PM Gradle build finished in 1s 252ms
5:13 PM Executing tasks: [:app:assembleDebug]
5:13 PM Gradle build finished with 15 error(s) in 1s 125ms
5:15 PM Executing tasks: [:app:assembleDebug]
5:15 PM Gradle build finished with 13 error(s) in 1s 608ms
5:16 PM Executing tasks: [:app:assembleDebug]
Turning off the instant run(File >>Settings >>Build,Execution,Deployment >> Instant Run), solved my issue
I was using CyanogenMod 12.1 and was building with libgdx when I met with the same error.
Rebuilding didn't work for me.
My phone was connected as UMS or USB mass storage to my PC when I ran the app. Just changed the USB configuration from mass storage to MTP and it fixed my problem.
Looking at the error message, Android Studio tried to install older version of apk (lets say 0.5.1) while current version is lets say 0.5.2. Android Studio builds 0.5.2 but tries to install 0.5.1 for some reason.
I have turned off Instant Run, invalidated and restarted, rebuilt project and didn't help.
Solution worked for me is to uninstall the app, then change the current branch on VCS to some other branch. Then come again to latest branch and Rebuilt, Install the APK again.
You just need to restart your adb.
Instruction for that is given in this Link

Failure to install APK [INSTALL_FAILED_DEXOPT] Android Studio

I have tried literally everything to try and rectify this error when trying to deploy an app to an actual android device for debugging but have been unable to solve the matter. Everytime I try to launch I get a failed [INSTALL_FAILED_DEXOPT] error and when checking the logcat it is always because there is no classes.dex in my debug apk.
If I run gradlew.bat clean assembleDebug, there is no difference in the apk size so I'm assuming there is a build error in android studio. I am using android studio beta 0.86 and have tried it on 0.89 with the same result. I have tried build tools for 19.1 to 21 with no result. I have also tried different devices and created a new project (that has never been installed on my devices) and android studio seems to think it needs to be uninstalled first when attempting to deploy.
I have tried switching my device to ART, uninstalling and reinstalling android studio, redownloading the sdk and restarting my computer. NOTHING and I mean NOTHING has worked. I think the problem started after I downloaded the lollipop apis but am not sure. I have tried uninstalling all apps with my package signature on my device but NOTHING works! Not even Project -> Clean Project -> Rebuild
This is extremely frustrating as I cannot debug my apps anymore :/ has anyone had any experience with this error or ways to rectify it?
So turns out that the issue was mismatching sdks between Android Studio and the Project. The project was using an old sdk and once I made them the same, I cleaned and rebuilt the project and everything was good to go.
UPDATE:
I ran into the problem again after I tried to update my SDK and its tools. Turns out that when you try to do this, the SDK locks the tools folder and then you get an error saying some file couldn't be overridden. When this happened to me, all the build tools were deleted so there were errors in the .dex file created when debuggin my app.
We are using android 2.2 (really old i know) and couldn't find a fix for this error. Eventually we found this bug https://android-review.googlesource.com/#/c/30900/. The only solution for us was to remove some libraries...
I kept having the same problem - manually building worked fine, but Android Studio would not build a proper APK.
The problem was that I started the project on Android Studio and Android Gradle plugin version 2.0-beta2. After updating the Gradle plugin to 2.0-beta6 through a simple build.gradle change, the builds stopped working.
Turns out that, although I installed a beta version of Android Studio, the update checker only checked the stable channel. After setting the updater to check the canary channel as well, I was able to upgrade Android Studio to version 2.0-beta6 and builds continued to work normally.
You can change the update preference in Android Studio settings under Appearance and Behavior -> System Settings -> Updates.
I encountered this error when storage of the device is full. Try to open some space.
Try run these commands
adb reconnect
adb reconnect device

Apk only runs in debug mode. Apk started with "Run" in Eclipse stops on breakpoints

I note that this has been asked before but I haven't found an answer yet. The main tell tale of this problem is that Eclipse stops on break points when the apk has been deployed as "Run"
I've done these so far and none produce a correctly running "Run" build from Project shell -> Run As -> 1. Android Application
• Disconnecting, uninstalling and re installing the apk does not fix the problem (this is a tablet device, not an emulator.)
• Made all of the project and library projects write able using the file system
• Brand new projects work correctly e.g. they don't stop on breakpoints in "Run" mode in the same Eclipse workspace as the problem project
• Window -> Preferences -> Run/Debug(expand) -> Launching "Launch in debug mode when workspace contains breakpoints" is set to never
• Closed and opened Eclipse
• Killed all of the running processes under the "Debug" tab in that perspective
• Cleaned the entire workspace both in Eclipse IDE and manually by deleting the res and gen folders of the main and library project dependencies
• Checked for the occurrence of the word "debug" in the project build files
• Clean built the project from the command line using: ant clean then ant release
Interestingly enough, when I clean build from the command line then fresh-install the new apk, if Eclipse is open the debugger will attach to the running process and stop at the first break point! If Eclipse is closed, the program will wait for the debugger with the standard "Waiting for Debugger" dialog.
So something is broken in the build process (haven't figured out what all files are getting involved yet) and/or something in .metadata and/or some depenency.
edit
I've found a file at:
C:\Projects\Mobile\Android\.metadata\.plugins\org.eclipse.debug.core\.launches\MyProjectName.launch
in the xml:
<launchConfiguration type="com.android.ide.eclipse.adt.debug.LaunchConfigType">
Don't know if it's a clue, but if I delete the file Eclipse will just replace it with the same.
edit
*Confirmed that the project Runs correctly when built and run from another machine, so I suspect that it's my work machine's Eclipse workspace that's causing this issue. Maybe I need to throw out all of the workspace's metadata and start over.
I encountered same issue. The solution is, restarting your device. Good luck.
You said you have breakpoints?
Try:
Window -> Preferences -> Run/Debug(expand) -> Launching
There should be a section entitled "Launch in debug mode when workspace contains breakpoints"
If that is not on "Never" that would be your problem.
I have the same problem and I need 4 steps to resolve them:
Disconnect the device
Reboot the device
Clean and build all the projects in workspace.
Start the app in emulator in Run mode and check it's ok.
Start the app in the device in Run mode and all works ok.
Only restarting the device not works for me!
I've encountered same problem: I could run my application only in debug mode, but it won't properly start when I press 'run' button. I've tried all solution here, but nothing works for me.
After some time I've found android.os.Debug.waitForDebugger(); in the begining of my Activity. I hope this answer sometimes help someone, because this question was first in Google, when I search for help.
Update
Use Intellij instead of Eclipse for Android development (far fewer IDE interface bugs) and then disregard the following altogether:
Two important rules I've found since the original post:
1) Get in the habit of waiting until Eclipse is finished build the workspace - the indicator shows up in the bottom left corner of Eclipse by default. WS build times can take minutes in a large project with multiple libs. Don't change anything until the build is complete.
2) Close all projects in the workspace and reopen them one-at-a-time starting with the project with no lib dependencies and so on. Make sure not to open a project until you can verify the the workspace has finished building what is already open. Fix any issues along the way before opening the next project.
Good luck.
Happens to me sometimes - have you uninstalled the application completely from the handset and tried to reinstall? Can you install the apk and then disconnect the handset from the machine? (obv won't work if you're using an emulator)
Faced same issue on Samsung S4 and issue is fixed by unchecking "Wait for debugger" option under "Developer options".
Had the same issue, check that you haven't got this line of code anywhere in your project:
android.os.Debug.waitForDebugger();
It may exist in a Service for debugging purposes, once you comment it out it will work in release mode. The problem is that this line of code waits for the debugger, and if you're not running in debug mode it will wait indefinitely

Categories

Resources