I am working on Android application which will share the database. For that, I'm using android:sharedUserId in both application's Manifest file. When I am trying to run the application after adding that sharedUserId it shows me following errors in console.
[2013-03-04 19:37:32 - MainActivity] Installation error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE
[2013-03-04 19:37:32 - MainActivity] Please check logcat output for more details.
[2013-03-04 19:37:32 - MainActivity] Launch canceled!
Please help me to resolve this problem.
Follow these steps to fix the INSTALL_FAILED_SHARED_USER_INCOMPATIBLE error:
Remove the existing application (if it was already installed)
Remove the sharedUserId from AndroidManifest.xml
Rebuild the application
Reenter the sharedUserId to AndroidManifest.xml
Rebuild the application (one more time)
This means something about your app was not correctly uninstalled. This steps help to force uninstall from internal commands:
Connect your phone to PC with usb
From your shell launch:
$ adb shell
shell#android:/ $ su
shell#android:/ # pm list packages | grep <part of package>
package:com.android.providers.applications
package:com.android.providers.calendar
package:com.android.providers.contacts
package:com.android.providers.downloads
...
shell#android:/ # pm uninstall <package>
shell#android:/ # exit
shell#android:/ $ exit
$
Basically, you log into android shell, become superuser, find problematic packages, and uninstall it
In my case, the two app was signed with differents signatures. Using the same signature fix my problem
The solution for me was to select the "Build > Clean Project" menu option. It took a long time but the application deployed once it was complete.
Although you have accepted answer, I also want talk my situation which I met this error. My project is a Launcher which just happen to use some system grant like, Manifest.xml have two item:
<uses-permission android:name="android.permission.STATUS_BAR" />
or
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
and console log out:
Error using StatusBarManagerService - java.lang.SecurityException on android.permission.STATUS_BAR
Lastly, my colleague give me a hint using "platform debug key", I am not sure this will be suitable for you, but for another guys possibility for this kind question.
The below picture is my solution:
screenshot from project structure
you might also notice 'Signing Config' of "Flavors" and "Build Types", you might choose 'Name:' of "Signing".
Simply delete the existing application from mobile and reinstall using run.
my issue was having a second instance of the app installed via Samsung Secure Folder! One I uninstalled it there too, my issue went away.
In my case, I had two build variants (one specific for a device, and one general).
I was running the device-specific build on an emulator when this error showed up.
I did a slightly different approach.
My work involves using a modified Android OS along with a modified adb tool. The app (app1) I am working on "shares a user" with another app (app2) by another team. In order for me to get the Android Studio debugger to work, I had to follow these steps in order:
use the Build (from Android Studio Menu) -> Generate Signed APK
build a debug version of apk (app1) with the key store information used by (app1 and app2)
use adb to uninstall the previous apk
use adb to install the signed debug-apk
use adb to launch the app in debug mode
connect the Android Studio debugger to the app
I have encountered the same problem. I tried out everything, but unfortunately, nothing works for me. As it's a testing device no hesitated to do a factory reset. Oops. sucks didn't work either. Invalidate Cache/ Restart did the trick eventually. Looks like it's an Android Studio 3.5 bug.
Thanks.
I was using Emulator and the solution for me was to select the "AVD Manager" and Wipe all data from my Emulator device. After that application was installed.
Related
All known prior macOS versions were working with this sort of script context:
osascript -e "/path/to/my/app.command" with administrator privileges
Now it just silently fails...after asking for admin password.
The command file is what was originally used to launch the app, and the app has a button to re-launch with privileges...and the prior non privileged app closes.
If I remove the "with administrator privileges", it re-launches. if that is there, it does not.
If I try using:
/usr/bin/security execute-with-privileges /path/to/my/app.command
It also fails...never even shows password prompt.
I tried also "sudo open /Applications/myApp.app" but that of course doesn't actually launch with privileges.
From a shell i can sudo launch my app, and that is fine, but I can't expect an average user to be able to do sudo in a shell.
As I said, this had been a nice method that has worked for probably the past 6 to 8 years...but now fails. Anyone have any tricks or ways to get around it?
At one time....and I have no idea why, I saw the OSX security popup indicating "java" is not a trusted app and my settings only allow app store apps. But that only happened once...and it was strange. I clicked OK, it disappeared. I thought maybe java had been quarantined, so I did the command to clear that flag:
xattr -rd com.apple.quarantine /path/to/the/binary/java
But that made no difference. I'm sure this is new security features in Catalina making things difficult...but I can't figure out why or how to work through them. Its a java app that is launched via the app.command file which finds java on the machine and then launches it...defaulting to finding a local copy in its own subfolder.
Checkout out the sandbox settings of your project. the App Sandbox should be set as false in the entitlements file.
The sandboxing feature prevents your app from elevating the privilege in your app.
reference: https://developer.apple.com/app-sandboxing/
I am making a android studio project and I try to debug my application.
Running the application works fine, but when I try to debug it I get this error:
Could not connect to remote process. Aborting debug session.
What can I do to fix the issue?
You need to restart the ADB.
kill adb.exe process.
how to restart ADB manually from Android Studio
Sometimes this happens when two Android-capable IDEs are opened, e.g. Android Studio and IDEA. Shutdown one of the two (or disable Android plugin in IDEA) helps.
In My case,
For some reason I disabled Instant run and it has changed the Launch value from "Default Activity" to "Nothing" in "Run/Debug configurations". So always it says "Could not connect to remote process. Aborting debug session" and I was not able to debug. I enabled Instant and changed the Launch value from "Nothing" to "Default Activity" in "Run/Debug configurations" and it worked. Hope this will help some one.
(to get Run/Debug configurations, click "app" drop down and click Edit Configurations)
Check if you have selected the right Build Variant, usually "release" comes with debuggable false
Example:
buildTypes {
release {
debuggable false
....
}
}
is not recommendable change release to debuggable true, just change the right variant
debug {
debuggable true
....
}
Verify on AndroidManifest that your LAUNCHER activity has:
android:exported="true"
I try invalidate cache / restart and it's work
In command line :
adb kill-server && adb start-server
This command will restart ADB
+1 to Kuzneц's answer.
When Intellij and Android Studio are both open, apparently the Android plugin in Intellij needs to be disabled. This wasn't always the case but it resolve the issue for me.
Mac OSX 12.2.1
IntelliJ 2021.3.1
Android Studio 2021.1.1 Patch 2
By default Android Studio builds the debug version of the application. However, during the publishing phase you may have switched to the release one as the tutorial suggests.
ADB won't be able to attach to the application unless you revert to the debug configuration or you allow to the debug the release one.
If nothing of this works, you may resort in restarting ADB as explianed in How to restart ADB manually from Android Studio
Revert to debug configuration
Choose Build->Select Build Variant
Pick up debug in the second column
Deploy the application again
Allow the release version to be debugged
Select your application node in the tree
Right click and choose Open Module Settings (or hit F4)
Select Build Variants on the left
Choose release on the right
Set debuggable to true
Apply and deploy the application
Keep in mind that your life won't be easy as your application may be optimized and therefore not debugger friendly (e.g. you might not be able to step in certain methods, or view some local variables).
Restarted the ABD server. First the device had to be connected. Look for the "Assistant" tab in android studio (on the right side it usually is), and press next until you see the option to reset the ABD server.
I did
--->adb kill-server && adb start-server
--->invalidate cache / restart
but not work yet
Waiting for application to come online: com.example.distribution_system | com.example.distribution_system.test
Waiting for application to come online: com.example.distribution_system | com.example.distribution_system.test
Waiting for application to come online: com.example.distribution_system | com.example.distribution_system.test
Could not connect to remote process. Aborting debug session.
image1:--> [1]: https://i.stack.imgur.com/HZF5D.png
image2:--> [2]: https://i.stack.imgur.com/hrE4a.png
I got this error message when the phone was connected both via wi-fi (using "adb tcpip 5555" and "adb connect 192.168.0.100:5555" commands) and via a usb cable. Disconnecting the USB cable resolved the issue.
The other solutions posted here did not help me. I eventually discovered that creating a new simulator instance (tools->AVD Manager->Create virtual device) solved my problem. I was unable to get the previous simulator working again.
I followed all the recommendations above, but the problem was solved only after I used the Generate Signed Bundle and selected the desired flavor
For me the problem was a wrong launch flag set in the Run/Debug Configurations. I found out about this by taking the adb command that is executed to launch the app, which can be found in the "Run" tab. The command looks like this:
adb shell am start -n "com.your.package...." -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
By executing the command manually in the terminal, i got an error message which pointed me to the problem.
All solution didn't fix my issue, If you face it same me try that solution
enter link description here
This question is already many times asked but nothing its like my problem.
I don't get it why its not booting up or starting my apk.
Its stuck right there. Nothing is happening just the waiting for target device respond is coming up.
Everything worked perfectly until now.
I even reinstalled it. Didn't help much
PC SPECS:
i7 Core 2.2 GHZ
16GB RAM
Intel Iris Pro 1500MB
Android Studio 2.3
Error while waiting for device: Timed out after 300seconds waiting for emulator to come online.
Still the same error.....
I got it to work with changing the auto graphics to software!
I ran the commands that Jamal Eason recommended in the comments:
$ cd Android/Sdk/emulator
$ ./emulator -list-avds
$ ./emulator -avd [AVD_NAME]
I got some libGL error: unable to load driver: i965_dri.so errors when trying to run the AVD.
I was able to find this thread, where a user was able to fix a very similar issue by renaming the libstdc++.so.6 inside the emulator directory and linking the libstdc++.so.6 from the /usr/ directory.
$ cd Android/Sdk/emulator/lib64/libstdc++
$ mv libstdc++.so.6 libstdc++.so.6.bak
$ ln -s /usr/lib64/libstdc++.so.6 /home/user/Android/Sdk/emulator/lib64/libstdc++
I wasted some time with the same problem, for me after all, the solution was to power off my vagrant machine, this means that if you have a virtual machine running, is not allowing the AVD to run. So if that's the case, just power off the VM's and try again.
Hope this helps :).
I was experiencing the same exact issue, so I ran the commands suggested by Jamal Eason, and I got the following error.
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
Did some looking around and found that actually my ANDROID_HOME environment variable was pointing to the incorrect location. So I added the following commands to my ~/.bash_profile to update the ANDROID_HOME variable to point to my Android directory, which for me looked like the following.
export ANDROID_HOME=/Users/{USER_NAME}/.android/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
See this Stack Overflow post for more information on updating the environment variable.
After that, I restarted Android Studio and was able to run my emulator as normal.
Free more space on your disk. The problem may be related to the space left on your hard disk.
try to use another emulator like Genymotion or BlueStacks
and run it manually before runnig your app
I had this issue after manually moving Android SDK to another disk to save disk space on C:\ and improperly setting ANDROID_SDK_HOME.
I set ANDROID_SDK_HOME to d:\stuff\android\.android\ whereas it should have been d:\stuff\android\.
Apart from that, since Android machinery was creating another .android inside .android so I moved its contents one folder up.
Only running emulators that were x86 worked for me.
(I also edited the emulator settings for that device and selected "automatic" for graphics driver and selected a device as it appeared to be uninitialised).
Also check out the obvious: Google's page on it
Now i know that this question has already been asked before. But I ve tried all of the solutions provided there.
Suddenly eclipse got hung and continuously showing DDMS post create init in progress bar.
I've tried deleting .lock file, cleaning eclipse, closing eclipse, killing adb.exe, re installing sdk.
Is there any other possible solution to resolve this issue. I am dead stuck. Please help!!
My configuration: Win 7 (64 bit) + Eclipse Juno + Java 1.6
This just worked for me (I've been dealing with the same issue off and on for a while now)
Close eclipse if you already have it open.
make sure all adb.exe processes are killed using task manager
launch a cmd shell
in the shell, run:
set ADB_TRACE=1
adb devices
launch eclipse
Notes for step 4 -
I first tried this without ADB_TRACE=1 and my adb process froze before listing any devices. Why it works with ADB_TRACE debug output is beyond me, but it seems much more consistent with it enabled. Note: many adb commands start the adb.exe service, keep that in mind in case you need to kill it again.
Notes for step 5 -
Because the command adb devices started the adb service, eclipse attaches to that non-hanging service. If you are still having trouble, try all the steps again but this time launch eclipse with administrator privleges.
Hope this works for you!
For me, the cause of the problem was that adb default port, 5037, was in use.
You can check that with
netstat -a -o | find "LISTENING"
where last column is PID.
I have difficulties with with debugging at Android Studio. After trying to launch application in debug mode device show alert with "Waiting For Debugger" title that never disappear. Also I have android:debuggable="true" in my manifest file and seems like device connected correctly, because I can simply run my application without any problem. What I'm doing wrong?
Remove android:debuggable="true", because when you run/debug an application in Android Studio is signed with a debug certificate so that setting is not mandatory.
Then check from console if the device is correctly attached with an adb devices. You should see it listed.
Then try in this way:
1 - close Android Studio and any other IDE you have opened (maybe you have Eclipse also running?) and emulator instances;
2 - remove USB cable from PC;
3 - run adb kill-server from console;
4 - open Android Studio;
5 - click on run/debug;
6 - when the window to select the device appears, attach your device to USB and USB to your computer;
also try restarting the device - that worked for me when I had the same issue
I have similar issue (running Android Studio on Ubuntu)
What I do:
Close Android Studio (and Emulator(s) if running)
Go to adb folder (/wherever_location_is/sdk/platform-tools) and run command:
./adb kill-server
Open Android Studio.
Now Logcat messages appear again.
Remove those lines related to debugging. When you launch an application from Android Studio it is signed with a debug key. Any debugging information you need can be viewed in logcat from Android Studio. Also make sure you are running the latest version (help -> check for updates) I think that's where its at.
I'm struggling with similar issue every day and as restarting the studio or the device is pretty time consuming (and sometimes even does not work), I was trying many things and by coincidence I found an awkward (but working) solution.
When you are in the situation when you hit debug button in Android Studio, the studio says it's connected and the device says: Waiting for Debugger, but the device waits forever, do this:
In Android Studio, hit the 'Edit Configurations' pop-up button
Once the Run/Debug Configurations dialog opens, the debug process starts!
Works like a miracle!
Try this way - it works for me:
open
Run
run/debug configuration
Android app
app
Debugger
Debug type
set Auto
I had the same problem when i enabled the Proguard for debug!, Please disable it and try !!!
I think this might help. After launching application, click on Run and find Attach Debugger to Android Process
[
Check in gradle. if you apply proguard for debug then dubugging process not applicable to app.Make sure minifyEnabled false in debug.