Author Topic: Android compiling Problems  (Read 6230 times)

Offline Paul Smith

  • Mr. Polyvector
  • ***
  • Posts: 105
    • View Profile
Android compiling Problems
« on: 2011-Sep-12 »
After my current phone melted itself, I'm tempted to buy an  Android phone
before I recompile my old projects I thought I would test it out on some samples e.g helloworld( all compile in   w32 and Win-CE )
I'm getting the errors listed below then compiling
Ive followed the installation instructions and set environment paths etc
any Ideas what Im missing.

Win 7 64bit
java sdk 32 (tried 1.7 & 1.6)
android sdk (installed everything)


_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.8.048 SN:681be9d9 - 3D, NET
Wordcount:4 commands
compile+link:
BUILDSRIPT
BUILD STAGE 1: Compile and pack
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
    [javac] C:\Users\Paul6175\Documents\GLBasic\GLBasic\Samples\Basics\distribute\Android\gen\com\.helloworld\R.java:8: malformed floating point literal
    [javac] package com..helloworld;
    [javac]            ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:386: Compile failed; see the compiler error output for details.

Total time: 3 seconds
BUILD STAGE 2: Install on device
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
    [javac] C:\Users\Paul6175\Documents\GLBasic\GLBasic\Samples\Basics\distribute\Android\gen\com\.helloworld\R.java:8: malformed floating point literal
    [javac] package com..helloworld;
    [javac]            ^
    [javac] 1 error

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:386: Compile failed; see the compiler error output for details.

Total time: 3 seconds
Android=C:\Users\Paul6175\Documents\GLBasic\GLBasic\Samples\Basics\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 12.7 sec. Time: 17:11
Build: 1 succeeded.



Amstrad CPC 6128, ATARI STE.
Acer  SW5-173 & AMD FX 8350/1050Ti

MrTAToad

  • Guest
Re: Android compiling Problems
« Reply #1 on: 2011-Sep-12 »
Is there anything odd in the project name ?  Can you make it available ?

Android is very strict about names unfortunately (and also doesn't tend to like spaces)

Offline Paul Smith

  • Mr. Polyvector
  • ***
  • Posts: 105
    • View Profile
Re: Android compiling Problems
« Reply #2 on: 2011-Sep-12 »
No spaces or symbols.
All I'm compiling at the moment is a simple hello world
new project "antest.gbas"

// --------------------------------- //
// Project: antest
// Start: Monday, September 12, 2011
// IDE Version: 10.106



PRINT "test test", 0, 50;
SHOWSCREEN
END
Amstrad CPC 6128, ATARI STE.
Acer  SW5-173 & AMD FX 8350/1050Ti

MrTAToad

  • Guest
Re: Android compiling Problems
« Reply #3 on: 2011-Sep-12 »
Its all fine here :

Code: GLBasic [Select]
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.8.048 SN:47ccc3f7 - 3D, NET
Wordcount:3 commands
compile+link:
BUILDSRIPT
BUILD STAGE 1: Compile and pack
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
     [echo] Converting compiled files and external libraries into C:\Users\Nicholas\Documents\GLBasic\GLBasic\antest\distribute\Android\bin\classes.dex...
     [echo] Packaging resources
     [echo] No key.store and key.alias properties found in build.properties.
     [echo] Please sign C:\Users\Nicholas\Documents\GLBasic\GLBasic\antest\distribute\Android\bin\glbasic-unsigned.apk manually
     [echo] and run zipalign from the Android SDK tools.

I notice your path :

Code: GLBasic [Select]
C:\Users\Paul6175\Documents\GLBasic\GLBasic\Samples\Basics\distribute\Android\gen\com\.helloworld\R.j

is very odd

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: Android compiling Problems
« Reply #4 on: 2011-Sep-12 »
try to add a company name in project settings
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline Paul Smith

  • Mr. Polyvector
  • ***
  • Posts: 105
    • View Profile
Re: Android compiling Problems
« Reply #5 on: 2011-Sep-12 »
Uninstalled everything and deleted all environment for java/android
reinstalled and set up all.
made new project but saved it onto my desktop, also gave it a company name.
Got a better log this time.
2 errors at end not sure what they mean.
set up an AVD not sure how to project to run on the emulator yet, will need to read more instructions.

thanks for the help.

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.8.048 SN:681be9d9 - 3D, NET
Wordcount:3 commands
compile+link:
BUILDSRIPT
BUILD STAGE 1: Compile and pack
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
     [echo] Converting compiled files and external libraries into C:\Users\Paul6175\Desktop\distribute\Android\bin\classes.dex...
     [echo] Packaging resources
     [echo] No key.store and key.alias properties found in build.properties.
     [echo] Please sign C:\Users\Paul6175\Desktop\distribute\Android\bin\glbasic-unsigned.apk manually
     [echo] and run zipalign from the Android SDK tools.

BUILD SUCCESSFUL
Total time: 8 seconds
BUILD STAGE 2: Install on device
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...
     [echo] Converting compiled files and external libraries into C:\Users\Paul6175\Desktop\distribute\Android\bin\classes.dex...
     [echo] Packaging resources
     [echo] Running zip align on final apk...
     [echo] Debug Package: C:\Users\Paul6175\Desktop\distribute\Android\bin\glbasic-debug.apk
     [echo] Installing C:\Users\Paul6175\Desktop\distribute\Android\bin\glbasic-debug.apk onto default emulator or device...

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

Total time: 10 seconds
Android=C:\Users\Paul6175\Desktop\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 26.4 sec. Time: 22:16
Build: 1 succeeded.

Amstrad CPC 6128, ATARI STE.
Acer  SW5-173 & AMD FX 8350/1050Ti

Offline okee

  • Dr. Type
  • ****
  • Posts: 324
    • View Profile
Re: Android compiling Problems
« Reply #6 on: 2011-Sep-13 »
Quote
After my current phone melted itself, I'm tempted to buy an  Android phone

Do you have an Android device connected ?
That's the error I get if no device is connected, or windows can't find the phone


Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

MrTAToad

  • Guest
Re: Android compiling Problems
« Reply #7 on: 2011-Sep-13 »
Yes, it doesn't matter if the second stage fails.

Offline Falstaff

  • Mr. Polyvector
  • ***
  • Posts: 148
    • View Profile
Re: Android compiling Problems
« Reply #8 on: 2011-Sep-14 »
If you can get your emulator running (it may take a *long* time to boot, mine does), it should show up as a connected android device. Once you have a device connected, just doing a build for android should make it automatically install onto your connected device(/emulator). You can of course alternatively connect a phone/tablet and it would install onto it too.

You can check your recognized connected devices with the command "adb devices". You need your environment paths setup right of course, I think that's a command from the androidsdk tools directory. The emulator should show up after it's finished booting up.

Also if/when you get a real device, be sure to install whatever drivers are relevant before you connect the device. I didn't do that before hooking up my asus transformer and it wouldn't recognize to adb (or glbasic) until I found an app to remove usb drivers.. annoying.

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: Android compiling Problems
« Reply #9 on: 2011-Oct-02 »
Was this issue solved ?
I have the exact same problems.
Phone-model = HTC Legend
"Sugar makes the world go 'round. Caffeine makes it spin faster."

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: Android compiling Problems
« Reply #10 on: 2011-Oct-02 »
I fixed it :)

1. reinstalled htc's usb drivers.

2. set the JAVA_HOME path to shortform:
ex:
C:\Progra~2\Java\jdk1.7.0
instead of:
C:\Program Files (x86)\Java\jdk1.7.0

It seem like the spaces in the JAVA_HOME string was the problem.
"Sugar makes the world go 'round. Caffeine makes it spin faster."

MrTAToad

  • Guest
Re: Android compiling Problems
« Reply #11 on: 2011-Oct-02 »
Yup - no spaces allowed :)

Offline AMateus

  • Mr. Drawsprite
  • **
  • Posts: 61
    • View Profile
Re: Android compiling Problems
« Reply #12 on: 2011-Oct-02 »
I have android sdk working and the java_home environment variable has spaces =) go figure :P

MrTAToad

  • Guest
Re: Android compiling Problems
« Reply #13 on: 2011-Oct-02 »
Also, no spaces are allowed in the project directory path...

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: Android compiling Problems
« Reply #14 on: 2011-Oct-03 »
Maybe it's an idea for windows users to use mklink (vista and above) for symbolic folderlinks at the root-level to preserve paths that is shared with other resources, such at the JAVA_HOME variable.
"Sugar makes the world go 'round. Caffeine makes it spin faster."