views:

260

answers:

3

Hi, I am trying to build android example app by using phonegap. Here are the the system details. Operating System : Windows XP Android Sdk : 1.5 ( Previously i had 2.2 but deleted suspecting problem was with that) Ruby : 1.9.1-p430 Ant: 1.8.1 Java JDK 5 PhoneGap 0.9.1

System Enviroment Variables

ANDROID_HOME : D:\work\android-sdk_r3-windows\android-sdk-windows ANT_HOME : D:\work\ANT\apache-ant-1.8.1 JAVA_HOME : C:\Sun\SDK\jdk CLASSPATH : C:\Sun\SDK\jdk\lib Path : D:\work\android-sdk_r3-windows\android-sdk-windows;C:\Ruby191\bin;D:\work\ANT\apache-ant-1.8.1\bin;D:\work\android-sdk_r3-windows\android-sdk-windows\tools;

I ran ruby script and get output as below $ ruby ./droidgap "D:/work/android-sdk_r3-windows/android-sdk-windows" pgtest c om.example.android.pgtest example/ "D:/work/droid_apps/output1" Building the JAR...

BUILD FAILED D:\work\android-sdk_r3-windows\android-sdk-windows\tools\ant\ant_rules_r3.xml:28 3: null returned: 1

Total time: 1 second Creating Android project for target level 1 Adding www folder to project... Generating manifest... Copying over libraries and assets and creating phonegap.js... c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1265:in initialize': No such file or dir ectory - D:/work/phonegap/phonegap-android/framework/phonegap.jar (Errno::ENOENT ) from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1265:incopy_stream' from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1265:in `block in copy_file'

    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1264:in `open'
    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1264:in `copy_file'
    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:471:in `copy_file'
    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:392:in `block in cp'
    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1396:in `block in fu_each_sr

c_dest' from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1410:in fu_each_src_dest0' from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1394:infu_each_src_dest' from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:391:in cp' from ./droidgap:82:incopy_libs' from ./droidgap:20:in run' from ./droidgap:157:in'

I even changed ant to ant.bat at one place, android to android.bat at two places in ruby script. I also set target_id = 1 which is for 1.5 sdk.

In framework/default.properties updated target=android-3 Still getting this eror and I googled finding nothing but a hint suggesting that 2.2 might cause this problem so deleted that as well from android sdk manager

A: 

I dont know if you used the old scripts or the new ones, but I found success with the new scripts.

take a look at the latest stuff posted on git hub

http://github.com/phonegap/phonegap-android

I would also suggest looking in the PhoneGap Google Group where others have had similar problems

Aaron Saunders
A: 

I found solution myself it turned out to be android sdk. I downloaded all the available sdks from android sdk manager and its working now. One more thing i observed is that in libs folder the phonegap.jar in output built the size is 0kb, I copied the phonegap.jar file created after succesful run of droidgap script in framework folder. Now I am able to run the app in emulator!

Kapil
Hi kapil, can you make ur answers clear. ie. i too got phonegap.jar with size 0 , i am not clear about where it need to be copied. plz clarify it.
Janardhanan.S
A: 

Try compiling with ruby 1.9.1 . It created the jar file for me. The framework has some issues with ruby 1.9.2

Janardhanan.S