Eclipse Android Running App on device. Nothing happens - android

I am just beginning to use Eclipse for Android applications. After updating my Android SDK i can't run my projects on device anymore. It says "Installing app.apk..." but nothing happens. Installing my app with adb without eclipse works, where could be an Issue? I reinstalled SDK and Eclipse twice.

Try unistalling the application from the phone before re-installing it. Also make sure you have the option to allow non-market apps checked in your phone settings --> applications.

Is it getting stuck at a particular percentage? If that is the case, the solution was to keep the virtual device running before you attempt to run the project.

I had the same problem on my computer. Android sdk on eclipse doesn't work well with windows x64.
So to launch the application you have to kill the adb process. Wait that adb restart and launch one more time.

Related

Android studio: Error while installing apk

When I launch my virtual device ,it launches but my app doesn't show in AVD.
I update all the plugins and platforms required..after some time android studio given this error as following : Error while installing apk.
Please, solve my problem why this is happening, I'm suffering from 2 days.:(
Make sure your emulator up and running.
Also you can try running it on to your phone the process is simple,
Go to android setting=>About=>Click on build varian 7 times to become developer.
2.go to developer section and enable the debugging mode.
3.now if you are on window pc you have to download google usb driver and for MAC you can directly connect and you are good to go.
Make sure that you should uninstall all the applications that were developed by you in the emulator. After uninstalling all the applications that were build by you in the emulator, then clean project, run it again.Let me know if this works out.
Have you tried increasing the adb connection time out on the AVD?
To test this, first launch the avd and make sure it is turned on and running. Then try to build your application and install the .apk onto the device.

Not able to install .apks via adb

I have been working on a particular Android application for sometime and have been able to run these apps via Android Studio quite fine before but since applying a recent update I have not been able to run the app via Android studio because of the following error:
android.os.TransactionTooLargeException
Error: Could not access the Package Manager. Is the system running?
I have tried to troubleshoot this issue by connecting via a different TCP/IP instead of through USB (thinking it was a cable fault of sorts), reinstalling ADB, removing the ADB driver and restarting Android Studio, and all of the above yielded the same error when trying to run the app from Android Studio.
The update that was applied was the addition of the YouTube Android Player to a fragment. The fragment that contains YouTube Player was added to FragmentManager of the parent Activity during the onCreate method of this fragment. Could this be the problem? Or am I looking in the wrong place
Any insight would be appreciated.
You may have gotten this error while attempting to run an Android application on an emulator or device using Android Studio. The most common cause of this error is simple as stated in this link: You have to manually unlock your Android Virtual Device by swiping the "lock" icon on the screen. Security measures prevent the emulator from letting you connect the debugger before doing this. Make sure also that you are running Android Studio version above 0.3.2 or the latest version. There was some issue reported in AS 0.3.2. You can update it from Help >Check for update.
Found this thread which states that it might be an issue with your emulator not with Android Studio. Maybe you are trying to install application before even the emulator started properly. Wait till the home screen appears in the emulator before trying to install any application.
Also try to install any apk in Emulator from command line
Steps to install
Go to $Android_SDK_DIR\platform-tools, right click there keeping shift key pressed and Chose "Open Command Window here".
Run command adb devices to make sure yout emulator is running properly. It will show all your running emulators.
Now if emulators are showing properly, type the command adb install YOUR_FULL_APK_PATH , YOUR_FULL_APK_PATH is of any .apk
file path in your system.
You need to wait for the emulator to full start which may take a few minutes. Once it is fully started (UI on the emulator will change), it should work. You will need to restart the app after the emulator is running and choose the running emulator when prompted. You can check on this bug report the full details.
Hope this helps!
I'm not sure, but check if this works.
menu>> tools>>Android>>Enable ADB integration check it

App not run in visual studio emulator for android in visual studio 2015

I create blank xamarin android project without add any code when i debug this project debugging without problem but when i run app with visual studio emulator for android emulator is running but not starting my app and deploy failed and don't show me error
why ?
please help me
I had the same issue. VS 2015 can launch the VS emulator but can't deploy the app.
I was able to solve the issue like this:
Launch the emulator (F5 in VS, then cancel the deployment using the Build/Cancel menu)
Click on the chevron icon (») in the toolbar to the right of the emulator
Select the Network tab
Locate the preferred network ip address
Back in VS, click on the Open Adb Command Prompt toolbar button
Type adb connect [the emulator ip address]
Press F5 again in VS
Looks like a VS bug to me.
I had the same issue. It turned out the root cause was that the VS Emulator couldn't find adb.exe.
When that happens it won't connect to the emulator unless you do the manual connection following the steps CSharpRocks gives. The emulator also won't be listed under "adb devices".
The fix for me was to reinstall the Android SDK, using the Windows EXE based installer (not the zip installer). The EXE installer sets the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools key, Path value, in the registry, pointing to the Android SDK root directory.
The VS Emulator uses that registry setting (or the Android Studio install registry setting) to find the SDK, assuming you didn't install the Android SDK with Visual Studio itself. With that, it should be able to find adb.exe and work.
Have a look here:
Xamarin Forms Android App Crashes Running Debug with VS Android Emulator
Start the Hyper-V manager
Select the emulator you are trying to use
Right-click, hit settings
Click processor
Click Compatibility
Set checkbox “Migrate to a physical computer with a different processor version”
I'm having a very similar issue. I have found two different kind-of-work-arounds, but have not yet figured out a full solution.
Start the emulator before trying to deploy to it
Launch the Visual Studio Emulator for Android application from the start menu.
Launch one of the available emulators via the green arrow
Attempt to again launch your application from visual studio, selecting the VS Emulator N-inch... emulator from the drop down menu
For me for some reason the app still doesn't "launch" on the emulator, although it is installed. So I have to open the application menu and select my app. Additionally it will usually crash the first several times I try to open it, but eventually displays my single default label, Welcome to Xamarin Forms!.
Run the application in Ad-Hoc mode
Before running the application, change the solution configuration (from the top toolbar next to the green "run" button) to Ad-Hoc.
The problem with both of these methods though is that I'm still not able to actually debug an application. I can run it, but my breakpoints are ignored and I think that will make finding bugs difficult once I actually start to write a real application.
I hope to update this answer once I figure out an actual solution.
I had the same problem yesterday. The problem appeared (probably) because I tried to start development after a long break. I updated VS and everything, but faced many issues.
Eventually you need to start fresh
Make sure SDK for emulator points to the right place (HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools)
Run Visual Studio with Administrator privileges
Go to Hyper-V Manager and delete ALL Virtual Switches - let the system recreate them when needed. It will do it properly
Delete all existing emulators and recreate them in Visual Studio. I even found a comment to name them without spaces - not sure if it is needed, but wouldn't hurt.
Doing all this helped me. But I was on the verge of reinstalling Windows 10 clean. I think lots of things and configuration changed and are no longer compatible.
Try it enabling Hyper-V and using a Visual Studio Emulator from android; that worked for me after a lot of attempts and research
I had the same issue but in my case it was not the registry. After doing a release build, I deployed the app to the emulator device in release mode which pushes the app to the device and then effectively "disconnects". This leaves a version of the app on the device which seems to block further attempts at debugging or deploying.
I solved it by starting the emulator, going to "settings -> apps" and manually uninstalling my app. Then the next debug build & deploy worked again.
You could probably also manually start the emulator and say "wipe device" option so it starts fresh.
In VS2017, on a Windows10 machine, all I had to do to get the app to show up was turn off Mobile Data.
(swipe down or use settings, then click Mobile Data and confirm to turn it off).
After I turned it back on, I could access the app. Before doing this, it always seemed that the emulator ran, but wouldn't run the app.
... no idea why this worked, but I'm posting it here in case it helps someone.
During my troubleshooting process, I also looked at these articles:
VS Android Emulator wont run application
Troubleshooting the Visual Studio Emulator for Android
Update Your Path For The New Android Emulator Location
Install apache in VS 2015 here.
Visual studio requires apache to develop android apps.
You also may want to look at some other suggestions:
notshowing, troubleshooting
I had such issues before with the android SDK emulator, now I'm using Genymotion emulator instead of it, it is more light and faster and will be detected automatically by you VS once launched.
you can download the free version from here : https://www.genymotion.com/
and also you can download any device emulator.

App hang on install in Android Studio

Usually I build an app in Android Studio to test an app on Phone. But this occurs when I just click the Run app
Waiting for device.
Target device: motorola-nexus_6-ZX1G227B86
Uploading file
local path: F:\HeadFirstAndroid\MateClient\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.diyu.org.mateclient
Installing com.diyu.org.mateclient
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.diyu.org.mateclient"
It seems that the process is stuck on the pm install and no app is installed on my phone. What's the issue?
And other projects acts the same, hang on the install.
I fixed this issue by going to Settings on the device -> Developer Options ->
uncheck "Allow USB debugging' -> Recheck box. And next time, the software started correctly.
I was stuck on install. Restarted the phone, and it worked.
In my case the device was the problem. It refused any install or uninstall commands. You can easily test this via the adb command adb install [your apk file]
If the command line is stuck too, than this means that it is not "studios fault".
Also an uninstall returned Failure [DELETE_FAILED_INTERNAL_ERROR].
There must be something wrong with the installation-state inside of android.
I was able to solve this issue by manually installing my app via an apk file
that I dropped into my sd card. Then I used adb uninstall [my_package]
which resulted in Success.
Finally I could install my application from Studio as normal.
In my case, just run (Mac: ^R, Windows: Shift + F10) again solved the problem.
I fix this issue by unplugging the phone and re plugging it. If the problem persists, there may be something wrong with your drivers/USB cable or the ADB service.
In my case to solve the install hanging, I performed the following:
ran flutter clean
turned off wireless debugging on my phone
connected the phone via USB
ran the app
The app installed correctly, after which I stopped the app.
re connected wirelessly then it installed and ran correctly
i think the problem is in the size of your Dex, uninstall your app from your devise first then try cleaning your project,and run your project without pictures
I fixed this issue by updating the OS to the latest Android version
I fixed this issue by closing the project and reopening it. But I know this is not the only solution/may not always work.
File > Close project and then reopen the project.
Might be a bit late.
The only thing that solved this for me was device reboot. Once I restarted the problem was on LG G4c and once I restarted it everything went back to normal.
If by any chance you are using Xiaomi phones such as Redmi or whatever, you should try to toggle the "Install via USB" option.
For me, when I disabled and again tried to enable it, it gave me the error "The device is temporarily restricted". This was preventing me from installing apps and is the reason android studio was stuck at "installing apk".
So fix this, use a VPN to connect so any chinese server, preferably shanghai, and then try to enable the "Install via USB" option. Other users reported that turning of WiFi and using mobile data to enable the option also works.
Check if your device has multiple user accounts. cause when android studio tries to install app on pyhsical device it installs it on all accounts.
and if you uninstalled your app from your account but not from others, android studio will try to update existing app, which you don't have.
So, uninstall app from all accounts and then try to install.
On Redmi phones. If you do have a second space in your phone, the android studio probably installed the app in that space.
Delete the app from the second space then try again. Worked for me.

Why does eclipse hang when installing an apk to an android emulator?

I've looked at tons of similar questions on here but all of them either had a different issue (installing the .apk actually failed) or the solutions which worked for them have not worked for me, so I apologize if this question seems like a repost.
The issue I am having is that when I try to run an android application on an emulator in eclipse the apk never gets installed. The emulator itself works fine (all the default apps function properly, settings are correct, etc.) but the app I am trying to test is never installed onto the "phone." It never shows up in the app list or launches, and I never get a confirmation that installation completed. (The run configuration is set to launch the app)
Here is the relevant console output, with some names changed:
[2011-10-19 10:54:45 - dining-android] Android Launch!
[2011-10-19 10:54:45 - dining-android] adb is running normally.
[2011-10-19 10:54:45 - dining-android] Performing <src path>.Main activity launch
[2011-10-19 10:54:45 - dining-android] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD '1.5test'
[2011-10-19 10:54:45 - dining-android] Uploading <appname>.apk onto device 'emulator-5554'
[2011-10-19 10:54:59 - dining-android] Installing <appname>.apk...
It doesn't seem to make a difference whether I start the emulator manually and then try to run the app or if I run the app and let it start the emulator automatically, it will never go past this step. I left it running for about 8 hours (overnight) and nothing at all changed. The app is designated for the same version of android as the emulator runs, and everything looks correct in the settings of the emulator and eclipse as far as I can tell, except it never completes the installation of the app.
Does anyone know why this would happen? I've tried restarting adb, using different versions of the emulator and/or app, changing the default run configuration, and various other solutions I've come across on the internet which didn't seem to have any effect whatsoever. I'd really appreciate some help on this if anyone has run into something similar.
EDIT: I just tried using the "adb install" command in the command line on the .apk of the app while the emulator was running and it was also unsuccessful. I don't know whether this is related or another issue entirely.
EDIT2: Command line install using "adb install" functions properly. However, eclipse still can't manage to install the app. Anyone know what might cause this?
I had the same issue when I tried to run my android app in a device. Eclipse went to 100% of CPU usage and it did not respond anymore. I had to kill Java processes to close eclipse every time that I ran the app. As part of the workaround I removed android plugins from eclipse, updated my android binaries in my box and installing a fresh new eclipse . I killed adb server and restarted it several times. After all of that I had the same issue.
The solution came when I tried with another phone and voilà... magically the problem was gone. I had been trying with a Samsung SIII(GTI9300 - OS 4.1.2) there was some issue with that phone because when I tried with a different phone Razor-I(XT890 - OS 4.0.4) . I used other SIII(GTI9300 - OS 4.1.2) and it worked too. Maybe the solution is not the best but was effective for me. If you have no chances to change the phone I recommend you to dig out in the configs of your phone with android binaries outside of eclipse.
I hope this helps.
I had this problem before, I don't remember how I resolved it though (it was a while ago).
I personally suggest reinstalling the sdk and the ADT plugin, and make sure you're following the steps on the developer website. I'm not sure what signing the package has to do with eclipse not installing it on your phone or the emulator -- it only needs to be signed if you're going to have it up on the market (or if you're trying to install it on non-developer mode phones).
Another thing you could try is building a new android project (like a simple hello world app) and trying to install that. If it doesn't install then you're having an issue with eclipse and/or the sdk.
Also you could just completely wipe out eclipse and the sdk, and start from scratch. (Again, follow the directions on the android developer website...)
http://developer.android.com/sdk/eclipse-adt.html
http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr1
Good luck
I was fighting with same issue today.
And thanks to eplewis89, he was suggesting right things.
For me the problem was in ADT. I've updated my ASDK to highest version and ADT started to yell about it's compability and suggested to update itself too. But I chose only some parts that I thought will be enough to develop. Really this mistake cost me half of a day.
Help -> Check for Updates and update of all ADT stuff solved the problem.
I also had this issue. I tried everything I could find on the net and none of it worked for me.
It's not the solution you want to hear, but what worked for me was abandoning my Eclipse Helios install and laying down a fresh Eclipse Indigo install and then installing Android Dev Tools.
I ran into this after a crash and there was an emulator process that was still running in the background.
The solution for me was to kill adb (using ps -ef | grep adb and kill) and any running emulators (using ps -ef | grep avd and kill). Then I restarted adb:
cd /path/to/android-sdk-linux/platform-tools
./adb start-server
Go to Android\android-sdk\platform-tools in cmd and type command logcat
Then try to install the apk on the emulator again and paste the log here

Categories

Resources