i have one doubt,i have created new project in eclipse with android 2.3.1 and try to debug directly from eclipse to device.and it's wokring well,it's debugg in device.now when i am converting that version of android 2.3.1 to GoogleApi 2.3.1 by right clicking project and changing android property.after that when i run my project i am getting such warrining kind of symbol as u can see in below image.
again when i am changing version to simple android 2.3.1 than it's get debugging from eclipse to device.
my device name is Sony Ericon Walk Man Live and ya one more thing Google API version working well when i copy apk to sd card directly and installed in device,but getting problem only when i am running from eclipse to device directly.
One another thing i noticed is that when i create a simple project than right clicking project and runing it's asking me to wether to run in device or emulator but in older one it's not even asking and directly running in emulator...in both's project manifest there is no tag like android:debuggable="true/false" also...
any one have idea what is a solution of this problem i have already insatlled device driver to pc as well.
please help me to short out this
Thanks in advance
Aamirkhan I.
Enabling USB debugging is key, but there's something else as well. Eclipse, by default, runs your application automatically after the first run. So, if you choose an emulator as your first run, Eclipse will default to run by emulator every run afterwards.To change this, go to your "Run Configurations".
There will be an option to run manually or automatically.
Choose "Manual" and you will prompted to choose between your emulator and device every time you decide to run. Otherwise, you can set whether to run automatically with your device or emulator.
try as in this link
If you already connected your mobile device with your computer via the USB cable, please unplug it from your phone, otherwise your device will prompt you a warning requesting to do so.
Related
I have a clean Android project on Android Studio (just with a "hello world' screen), and I'm trying to install the app on my Samsung Galaxy S10e.
I click the Run button, and this is what I see in the Build Output:
And the apk is generated successfully.
But it's not launched and not installed on the device (no icon, and it doesn't appear in the apps list).
When I try manually installing the apk by adb install app-debug.apk, it works. The app shortcut appears on the device, it's added to the apps list, and I can launch the app.
At first also adb install didn't work, giving out the error INSTALL_FAILED_TEST_ONLY, but I solved that by adding android.injected.testOnly=false to gradle.properties.
I tried changing Gradle version to 6.0.1 (looks like this is the latest at the moment), and it didn't help.
I also have my device selected at the top:
How can I make Android Studio install and launch the app on my device?
Android Studio version: 3.5.3
Edit:
I'm seeing the same behavior on an Emulator. I opened AVD from Android Studio and chose Pixel 3A. The emulator opens up, I run the app, nothing happens on the emulator (and I see the same Build Output messages).
The same happens to me. It is probably a bug in Android Studio. At the second compilation the app installs correctly. It is tedious.
There isn't enough information to find the cause of this issue.
But since it works with adb, it means you run adb command. There could be only one instance of adb daemon running. So if it's involved externally my guess is Android Studio won't have access to it.
Possibly try adb kill-server and running again from Android Studio and see if that helps.
I encountered the same problem, which I solved by checking the running devices. The connected phone had 2 accounts (might be personal & work) which was listed on the list of devices, so I had to select the second option, and it ran successfully on my phone. see the attached image.
One thing it might be:
Enable usb debugging
Settings
System
Developer options
Turn the setting on for usb debugging
If it does not appear go to settings about phone. Then click on build number like 7-10 times and it will enable you to have the developer options appear.
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
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.
I'm having an issue where the app I'm working on is not deploying to the device when I'm ready to test it out. It used to do it just fine, but then I updated to 5.0.1 Lollipop, which I believe to be the culprit. Besides downgrading back to 4.4.4 KitKat, which is quite the process on my bootloader-locked Galaxy S4, what can I do to resolve this? ADB recognizes my device and the project builds with no errors/warnings. However, the app does run and work normally if I build the signed APK manually and send it to my device via email/PushBullet which is just a lot of extra, unnecessary steps.
I'm sorry for the lack of information, I'll update as tips come along as to what I've tried. I don't know where to start. One thing I have tried was changing all compile sdk versions to 21, but no dice. It does pop up with the green bubble "session 'app' running" but nothing happens on the device. Also, the ADB pane reports "no debuggable applications." The big issue here is that I can't debug my applications at this point since I can't view the logcat. Any help would be greatly appreciated.
My phone has SuperSU (a rooting app) which updated and caused this problem. As part of the update it had switched off the preference to allow processes running as system user to gain root access without confirmation. I simply enabled the 'Trust system user' option and it worked as normal.
Hope this helps someone :)
Please un install the application if already installed and install again.
there is a kind of issue that application installed but not auto launched. You nee to launched explicitly but If app is already installed then you can't identify that your new installation works or not.
Once un install and install again and track if found installed.
Open the "Edit Configurations" pane and click the '+' button. Select the option to create a new 'Android Application' and then select the correct module. Apply, and you can then delete the test configuration you were using before if you wish. Then everytime you run, make sure you are running as an Android Application and not a test and it will auto-launch on install.
It turns out on my device (Galaxy S4 Lollipop) they added a security feature which didn't allow for ADB installs. The solution was to get root permissions and install adbd Insecure app from Chainfire and run it. Works flawlessly now.
I've followed all the instructions at http://developer.android.com/training/basics/firstapp/running-app.html to make a "hello world" app, but despite everything I try, nothing is happening on my device.
I've installed Samsung Kies for what it's worth, and my phone is detected by the OS for file transfer... but when I "Run As - Android Application" in Eclipse, nothing happens at all.
USB debugging is on for my phone.
Edit (June 7, 2013):
I've removed my old installation of Eclipse and the android SDK and downloaded the bundle from http://developer.android.com/sdk/index.html. Still nothing will happen when I try to run as Android Aplication.
I've run adb devices and I get the following output, so I guess my phone is detected:
List of devices attached
42f78b1517259fe5 device
I managed to find a way to add a device to Eclipse, as Galaxy Note 2 wasn't in the dropdown box... but that doesn't seem to do anything other than change the preview image in the activity editor.
I'm not sure if I did it right, but here's the logcat -d dump as suggested
http://pastebin.com/fmrPn3UU
My phone is running 4.1.2. I don't know what else to try, and I can't seem to find out anything else online.
Try forcing Eclipse to prompt you for a device to choose. See if it still does nothing, or if it actually runs.
To allow Eclipse to prompt you:
Open the Run menu > Run configurations
Within the new window, under the Android Application
If you have any configuration, delete the configuration
Create a new configuration by double clicking Android Application or clicking the New button.
Under the Android tab
Select your Android app project within the Project box
Launch action should be Launch Default Activity
Next, open the Target tab
Select Always prompt to pick device
Click Apply
Click Close
Now the next time you run your application, it will ask you to start your application in your phone or an emulator.
If you want to use the same one for the duration of your eclipse session, or until you've unplugged your phone, check the Use same device for future launches box.
This also has the added benefit of allowing you to choose different AVD versions to test your app on different devices or emulators easier.
Update from comments
To force stop your app if completely necessary
Go to the DDMS perspective within Eclipse
Window > Open Perspective > DDMS (it's it not listed, click Other...)
Click your process such as com.example.testapp
Click the Stop button (red stop sign)
I think your question is
Q: "Should I be able to run and debug my Android application on a physical handset, not just the emulator?"
A: Yes, absolutely. Including your Galaxy Note 2
Look here:
http://developer.android.com/tools/device.html
This is basically exactly the same, except it gives details specifically for the Galaxy Note:
http://www.technipages.com/samsung-galaxy-note2-how-to-enable-usb-debugging.html
BOTTOM LINE:
You should be able to debug using either/both an emulator and/or a physical handset, all from your Eclipse IDE.
'Hope that helps..
Try using the Galaxy Note 2 toolkit from XDA and installing the drivers that way, then manually set up your device in Eclipse.
Try looking at your AndroidManifest.xml file in your Android project. I believe your note 2 is running Android 4.1.2 (which is revision 16).
If your Hello World application has the minimum SDK version requirement set to be 17 or higher, your device will not be recognized on the available devices. Change android:minSdkVersion attribute in uses-sdk tag to android:minSdkVersion="16" and it will be displayed.
In 'USB PC connection' in the floating menu there are two options. In my cell was labeled 'Media Device' and I switched to 'Camera' and started to work.
I got the same problem. I am using MAC. I downloaded Eclipse(Java Standard 4.4) first and then installed ADT from eclipse manually. My code works and it can only run in emulator. It cannot find the Note2. I install Android Studio and it works with my Note2. Tried many methods but my eclipse cannot find my Note2. so I download the Android ADT from android.com directly and it works with my Note2. Since we can have two Eclipse on one computer, so it you can keep both Eclipse like me. One for PHP and one for Android. If you have the same problem, please try it.