ANDROID: Build works on emulator but fails on device

Previous topic - Next topic

coder14

The app deploys and works perfectly fine on the emulator:
Code (glbasic) Select
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.104 SN:xxxxxxxx - 3D, NET
Wordcount:445 commands
compile+link:
running Android build-script...
BUILD STAGE 1: Compile and pack RELEASE
.
BUILD STAGE 2: Build DEBUG and install on device
finished Android build-script.


but fails when trying to deploy to the device:
Code (glbasic) Select
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.104 SN:xxxxxxxx - 3D, NET
Wordcount:445 commands
compile+link:
running Android build-script...
BUILD STAGE 1: Compile and pack RELEASE
.
BUILD STAGE 2: Build DEBUG and install on device

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:1100: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:1114: exec returned: 1


Following the various advice from the forum, I have:
1. created the compiler\platform\android\android-sdk-windows\add-ons folder under GLBasic
2. deleted and re-created the debug.keystore file in the .android folder with keytool.exe
3. restarted the device
but still no success.

Have I missed some step?

mentalthink

I think the trouble can be the useb driver for your android device... If works in Emulator works in real device... take a look to the USB driver... I have an Archos tablet, and I have to do manually, else my Win don't recongnize my tablet...

Stay sure android runs fine from a lot of time ago... don't care about this...

coder14

Quote from: mentalthink on 2013-Feb-24
I think the trouble can be the useb driver for your android device... If works in Emulator works in real device...
Thank you for your quick reply. I suspected that too, so I manually copied the file glbasic-release-unsigned.apk from the distribute folder to my device and tried to install it; the installation starts with the prompt,
Do you want to install this application?
Allow this application to:
Storage
Hardware controls
Default

followed by
Installing...
then
Application not installed

Shouldn't this work?

mentalthink

It's strange you are sure put all correct, the resolution and when you chosse the platform put into Android...

I don't use too much Android, and perhaps something goes wrong if the CPU not it's ARM, but this it's only my Speculation... I'm not sure... wait a bit, perhaps some one whit more skills in Android can help you, but , how I told you, Android platform don't have too much porblems now... make a lot of time Gernnot include this platform in GLbasic...

I'm sure someone can resolve this problem...

PS. Try to put you model device, or a bit more info... I think will be more easy for the people help you, perhaps someone have the same decive like you...

coder14

Thank you mentalthink, for taking the time to troubleshoot my problem. From your initial suggestion that it could be a USB/driver issue, I searched the web to find out how to confirm that the connected device is actually detectable from the Android development environment. This is what I found from the Android Developer website:

http://developer.android.com/tools/device.html#setting-up

It turns out that there is an option in Android devices to enable USB debugging, and after doing that, the app deployed and ran perfectly.

It's really the small things that help. Thank you!  :nw:

mentalthink

No problem, always when people begins whit GLbasic, make somethings wrongs... It's natural, but you can look, whit a bit of tiem and practice it's veery easy, funny and productive... I comment this, because before I use GLbasic, I don't have any ideea to pick code, well and now I'm consider a hobbist but really i make somethings and whitout too much problems...

jSmith

Thanks for sharing. Good job with the wordings in the title - very easy for someone with the same problem to find.  :)
When your software fails blame it on the hardware.

sf-in-sf




Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:1114: exec returned: 1

Hi!
Sorry for the late reply.
I got the same problem and usually it's easy to fix.
The battery charging of the device starts and stops when i move the cable, so it's a faulty usb cable.

Other causes for that problem:
-no app icon in the project (some older 3D example projects). -> get a proper one and paste it in the project folder.
-problem when re-installing a fresher version of the same app, with same name. (don't know why). -> manually grab your older app icon on the device, hold for a long time, and slide it to the red thing in order to de-install it. Then rebuild etc.

Check:
-the bottom icons on the device: Connected as a media device, and USB debugging connected.
(allow USB debugging in settings/developer options, on the device).
- that the device remains awake and recognized by your computer during the whole build process. (sometimes the icon disappears for no obvious reason. Keep the "computer" window open to see its contents and your tablet icon.)
-your USB cable... is it as reliable as you think?

In case of doubt you can open a console on your computer and type "adb devices" to see if
your device is installed and recognized o.k. "adb usb"... what does it do, actually?
It's a good idea to install Android Debug Bridge on your machine, if the command "adb" is unknown. Google "adb for windows", i guess.
An alternate way is to transfer ...\distribute\Android\bin\glbasic-release-unsigned.apk into your "documents" inside your device, then go there and click it, and start the installation.
The "3G stick" must be activated on android if you want to use that socket for a usb stick.

Hope this can help. Good luck!
On the day the atom is a cube I will start believing in the square pixel.

erico

This will all come in handy to me...I should have the android/java things installed quite soon to take a leap on it.  :)

Thanks a lot for sharing guys!