0

I'm trying to get phonegap 1.6.0 to work with Android, and it seems like following the guide on their website but it doesn't start. It just says the app stopped unexpectedly. I've gone over this multiple times, trying to make multiple projects, and I still get the same thing.

Here is all the code I have:

package com.phonegap.test;

import android.os.Bundle;
import org.apache.cordova.*;

public class PhoneGapTest extends DroidGap {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       super.loadUrl("file:///android_asset/www/index.html");
   }
 }

It all compiles fine, but craps out at launch. I've double and triple checked my project with the quick start guide and it lines up. I have the cordova-1.6.0.jar in my build path.

enter image description here

Here are the errors I get in eclipse when it attempts to launch.

Is there something I'm missing? Or did something change in 1.6.0 that isn't reflected in the docs?

AdamB
  • 3,101
  • 4
  • 34
  • 44

2 Answers2

0

I notice you have Android Dependencies. I've been noticing that I've been getting jars included twice when I use Eclipse which cause this error. I'd check the Android dependencies to make sure you don't have the cordova jar linked twice.

Also, this is unrelated to the bug, but you should update your Android SDK to the latest, and use the latest version of Android with Cordova. I'll look into getting the "Get Started" updated.

Joe B
  • 596
  • 4
  • 11
  • I don't think I have it linked twice. Heres my Android Dependencies: http://i.imgur.com/9NllT.png Anything else I should check? – AdamB Apr 16 '12 at 20:56
  • I tried 1.5.0 and I get the same problem. Is there anything else I can check? – AdamB Apr 16 '12 at 21:14
0

If you have ADT r17 or newer, cordova*.jar needs to be in the libs directory. More details here

Community
  • 1
  • 1
Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139
  • That answer worked. I had it in the "lib" directory without the s. I also had to import android support library, which then just automatically imported the cordova jar. – AdamB Apr 16 '12 at 21:39