Can't test my app on my android phone

+1 Pedro Alves · September 25, 2014
 am starting to learn how to make Android apps and I am very happy about that. However, everything seems to be going wrong for me. I had problems with the sdk (fixed) and with eclipse (why was it crashing?!). But now I just created my new Hello World app and when I connect my phone to the computer (ZTE Skate Acqua, Android 4.0.4, Debbugging enabled) it gives me this in the console:

[2014-09-24 22:19:39 - AndroidTest] ------------------------------
[2014-09-24 22:19:39 - AndroidTest] Android Launch!
[2014-09-24 22:19:39 - AndroidTest] adb is running normally.
[2014-09-24 22:19:40 - AndroidTest] Performing me.pta2002.androidtest.MainActivity activity launch
[2014-09-24 22:19:40 - AndroidTest] Automatic Target Mode: using device 'emulator-5554'
[2014-09-24 22:19:40 - AndroidTest] Uploading AndroidTest.apk onto device 'emulator-5554'
[2014-09-24 22:19:41 - AndroidTest] Installing AndroidTest.apk...
[2014-09-24 22:19:42 - AndroidTest] Installation error: Unknown failure
[2014-09-24 22:19:42 - AndroidTest] Please check logcat output for more details.
[2014-09-24 22:19:42 - AndroidTest] Launch canceled!
[2014-09-24 22:19:44 - AndroidTest] ------------------------------
[2014-09-24 22:19:44 - AndroidTest] Android Launch!
[2014-09-24 22:19:44 - AndroidTest] adb is running normally.
[2014-09-24 22:19:44 - AndroidTest] Performing me.pta2002.androidtest.MainActivity activity launch
[2014-09-24 22:19:45 - AndroidTest] Automatic Target Mode: using device 'emulator-5554'
[2014-09-24 22:19:45 - AndroidTest] Uploading AndroidTest.apk onto device 'emulator-5554'
[2014-09-24 22:19:46 - AndroidTest] Installing AndroidTest.apk...
[2014-09-24 22:19:47 - AndroidTest] Installation error: Unknown failure
[2014-09-24 22:19:47 - AndroidTest] Please check logcat output for more details.
[2014-09-24 22:19:47 - AndroidTest] Launch canceled!
[2014-09-24 22:21:14 - AndroidTest] ------------------------------
[2014-09-24 22:21:14 - AndroidTest] Android Launch!
[2014-09-24 22:21:14 - AndroidTest] adb is running normally.
[2014-09-24 22:21:14 - AndroidTest] Performing me.pta2002.androidtest.MainActivity activity launch
[2014-09-24 22:21:15 - AndroidTest] Automatic Target Mode: using device 'emulator-5554'
[2014-09-24 22:21:15 - AndroidTest] Uploading AndroidTest.apk onto device 'emulator-5554'
[2014-09-24 22:21:16 - AndroidTest] Installing AndroidTest.apk...
[2014-09-24 22:21:17 - AndroidTest] Installation error: Unknown failure
[2014-09-24 22:21:17 - AndroidTest] Please check logcat output for more details.
[2014-09-24 22:21:17 - AndroidTest] Launch canceled!
[2014-09-24 22:22:44 - AndroidTest] ------------------------------
[2014-09-24 22:22:44 - AndroidTest] Android Launch!
[2014-09-24 22:22:44 - AndroidTest] adb is running normally.
[2014-09-24 22:22:44 - AndroidTest] Performing me.pta2002.androidtest.MainActivity activity launch
[2014-09-24 22:22:44 - AndroidTest] Automatic Target Mode: using device 'emulator-5554'
[2014-09-24 22:22:44 - AndroidTest] Uploading AndroidTest.apk onto device 'emulator-5554'
[2014-09-24 22:22:45 - AndroidTest] Installing AndroidTest.apk...
[2014-09-24 22:22:46 - AndroidTest] Installation error: Unknown failure
[2014-09-24 22:22:46 - AndroidTest] Please check logcat output for more details.
[2014-09-24 22:22:46 - AndroidTest] Launch canceled!
[2014-09-24 22:23:48 - AndroidTest] ------------------------------
[2014-09-24 22:23:48 - AndroidTest] Android Launch!
[2014-09-24 22:23:48 - AndroidTest] adb is running normally.
[2014-09-24 22:23:48 - AndroidTest] Performing me.pta2002.androidtest.MainActivity activity launch
[2014-09-24 22:23:50 - AndroidTest] Automatic Target Mode: using device 'emulator-5554'
[2014-09-24 22:23:50 - AndroidTest] Uploading AndroidTest.apk onto device 'emulator-5554'
[2014-09-24 22:23:51 - AndroidTest] Installing AndroidTest.apk...
[2014-09-24 22:23:51 - AndroidTest] Installation error: Unknown failure
[2014-09-24 22:23:51 - AndroidTest] Please check logcat output for more details.
[2014-09-24 22:23:51 - AndroidTest] Launch canceled!



I have no idea what is going on. I know there is an "Unknown failure", but since it's unknown, I don't know what it is. It runs fine on AVD but it takes ages to boot. (LogCat log: http://pastebin.com/n7fxPcDJ and yes, I enabled apps from unknown sources)

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
0 Pedro Alves · October 1, 2014
WHOAAAAAAAAA No I wont format my PC (even though I should have done that when I bought it, I hate windows 8's look). But I have another PC (and another phone) I guess I should try it.
0 Alex Sweps · October 1, 2014
Sounds like you should just format your pc and factory reset your phone. With all the issues your having its probably better to start with a clean slate.  
0 Pedro Alves · September 30, 2014
I do have all the drivers, and I have a ZTE phone. Also, my main problem with the AVD is that it takes 1 and a half hour to boot and then everything starts to crash (Im running with 2GB of RAM, my pc has 4GB)
0 Pedro Alves · September 29, 2014
Unfortunely, that was exactly what I made :/ The only difference between your code is that the min sdk is for android 4.0.3. (I am too lazy to install sdk for Froyo)
0 Kuroodo Ditory · September 29, 2014
AVD does take ages to boot as you said OP. But what I do is let it boot and keep it open. Whenever I wanna run or debug the program, it automatically loads it onto the avd. So basically when you start the AVD, and after it finishes loading up, don't close it or else you'd have to spend another x amount of minutes waiting for it to load again :P

But now for the mobile device part...have you installed the required USB drivers? In order to run a program from eclipse to your phone, you need to install the required usb drivers made for your phone. Usually you can find the drivers at the website of the phone's manufacturer.

An example of where you can get USB drivers (for LG phones) is here: http://www.lg.com/us/support/software-manuals
0 Alex Sweps · September 29, 2014
Create a fresh project and try run the default Hello World app that it creates. 

Try and run your crashing app using the emulator. If you have another phone try it on that one.  If you have another computer try a fresh eclipse install and try it out on that. When you get unknown errors with no info its all about narrowing down the root cause of the problem by trying out different things. 

If the Hello World app runs on your phone then you know its nothing in your phone settings and your eclipse is setup correctly. If that happens id suggest copy pasting your code into the Hello World one and running it after each chunk of code you paste. You will soon get to the code that's causing it to crash. 

Hope this makes sense. 
0 Pedro Alves · September 28, 2014
My phone has android 4.0.4 (i didn't even knew it existed!) but I have Android SDK 4.0.3, since there isn't SDK for 4.0.4. However, my tablet has android 4.0.3 and debugging mode enabled, apps from unknown sources *checks if its enabled* enabled. Also, I set the minimum SDK for 4.0.3 and the target to 4.0.3 as well.
0 Alex Sweps · September 28, 2014


I think, you have to see the version of SDK ur using with your android phone. Maybe, you're using the outdated.



Seeing as the app uploads and then fails on install suggests that may be the problem. Check the version of your phone in its settings and in your Manifest file make sure the sdk fits with your phone. It will look like this in your manifest:

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />
0 Pedro Alves · September 27, 2014
I saw both bucky's (even though they weren't made by him) and android's official tutorials
0 Jay Guan · September 27, 2014
hey, i am new to java as well and i would like to learn how to test the app in android, can you send me some tutorial videos you used for android app development and let me know how you fixed your problems, such as this one. 
  • 1
  • 2

Java / Android Development

106,989 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator