When I run debug app from Android Studio, I can install app but can't run app, When I'm open app it crashed.
Some one say use gradle < 2.3.0 version is run well.
Somebody know the reason?
follow settings you can run debug app on oppo and vivo
1. Disable Instant Run
2. Add gradle.properties Settings
android.injected.testOnly=false
Related
Since the time I have updated android studio to 3.5, I have been unable to run any app on multiple of my physical phones (Redmi Note 4 and OnePlus6). The app isn't installing on any of them. But it is installing on the emulated devices of the same respective versions (Android 24 and Android 28), so it is not an issue with the code.
Moreover, I tried to build the previous versions of my app stored on Git, and now Android Studio does not build the app showing - "linking error". While that same code version was working fine a few months ago (prior to the android studio update). Which is why I think the problem is somehow with the Android Studio and not the code...
Things I have tried
Disable instant Run (Not an option anymore in Android Studio >=3.5.1)
Enable USB debugging, connect using the device using "Transfer Files" mode and not "Charging Device" Mode
Turn off MIUI Optimization and Reboot
Uninstall App and re install
Build the apk, transfer the apk to the device and then try the install (This works on OnePlus 6 but not on Redmi Note 4)
The apps I have tried target Sdk >=27, and use androidx. However, I tried to go back to a previous version of the app, which didn't use androidx (and used the legacy support libraries), but still got the same error.
My system is Ubuntu 18.04, and current Android studio version is 3.5.3
Errors I have been getting include:
INSTALL_FAILED_USER_RESTRICTED
Device Not Found
UPDATE:
- Just tried to install on OnePlus6, doesn't install there as well. Earlier I had tested only for Redmi Note 4.
- Tried uninstalling and reinstalling the app, building the apk and
transferring on the phone then manually installing.
- This is happening across projects, at least for Redmi Note 4. I tried this with one of my course projects, same/similar problems.
My guess is problems with Android Studio update and the recent migration to androidx from the "legacy" support libraries
How I solved it:
Disable "Use libusb backend" in the Settings -> Build, Execution and Deployment -> Debugger
Sorry Android Studio 3.5 for the curses
How I found the solution:
I checked the logs of android studio by going to Help -> Compress Logs and Show in Files. In the folder which opened, I saw the logs by the name adb.1000.log (because adb - android debug bridge, handles the communication with the device). In the last few lines I saw - "read transfer failed: LIBUSB_TRANSFER_CANCELLED". I read here about the option of libusb
Did you try to clean/rebuild... under /Build/Clean Project, after that /Build/Rebuild Project and after cleaning and rebuilding you can try under /File/Invalidate caches
I am using Xiomi Poco F1. When I run the app code in Android Studio to install the app in my phone, it asks me to uninstall the previously installed app which is very annoying. Is there a way to get rid of this problem?
Just check if Instant Run is on. Make it off.
Follow this -
How to disable Instant Run for Android Studio 3.0
Android Studio gives error when running application with instant run enabled. I have updated my android studio to 2.3 today and since then its showing me above information.
On android studio 3.0.1
I ran a full build right after I enabled instant run.
Once that was done . The error was gone and instant run worked.
Re-run Android studio with emulator helped me to install it on next lunch.
if you are using external devices then turn On or Off the device, or connection miss-match. please retry to connect devices and run your application then reconnect device.
You can disable Instant Run by going to (in android studio) File -> Settings -> Build,Execution,Deployment -> Instant Run
and uncheck Instant Run
I currently have the latest version of Android Studio and I'm trying to deploy an app onto my phone running Android 5.0.1 Lollipop. After building, the terminal shows that the apk is being installed onto the phone and the status indicates that it is running. However, nothing shows up on my phone (no running applications and the app does not show up in the installed applications list). I've tried disabling auto-run in studio settings but it doesn't help. Any ideas why it's doing this? Also I reinstalled the adb driver just in case that was the cause. It might be helpful to note also that this happens even on the default template apps generated by studio.
try to turn off the Instant Run
File - Settings - Search Instant Run , unselect all the options
Hope this would help.
In my case the 'HMS Toolkit' (version 6.3.0.3003.AF) plugin, on Android Studio Chipmunk (version 2021.2.1), was causing this.
I've disabled it and it all started working again.
Instant Run is a new feature introduced for reduce time for run and debug app.
I have all the required configuration for enabling Instant run, but it is not enabled on Android Studio. Here is my configuration below.
1. Android Studio 2.1
2. 'com.android.tools.build:gradle:2.1.0'
3. minSdkVersion 15
4. Settings->Build, Execution, Deployment > Instant Run = "Enable Instant Run..."
5. Run ->device is Android version 4.4.4
Then Instant Run is NOT enabled.
But when I am Run->on device Android Version 5.1.1, Instant Run is enabled.
Please suggest, if some other configuration I missed to enable Instant run for Android 4.4.4 device.
When you are running for the first time Instant Run is not required as the apk will be installed for the first time in the selected device. From the second time onward if you choose the same device to deploy your changes then instant run will be automatically enabled from Android studio 2.0 and Gradle version 2.0.
Please Note: You are required to run in debug mode.
For more Clear understanding you may visit this link
Instant Run is supported only while deploying a debug build variant, using Android Plugin for Gradle version 2.0.0 or higher, and targeting devices running Android 4.0 (API level 15) and higher.
This answer solved the problem in my case.
you have missed the Fingerprint Certificate Authorization dialog in your
phone when you connected it, try to change the USB mode to Media, or
another different than the one you have in and then reconnect your
device, or go to Developer Options -> Revoke USB Debugging and
reconnect, watch for the dialog and click on accept, that should solve
your problems.
Otherwise, try this:
set your ANDROID_SDK_HOME again and:
unplug device adb kill-server adb start-server plug device
Try to recreate project, but do not use spaces in the fullpathname.
Go to sdk manager and select API Level 15 which is Android 4.0.3 (IcecreamSandwich) under SDK Platforms. This fixed my problem.
For me the problem was the link cable, it seems like it had an unstable connection. I used another one and it worked without a problem.