First app for android after eclipse install - android

I've searched around and can't quite find the exact situation or answer that I need, so I'll have to ask a question that I'm sure has been asked somewhere out there, so my apologies. But I need help.
First time attempting to create an app, I installed Eclipse (both the entire kit from the android development site, and classic), installed the android sdk, and the plugin. Java is on my machine. I have everything that I need to get started. I was going through the tutorials on the android developer site for the first time user. Eclipse generates the "hello world" app as it should. I have my GS3 plugged in through USB with the driver installed and the system sees it. I click run as > android application... and to no surprise, nothing happens. No error message, no screen flash, no app on the device, nothing. So I tried to run it in an emulator. Not too clear how to set it up because the instructions are vague, but I got an emulator going and try to run again... nothing. No attempts to and then fails, no build errors.. no quick command prompt flashes, just nothing. The IDE just sits there as if I never clicked anything. What am I doing wrong here? Thanks in advance for helping
My current setup is
Win8 machine
Eclipse Classic (because the one provided on the site wouldn't install the plugin)
Android SDK 21.1
Eclipse Plugin for Android dev
Java JDK 1.7
Samsung Galaxy S3 device with driver installed and set to USB debugging

First of all you have to enable developer option (USB Debugging), then connect your device, now check whether adb recognise your device or not.
to check device status open DDMS perspective then click on Devices option. if your device is not listed, then restart your adb to do that go to adb path in command prompt/terminal then execute following commands
adb kill-server
adb start-server
adb devices
that's it now you can run application in your device

Related

Cannot get neither the Android Emulator nor Run project to device working in Xamarin

I am using a brand new xamarin.forms solution generated with the flyout shell template in VS 2022 community edition.
When I open the emulator and follow the first time setup, where it generates a common android device I get this error when trying to launch the emulator. I also get this error when creating a device myself.
Unknown AVD Name Error <- This part has been fixed by setting the ANDROID_SDK_HOME variable to the correct directory in the Environment Variables in system settings. But the emulator can still not be used for debugging.
I have tried looking around for solutions on all sorts of forums to get the emulator to work, but didn't find anything that made a difference.
I have tried running on a local device using USB instead as it was suggested that it was easier to get to work then the emulator, which didn't work either. The device does not show up in the Android Emulator drop-down menu. I then tried different cables and it still did not show up as a detected device.I then tried via wireless connection just in case something was up with the cables. It still doesn't show up. But if I check the devices through the adb command prompt I can see the device is connected and authorized, both when using the cable and when using the wireless connection. And the computer itself detects the device just fine.
The Device is in developer mode.
USB debugging is on.
The computer is approved as a trusted device.
Android project is set as start up project.
SDK's and tools have been downloaded using the Android SDK manager.
USB drivers have been downloaded for the device.
I have already tried
closing and opening VS multiple times.
Unloading and reloading the project.
Setting the device to PTP mode instead.
Reinstalling VS including deleting and regenerating the Java and Android folders.
Uninstalling VS 2022 and trying 2019 instead.
Generating a new VS solution.
downloading and installing the JDK manually.
Seeing that Virtual emulation is on in the BIOS.
Making sure the system is able to run Hyper-V and that it is on.
checking that the folder paths are set correctly in the options menu.
Making sure all nuget packages are up to date.
Any suggestions would be highly appreciated as I cannot debug and test the device properly at the moment.
If you see an error about a failure to install the APK on the emulator or a failure to run the Android Debug Bridge (adb), verify that the Android SDK can connect to your emulator. To verify emulator connectivity, use the following steps:
Launch the emulator from the Android Device Manager (select your virtual device and click Start).
Open a command prompt and go to the folder where adb is installed. If the Android SDK is installed at its default location, adb is located at C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe; if not, modify this path for the location of the Android SDK on your computer.
Type the following command:
adb devices
If the emulator is accessible from the Android SDK, the emulator should appear in the list of attached devices. For example:
List of devices attached
emulator-5554 device
If the emulator does not appear in this list, start the Android SDK Manager, apply all updates, then try launching the emulator again.
Update:
you can open the Android Device Manager first.
Select the device you want to run and click the Start button, so that the virtual machine can be started and detected, and then your virtual machine The device will be added to the Android Emulators menu.
I ended up wiping the hard-drive and starting from scratch. This time all I had to do was install VS and enable Hyper-v and everything worked as it should right away.
I have absolutely zero idea what caused this issue, but a complete wipe fixed it.

Android studio unable to locate ADB although it is in the platform tools foldder

I know this seems like a common but I tried every solution I found.
My problem is that the adb foldder is in the platform tools foldder but everytime I try to connect a phone to my computer and run my app
I get No Devices at the the top.
Then Troubleshoot shows me unable to locate ADB.
I deleted the platform tools foldder in android studio, on my computer and reinstalled it but it still doesnt work.
I even deleted Android studio and reinstalled it.enter image description here
Firstly, You can try to open a terminal and type in
adb devices
to see whether ADB is installed and running well.
It's working if it shows "List of devices attached", then you can go to Windows search box, find and open Activity Monitor, under CPU tag, find adb, select it and Force Quit the process(quit them all if there are several of them).
Then restart AS to see whether your device is connected.

Expo with Android Studio Emulator error: "Error running adb: This computer is not authorized to debug the device"

I am trying to connect an Android Studio Emulator to my expo application, but I get this error message:
Couldn't start project on Android: Error running adb: This computer is
not authorized to debug the device. Please follow the instructions
here to enable USB debugging:
https://developer.android.com/studio/run/device.html#developer-device-options.
If you are using Genymotion go to Settings -> ADB, select "Use custom
Android SDK tools", and point it at your Android SDK directory.
Does anyone know what to do with this?
Thanks!
What has worked for me just now:
Go to tools.
Select avd in Android studio.
Select your emulator.
Wipe data.
Click "Start again".
tldr:
Look at the emulator "screen" and accept the prompt asking if you want to allow debugging.
I got that message you described in the question when I did the following:
In Android Studio Virtual Device Manager (VDM), start the emulated device
run npm start (which runs expo start)
expo Metro Bundler runs (command line and browser)
in expo: select Android emulator
in expo: see the same error that you posted
The provided link didn't seem to pertain to the emulator.
I didn't realize at first, but the solution was waiting on the screen of the emulated device. It was quietly showing a standard Android permission prompt, asking for permission to allow debugging the device. This prompt is described in the "note" in https://developer.android.com/studio/command-line/adb#Enabling,
Note: When you connect a device running Android 4.2.2 or higher, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures that USB debugging and other adb commands cannot be executed unless you're able to unlock the device and acknowledge the dialog.
This of course I would expect for a phone, but didn't think of it for an emulator.
Once I granted that permission in the emulated phone, then expo proceeded to run on the emulator.
I discovered that "USB Debugging" had been turned off in the Developer Options of the emulator. Turning it on fixed the problem. No idea how it came to be turned off.
I had this problem today, I just disabled USB debugging and enabled it again. Worked.
Go to android studio
Open AVD manager
Wipe data on your emulator (Clicking dropdown icon in actions column )
Launch emulator
enjoy :)
First close your opened android emulator.
Open android studio and go to AVD manager.
Select virtual device which you have faced trouble, under actions select wipe
data option.
Give ok for the opened window.
These steps worked for me.
I was using the emulator from Android Studio for my expo projects. It used to work properly.
Then, one day the emulator stopped interacting with expo, always saying:
This computer is not authorized for developing on .
https://expo.fyi/authorize-android-device
The advices given on that link did not help. Revoking the USB permissions did not help either. Even newly created Devices in AVD Manager did not let me connect.
However, finally this answer solved the problem for me
Choosing a device from AVD Manager without Google Play Store on it let me connect expo to the emulator, again.
Note: I could not get to the root cause of the problem, so I am still not sure why it stopped working all of a sudden. I upgraded to Expo SDK 39 at the same time that I switched from managed workflow to bare workflow. So, one of those circumstances may have caused the problem.
I know the exact answer of this question
The Problem is your AVD manager is not set to the path
Than you have add to path first is ANDROID_SDK_ROOT and PLATFORM-TOOLS
HERE I GIVE ALL THE LOCATION PLATFORM TOOLS - C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools
ANDROID_DK_ROOT - C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk
ADD in path (SEARCH ON START EVIRONMENT VARIABLES) and than restart your pc
Try running a lower version of the android emulator from android studio. I was getting the same error while trying to run the latest expo-react-native app on android emulator version 9.0 Pie. I got it working by running a lower version of the android emulator version 8.1 Oreo. You also have to tab allow/ok on the phone screen when asked for enable USB Debugging
during the app booting on the emulator.
I had the same issue and it almost took one day to figure that out.
First try enabling the USB debugging mode, still if it shows the same error try the next step. Try to check ADB devices in cmd, if it doesn't work go and change the environmental variables of the android SDK manager.
And refer this link
https://medium.com/#vsburnett/running-a-react-native-app-on-an-android-virtual-device-with-expo-in-windows-10-9e0976db5f50
For Windows:
Select 'Wipe Data' option in the AVD manager and restart again.
Or
Add SDK tools path eg: E:\Android\SDK and SDK platform-tools path eg: E:\Android\SDK\platform-tools in the windows system environmental variables. (In my case I have installed SDK inside the E directory)
Open the Android Virtual Device Manager(AVD Manager).
And in your current virtual device on the right side, there will be a dropdown icon, and click that icon.
In the dropdown list there will be a Wipe Data and click it.
And Run your Emulator
I was facing the same issue. I am using windows machine. Steps I did to resolve:
I have added the environment variable.
To Add System Variable, search environment variable in Windows (or search google how to open environment variables, if you are on some other system or cmd). In the system variable add the Variable: ANDROID_SDK_ROOT to your android studio path, like in my case it is: C:\Users\kushalseth\AppData\Local\Android\Sdk
At the same place, i.e. System Variable, Click on Path and add this, it already doesn't exists. Please check this path in your system: C:\Users\kushalseth\AppData\Local\Android\Sdk\platform-tools
To Validate, run the command: adb in command prompt.
(Also check, if you are logged-in to expo from cmd. This is an extra precautionary step.)
today I experience the same issue but I have fixed it very easily. Try the solution it might work for you too.
Many developers have wsl or windows subsystem for Linux and it is using a VM and I found it blocks the android sim and causes the error "Error running adb". The solution I found was to open my PowerShell and type "wsl --shutdown". After rerunning the script for android emulation from expo it worked like a charm. Hope I helped.
There are two ways of doing this.
Wipe SDK data
Kill a running emulator
First step:
Open android studio > virtual device > click on more_vert > select wipe data
Second step:
Open your command prompt and use this command
adb -e emu kill
or
If Expo CLI is running, stop it with ctrl+c -- this will stop ADB.
Disconnect your Android device from the computer.
Revoke USB Debugging on the device:
Open the Settings app on your device.
Navigate: Developer Options -> select Revoke USB debugging authorizations.
Reconnect the device:
The device will prompt you to agree to connect the computer. You must confirm it.
The computer is now authorized for debugging!
This computer is not authorized for developing on. https://expo.fyi/authorize-android-device
I resolved this issue by choosing a device without the google play store
(play button).
Enable Virtualization on your machine
Enter your BIOS settings on boot of your machin and enable Virtualization Technology. The location may differ depending on your processor.

Genymotion Android Emulator Plugin for Mosync IDE

i've been trying to develop an Android application for some time now but the problem i keep facing is finding a suitable emulator to run a demo of the application (I think the default Android SDK emulator is crap). Anyway i did some research and came across the genymotion android emulator which is faster than any other emulators i have tired so far. I then went on to search for a plugin for my Mosync IDE which is an IDE built on eclipse that allows you to develop native, web or hybrid apps using htnl5, css, javscript, c/c++. Anyway i installed the plugin with the MosyncIDE the same way you install any new software in any eclipse based IDE and it installed fine. The problem i have now is that i am able to run the emulator okay but when i try to run my application inside that emulator i am unable to locate the genymotion virtual device in the list. I have been fiddling with my configuratin settings for days now without any results, i do not own an android phone so testing it directly on one is not an option for me, i would like someone to help me out with this problem thank you.
Please note that i am able to run the app normally with the default androidsdk emulator.
[What i have been trying soo far]
This is what i do currently, i start the genymotion emulator within the IDE.
I go to run configurations.
I choose Android Emulator.
I hit "Refresh AVD list"
Then i choose the android emulator i want from the list, the problem is i can't find the
genymotion emulator i started within that list.
Ok. The thing is that Genymotion device is not considered as an emulator but like a real device plugged on USB. You won't find it on the AVDs list but on the "running Android devices".
You first have to check if the running Genymotion VM is connected TO ADB: Run adb devices on a console. It should show you something like this:
List of devices attached
192.168.56.101:5555 device
The Genymotion device is shown as it's IP address.
If the Genymotion device is shown on this list, it should also appear on the list of available devices when you hit the "run" button of your IDE. Like in this picture (done with Eclipse IDE).
If it is not shown on the list, read my previous answer.
So you installed the Genymotion Eclipse plugin isn't it?
And it seems that adb devices does sometimes not display your Genymotion device.
When the VM boots into the Genymotion player, it executes:
adb connect <VM's IP address>
This connects the device to adb, so you are able to debug your apps with it.
Sometimes, it appears that the connection is lost and you have to run adb connect <VM's IP address> again. You have to do it manually for now.
You can get the IP of your running device using the Genymotion Shell with the command devices list

Ubuntu 12.10 + Eclipse 3.8 setup for Android questions

So, I'm just trying to get into Android development and trying to setup my system with eclipse so I can run through the tutorials and whatnot to familiarize myself with the ecosystem. I'm running this on Ubuntu 12.10 (amd64) with eclipse version 3.8. I've run into a couple issues/questions with the initial setup and I'm not sure what to do about them...
1 - I don't seem to get the "adb devices" command to see any devices. I have both a Verizon Galaxy Nexus and a Nexus 7 tablet connected to my system and nothing is seen. I tried adding a couple Vendor IDs to the adb_usb.ini file, but that doesn't seem to have done the trick. The two IDs I added are "0x4e41" and "0x18d1" - I thought the latter was the "Google" device ID, but I'm obviously mistaken somewhere.
2 - I don't have anything configured under the "Run" button and I'm not sure how to configure running apps through the AVD emulators or through a device. I'm pretty sure I'm not going to be able to run any apps through my devices since adb isn't seeing them, but I do have a 4.1 AVD setup, which should be able to run any apps created. How do I configure the Run button to push the app through the emulator? Does it need to be started first or can it start the emulator and push the app automatically? Also, once I resolve the issue above in part 1, how do I configure the Run button to send apps to either of my devices?
Any/all help would be much appreciated. Thanks in advance.
EDIT: As both comments up till this point have mentioned using the Run menu, but I don't seem to have the same Run menu as either of you. The only thing I have under the Run menu is
"External Tools", then under that is
"Run As" (which is a sub-menu with nothing under it - I assume since I've not configured anything),
"External Tools Configuration..."
"Organize Favorites...".
I'm not seeing anything relating to "Run Configurations" at all.
EDIT2: I just tried adding the udev rules file as mentioned in the "Using hardware" page on d.android.com and that doesn't seem to have had any affect (even after reboot). Still not able to see any devices in "adb devices". And, yes, my devices both have USB debugging turned on.
EDIT3: Seem to have gotten the devices to show up in the adb devices listing, but still not sure how to load the apps onto them automatically. Also, I tried running the "ant debug" command listed on http://developer.android.com/training/basics/firstapp/running-app.html and I'm getting an error of:
Buildfile: build.xml does not exist!
Build failed
Not sure what should be in the build.xml file as this is just supposed to be the tutorial app.
Usb does not need to be set up on ubuntu
you may need to switch adt from stable to beta see notes - that may work
reinstalling does not work.
I did the upgrade and adt broke completely - fails on WST or something like that.
Have a look at the tutorial at http://developer.android.com/tools/device.html
First make sure that you have the USB drivers. Make sure your Nexus device is set up for development. Load your drivers. It may be necessary to restart Eclipse to ensure that your new config takes effect.
You can start your AVDs through the AVDManager, or from Eclipse. Go to Run-> Run Configurations to set up which device to send apps to, or which emulator to start up.
1) Have you set your Application to debuggable? Also, don't forget to set your device up to USB Debugging mode.
Then try this at the terminal:
cd android-sdk-linux/platform-tools/
su
killall adb
./adb usb
2) Go to Run > Run Configurations > Target tab > Select your 4.1 AVD (on Automatically pick compatible device) and hit run. After that you will just have to click on run do test your app.

Categories

Resources