[android-developers] Re: NoClassDefFoundError for gson after updating the ADT and SDK Tools

2012-03-31 Thread seran...@gmail.com
Just mark all your JARs and Eclipse User Libraries as exported in the
Build Path / Order and Export configuration. It didn't work for me
until I also put Android Dependencies before my libraries in the
forementioned tab. Still don't know what the order is supposed to
do. :D

On Mar 22, 1:06 pm, Luca Morettoni l...@morettoni.net wrote:
 On Thu, Mar 22, 2012 at 12:03 PM, Mark Murphy mmur...@commonsware.com wrote:
  You can try:

 http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-...

 thanks!

 --
 Luca Morettoni luca(AT)morettoni.net |http://www.morettoni.net
 gtalk/msn: luca(AT)morettoni.net |http://twitter.com/morettoni
 Google+ profile:http://bit.ly/morettoni_plus
 Member of Python User Group Perugia:http://www.pypg.org/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gson after updating the ADT and SDK Tools

2012-03-22 Thread Yasin YILDIRIM
It worked! Thanks :)

On Mar 22, 1:03 pm, Mark Murphy mmur...@commonsware.com wrote:
 You can try:

 http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-...

 On Thu, Mar 22, 2012 at 6:39 AM, Yasin YILDIRIM









 yasinyildirim...@gmail.com wrote:
  Today I updated my ADT and SDK Tools to v17 and my projects using
  Google's gson jar library started to throw NoClassDefFoundError.
  Here's the logcat:

  03-22 12:30:58.941: E/AndroidRuntime(21672): FATAL EXCEPTION: main
  03-22 12:30:58.941: E/AndroidRuntime(21672):
  java.lang.NoClassDefFoundError: com.google.gson.Gson
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.conn.XRequestHandler.connect(XRequestHandler.java:35)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.conn.XRequestHandler.makeRequest(XRequestHandler.java:
  29)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.bavul.XBaseWithConnectionActivity.makeRequest(XBaseWithConn 
  ectionActivity.java:
  46)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.ui.login.SplashScreenActivity.onCreate(SplashScreenActivity 
  .java:
  36)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.Activity.performCreate(Activity.java:4465)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
  1049)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  1919)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
  1980)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.access$600(ActivityThread.java:122)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.os.Handler.dispatchMessage(Handler.java:99)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.os.Looper.loop(Looper.java:137)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.main(ActivityThread.java:4340)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  java.lang.reflect.Method.invokeNative(Native Method)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  java.lang.reflect.Method.invoke(Method.java:511)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.android.internal.os.ZygoteInit
  $MethodAndArgsCaller.run(ZygoteInit.java:784)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  dalvik.system.NativeStart.main(Native Method)

  any ideas?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.5
 Available!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: NoClassDefFoundError for gson after updating the ADT and SDK Tools

2012-03-22 Thread Kostya Vasilyev
Just updated to tools 17 and got this in most projects:

Implicit super constructor Object() is undefined for default
constructor. Must define an explicit constructor

And

The project was not built since its build path is incomplete. Cannot
find the class file for java.lang.Object.Fix the build path then try
building this project

Fix Project Properties fixed some projects, but not all.

What did help was:

I brought up project Properties / Android, selected a different
Android API version, clicked Apply, then changed the API version back
to what it was and clicked Apply again.

The improvements in these new tools are very welcome, but come on,
does anyone ever test how well new tools can migrate existing
projects?

-- K

22 марта 2012 г. 16:12 пользователь Yasin YILDIRIM
yasinyildirim...@gmail.com написал:
 It worked! Thanks :)

 On Mar 22, 1:03 pm, Mark Murphy mmur...@commonsware.com wrote:
 You can try:

 http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-...

 On Thu, Mar 22, 2012 at 6:39 AM, Yasin YILDIRIM









 yasinyildirim...@gmail.com wrote:
  Today I updated my ADT and SDK Tools to v17 and my projects using
  Google's gson jar library started to throw NoClassDefFoundError.
  Here's the logcat:

  03-22 12:30:58.941: E/AndroidRuntime(21672): FATAL EXCEPTION: main
  03-22 12:30:58.941: E/AndroidRuntime(21672):
  java.lang.NoClassDefFoundError: com.google.gson.Gson
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.conn.XRequestHandler.connect(XRequestHandler.java:35)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.conn.XRequestHandler.makeRequest(XRequestHandler.java:
  29)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.bavul.XBaseWithConnectionActivity.makeRequest(XBaseWithConn
   ectionActivity.java:
  46)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.matriksdata.ui.login.SplashScreenActivity.onCreate(SplashScreenActivity
   .java:
  36)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.Activity.performCreate(Activity.java:4465)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
  1049)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  1919)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
  1980)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.access$600(ActivityThread.java:122)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.os.Handler.dispatchMessage(Handler.java:99)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.os.Looper.loop(Looper.java:137)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  android.app.ActivityThread.main(ActivityThread.java:4340)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  java.lang.reflect.Method.invokeNative(Native Method)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  java.lang.reflect.Method.invoke(Method.java:511)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.android.internal.os.ZygoteInit
  $MethodAndArgsCaller.run(ZygoteInit.java:784)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  03-22 12:30:58.941: E/AndroidRuntime(21672):    at
  dalvik.system.NativeStart.main(Native Method)

  any ideas?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.5
 Available!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: NoClassDefFoundError

2011-11-22 Thread Ratheesh Valamchuzhy
paste the code...

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: NoClassDefFoundError

2011-11-22 Thread rachana govilkar
Hey problem is solved
i was returning null from a function
thnk u for attention btw.
:)

On Nov 22, 2:30 pm, Ratheesh Valamchuzhy android...@gmail.com wrote:
 paste the code...

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: NoClassDefFoundError

2011-11-22 Thread Ratheesh Valamchuzhy
ok.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: NoClassDefFoundError

2011-11-22 Thread Rajendra Prasad
Hi Guys,

I am SAP consultant, My company is integrating SAP with Android Mobile
applications.
I am quite new to android and very much interested in developing Android
Applications,
Could you let me know how can start developing Android Apps.
If you have any documents related to Android Apps, please send it to me .

Thanks for your help.


-- 

Best Regards,

Raaj

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: NoClassDefFoundError

2011-11-22 Thread TreKing
On Tue, Nov 22, 2011 at 6:53 AM, Rajendra Prasad raaj.fr...@gmail.comwrote:

 I am quite new to android and very much interested in developing Android
 Applications,
 Could you let me know how can start developing Android Apps.
 If you have any documents related to Android Apps, please send it to me .


A - Please don't hijack threads. This has nothing to do with this thread.
If you have a question, start your own thread.
B - Have you ever heard of Google?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: NoClassDefFoundError

2011-11-22 Thread Zsolt Vasvari
He's an SAP CONSULTANT, didn't you hear that? --- he's allowed to
hijack threads.

On Nov 23, 10:59 am, TreKing treking...@gmail.com wrote:
 On Tue, Nov 22, 2011 at 6:53 AM, Rajendra Prasad raaj.fr...@gmail.comwrote:

  I am quite new to android and very much interested in developing Android
  Applications,
  Could you let me know how can start developing Android Apps.
  If you have any documents related to Android Apps, please send it to me .

 A - Please don't hijack threads. This has nothing to do with this thread.
 If you have a question, start your own thread.
 B - Have you ever heard of Google?

 ---­--
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: NoClassDefFoundError

2011-11-22 Thread TreKing
On Tue, Nov 22, 2011 at 9:14 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 He's an SAP CONSULTANT, didn't you hear that? --- he's allowed to hijack
 threads.


Touché.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: NoClassDefFoundError

2011-11-21 Thread rachana govilkar
yes it is declared in Manifest..


On Nov 22, 5:01 am, TreKing treking...@gmail.com wrote:
 On Mon, Nov 21, 2011 at 6:47 AM, rachana govilkar 

 rachana.govil...@gmail.com wrote:
  I am getting this error frequently when i execute my
  app..RegionStandardMapActivity class does existbut am not
  getting where i have made a mistake.please anyone can help???

 Was it declared in your manifest?

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: noclassdeffounderror

2011-05-05 Thread DanH
The most common reason for NoClassDefFoundError is a exception in the
static initializer for the class.

On May 5, 6:57 am, ragupathi ragupathi ragumm...@gmail.com wrote:
 hi im developing google application it focus some problem like
 noclassdeffounderror exception. Any one knows post the solutions. when
 this problem is occurred means when im call a new class not a activity
 like overlay class the error is shown. if i will start a new project
 and develop this only means working fine but my project its not
 working.

 manifest file:

 uses-library android:name=com.google.android.maps/
     /application
     uses-permission android:name=android.permission.CAMERA/
   uses-permission android:name=android.permission.READ_CONTACTS/
   uses-permission android:name=android.permission.WRITE_CONTACTS/
   uses-permission android:name=android.permission.INTERNET/
   uses-permission
 android:name=com.android.browser.permission.READ_HISTORY_BOOKMARKS/
   uses-permission android:name=android.permission.VIBRATE/
   uses-permission android:name=android.permission.FLASHLIGHT/
   uses-permission
 android:name=android.permission.WRITE_EXTERNAL_STORAGE/

   !-- Wifi related  --
   uses-permission android:name=android.permission.WRITE_SETTINGS /
   uses-permission
 android:name=android.permission.CHANGE_WIFI_STATE /
   uses-permission
 android:name=android.permission.ACCESS_WIFI_STATE /
   uses-permission
 android:name=android.permission.ACCESS_NETWORK_STATE /
   uses-permission android:name=android.permission.WAKE_LOCK /

     uses-permission android:name=android.permission.INTERNET/
   uses-permission
 android:name=android.permission.ACCESS_FINE_LOCATION/
 uses-feature android:name=android.hardware.camera/uses-feature
     uses-sdk android:minSdkVersion=5 /

 this is my map activity class

 public class Wherepagechange extends MapActivity {

                 private OnGroupDetails onGroupDetails=new OnGroupDetails();
                 private ValueHolder valueHolder = 
 ValueHolder.getSingletonObject();
                 private ChekinMarkerModel chekinMarkerModel;
                 public MapView myMapView;
                 private ListView chickinList;
                 GeoPoint mapPoint = null;
                 private Activity activity=this;

                 @Override
                 public void onCreate(Bundle savedInstanceState) {
                         super.onCreate(savedInstanceState);
                         setContentView(R.layout.wherepagechange);
                         chickinList = (ListView) 
 findViewById(R.id.ckickin_list);
                         myMapView = (MapView) findViewById(R.id.myMapView);

                         myMapView.setBuiltInZoomControls(true);
                         myMapView.getMapCenter();
                         MapController mapController;
                         mapController = myMapView.getController();
                         mapController.setZoom(4);
 ListOverlay mapOverlays = myMapView.getOverlays();
                         Drawable drawable =
 this.getResources().getDrawable(R.drawable.bar_icon);
                         MyItemOverlay itemizedoverlay = new 
 MyItemOverlay(drawable);

                         GeoPoint point = new GeoPoint(1924,-9912);
                         OverlayItem overlayitem = new OverlayItem(point, 
 Hola, Mundo!,
 I'm in Mexico City!);

                         itemizedoverlay.addOverlay(overlayitem);
                         mapOverlays.add(itemizedoverlay);

 }
 }

 this is myitemoverlay class:

 public class MyItemOverlay extends ItemizedOverlayOverlayItem {

         private ArrayListOverlayItem mOverlays = new
 ArrayListOverlayItem();
         //private Context con;

         public MyItemOverlay(Drawable defaultMarker) {
                 super(boundCenterBottom(defaultMarker));
                 // TODO Auto-generated constructor stub
         }

         public void addOverlay(OverlayItem overlay) {
             mOverlays.add(overlay);
             populate();
         }

         @Override
         protected OverlayItem createItem(int i) {
                 // TODO Auto-generated method stub
                 return mOverlays.get(i);

         }

         @Override
         public int size() {
                 // TODO Auto-generated method stub
                 return mOverlays.size();

         }

 }

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError in Google Maps

2011-04-12 Thread JP


On Apr 12, 5:53 am, TreKing treking...@gmail.com wrote:
 Or use reflection to determine if this class exists and is available for
 use.

Or a wrapper class. Here's a blog post that helped me figure it out a
bit quicker:
http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError when starting an AIDL service

2011-01-10 Thread Kumar Bibek
Just a doubt. Is your second project (which is used by the first) a
library project? In that case, it should work.

On Jan 9, 10:08 pm, Lazarus 101 lazarus...@gmail.com wrote:
 I have two projects, the first one has the aidl files and other
 classes that will be shared with the client aps, and the second one
 has the implementation for aidl. First project is set as a dependency
 for the second one, everything compiles just fine and run. But when I
 try to access the service from a client a get a Runtime error
 NoClassDefFoundError.

 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):
 java.lang.NoClassDefFoundError: my.app.MyService$1
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 my.app.myService.init(MyService.java:37)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 java.lang.Class.newInstanceImpl(Native Method)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 java.lang.Class.newInstance(Class.java:1429)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 android.app.ActivityThread.handleCreateService(ActivityThread.java:
 2940)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 android.app.ActivityThread.access$3300(ActivityThread.java:125)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 android.os.Looper.loop(Looper.java:123)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 android.app.ActivityThread.main(ActivityThread.java:4627)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 java.lang.reflect.Method.invoke(Method.java:521)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:868)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 01-09 18:48:28.003: ERROR/AndroidRuntime(11084):     at
 dalvik.system.NativeStart.main(Native Method)

 The problem is fixed if I copy the aidl file in the second project so
 that the generated java interface is in the gen folder from the
 second project. But this is not a viable option because I have to use
 a build server (I don't have direct access to it) and all aidl files
 have to be in the first project.

 Anyone else had a similiar problem?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError when running the app

2010-10-18 Thread DanH
Note that NoClassDefFound can also occur because the class was found
but was incompatible with other classes it links to.

On Oct 18, 12:48 pm, ping bernd.warm...@gmail.com wrote:
 Hi.
 I have a problem with a library which i would like to use in my
 project.
 Here is the situtation:
 I have an android project which has another Java Project in its build
 path. Thats fine. The other java project reffers to another *.jar
 library on its buildpath. Eclipse does not show any errors. But when i
 try to call a method of the java project out of my android project it
 cannot find the classes which are in the *.jar file of the java
 project. It throws a NoClassDefFoundException.

 Android seems to doesnt find the *.jar file within the other java-
 project.

 Can anyone tell me what's the problem here

 Again: the projectstructure:

 ANDROID PROJECT ---uses--- JAVA PROJECT --uses--- *.jar
 when I call a method of the javaproject out of the android project a
 NoClassDefFoundException is thrown at the point where classes of the
 *.jar file were used :/

 greets

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError when running the app

2010-10-18 Thread ping
I figured out that no *.class files are generated when the project is
building.
I tried to clean the project but there are no *.class files of the
*.jar in the bin folder of eclipse


On Oct 18, 8:29 pm, DanH danhi...@ieee.org wrote:
 Note that NoClassDefFound can also occur because the class was found
 but was incompatible with other classes it links to.

 On Oct 18, 12:48 pm, ping bernd.warm...@gmail.com wrote:



  Hi.
  I have a problem with a library which i would like to use in my
  project.
  Here is the situtation:
  I have an android project which has another Java Project in its build
  path. Thats fine. The other java project reffers to another *.jar
  library on its buildpath. Eclipse does not show any errors. But when i
  try to call a method of the java project out of my android project it
  cannot find the classes which are in the *.jar file of the java
  project. It throws a NoClassDefFoundException.

  Android seems to doesnt find the *.jar file within the other java-
  project.

  Can anyone tell me what's the problem here

  Again: the projectstructure:

  ANDROID PROJECT ---uses--- JAVA PROJECT --uses--- *.jar
  when I call a method of the javaproject out of the android project a
  NoClassDefFoundException is thrown at the point where classes of the
  *.jar file were used :/

  greets

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError when running the app

2010-10-18 Thread ping
hey guys,
i've found the solution.
i suggested that eclipse takes care of the *.jar files within the
referenced java project.
But i have to set a dependency to the *.jar file from out of the
android project too.

thank you for your help,

greets

On Oct 18, 8:38 pm, ping bernd.warm...@gmail.com wrote:
 I figured out that no *.class files are generated when the project is
 building.
 I tried to clean the project but there are no *.class files of the
 *.jar in the bin folder of eclipse

 On Oct 18, 8:29 pm, DanH danhi...@ieee.org wrote:



  Note that NoClassDefFound can also occur because the class was found
  but was incompatible with other classes it links to.

  On Oct 18, 12:48 pm, ping bernd.warm...@gmail.com wrote:

   Hi.
   I have a problem with a library which i would like to use in my
   project.
   Here is the situtation:
   I have an android project which has another Java Project in its build
   path. Thats fine. The other java project reffers to another *.jar
   library on its buildpath. Eclipse does not show any errors. But when i
   try to call a method of the java project out of my android project it
   cannot find the classes which are in the *.jar file of the java
   project. It throws a NoClassDefFoundException.

   Android seems to doesnt find the *.jar file within the other java-
   project.

   Can anyone tell me what's the problem here

   Again: the projectstructure:

   ANDROID PROJECT ---uses--- JAVA PROJECT --uses--- *.jar
   when I call a method of the javaproject out of the android project a
   NoClassDefFoundException is thrown at the point where classes of the
   *.jar file were used :/

   greets

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError when running the app

2010-10-18 Thread DanH
Well, remember that the jar file CONTAINS class files.  In a normal
JDK environment the jar doesn't need to be compiled, since it
already is.  But in Android the contents of the jar does need to get
included into the dex file(s) which end up in the apk.

On Oct 18, 1:38 pm, ping bernd.warm...@gmail.com wrote:
 I figured out that no *.class files are generated when the project is
 building.
 I tried to clean the project but there are no *.class files of the
 *.jar in the bin folder of eclipse

 On Oct 18, 8:29 pm, DanH danhi...@ieee.org wrote:

  Note that NoClassDefFound can also occur because the class was found
  but was incompatible with other classes it links to.

  On Oct 18, 12:48 pm, ping bernd.warm...@gmail.com wrote:

   Hi.
   I have a problem with a library which i would like to use in my
   project.
   Here is the situtation:
   I have an android project which has another Java Project in its build
   path. Thats fine. The other java project reffers to another *.jar
   library on its buildpath. Eclipse does not show any errors. But when i
   try to call a method of the java project out of my android project it
   cannot find the classes which are in the *.jar file of the java
   project. It throws a NoClassDefFoundException.

   Android seems to doesnt find the *.jar file within the other java-
   project.

   Can anyone tell me what's the problem here

   Again: the projectstructure:

   ANDROID PROJECT ---uses--- JAVA PROJECT --uses--- *.jar
   when I call a method of the javaproject out of the android project a
   NoClassDefFoundException is thrown at the point where classes of the
   *.jar file were used :/

   greets

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-18 Thread Kumar Bibek
According to me, you should also add the gdata-base and gdata-client.

Perhaps, here are the super classes of CalendarService. Try it once
and I am sure that this will work.

Thanks and Regards,
Kumar Bibek

On Mar 17, 4:04 am, Bob Kerns r...@acm.org wrote:
 From your log messages, I would guess that the class
 com.google.gdata.client.GoogleService lives in a different .jar, that
 you haven't included somehow.

 (At least, googling com.google.gdata.client.calendar.CalendarService
 suggests that's the superclass in question).

 Check inside the .dex file to see if it's got the classes in question.
 You can pull out the classes.dex file from the .apk using any .zip
 tool, and then tear IT apart using dexdump (from the Android platform
 SDK) or baksmali.

 On Mar 15, 9:00 am, Tom orei...@mbari.org wrote:

  Thanks everyone for all of your suggestions. I haven't been able to
  get the com.google.gdata classes to load properly in the emulator or
  my N1 phone.

  The stack trace indicates that the DVM cannot load classes in the
  com.google.gdata.client packages, despite the jars being included in
  the Eclipse project. My test app generates the following messages when
  trying to instantiate a
  com.google.gdata.client.calendar.CalendarService object:

  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  E/dalvikvm(  220): Could not find class
  'com.google.gdata.client.calendar.Cale
  ndarService', referenced from method
  com.tomoreilly.CalendarTest.onCreate
  W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
  gdata/c
  lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
  D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
  D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
  CalendarTest;.onCreate cod
  e (608 bytes)
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  I/dalvikvm(  220): Could not find method
  com.google.gdata.client.calendar.Cale
  ndarService.setUserCredentials, referenced from method
  com.tomoreilly.Calendar
  Test.onCreate
  W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
  google/gdata
  /client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
  String;Ljava/
  lang/String;)V
  D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  data/cale
  ndar/CalendarFeed; (20)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
  CalendarFeed
  ;' failed

  I haven't been able to solve this specific problem, but instead have
  decided to take the alternate approach suggested by Jim Blackler 
  athttp://jimblackler.net/blog/?p=151. His approach does not rely on
  com.google.gdata classes, but instead uses an Intents mechanism that
  is not documented by Google.

  Regards,
  Tom

  On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:

   Yes. The reason I do copy them (and recommend copying them) to a lib/
   directory is twofold:

   1) It makes them an explicit part of your project for versioning. If
   you use Subversion you can make these be a copy from a directory of
   third-party components. You could copy the third-party directory for
   tagging as well as your project, but this makes the dependency more
   apparent.

   2) It's compatible with how the ant build scripts are set up out-of-
   the-box, so it makes it easier to transition to an ant-based
   production build.

   But as you note, Eclipse doesn't really care.

   On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

It doesn't really matter if you create a lib folder and put the jars
and link them. It just works if you have added the jars the the build
path. Though I am not able to figure out why you are getting this
error.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-16 Thread DJC
I am having the same problem ...

DJC

On Mar 15, 11:52 am, Brion Emde brione2...@gmail.com wrote:
 Hi Tom,

 I went down the same path as you with the gdata library and I was
 going to take a look at this library, which the developer claims does
 work on Android:

 http://code.google.com/p/simply-gdata/

 I'd be interested in if this works for you, as I haven't gotten around
 to looking at it and if it solves my medium-term needs.

 On Mar 15, 10:00 am, Tom orei...@mbari.org wrote:



  Thanks everyone for all of your suggestions. I haven't been able to
  get the com.google.gdata classes to load properly in the emulator or
  my N1 phone.

  The stack trace indicates that the DVM cannot load classes in the
  com.google.gdata.client packages, despite the jars being included in
  the Eclipse project. My test app generates the following messages when
  trying to instantiate a
  com.google.gdata.client.calendar.CalendarService object:

  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  E/dalvikvm(  220): Could not find class
  'com.google.gdata.client.calendar.Cale
  ndarService', referenced from method
  com.tomoreilly.CalendarTest.onCreate
  W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
  gdata/c
  lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
  D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
  D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
  CalendarTest;.onCreate cod
  e (608 bytes)
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  I/dalvikvm(  220): Could not find method
  com.google.gdata.client.calendar.Cale
  ndarService.setUserCredentials, referenced from method
  com.tomoreilly.Calendar
  Test.onCreate
  W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
  google/gdata
  /client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
  String;Ljava/
  lang/String;)V
  D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  data/cale
  ndar/CalendarFeed; (20)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
  CalendarFeed
  ;' failed

  I haven't been able to solve this specific problem, but instead have
  decided to take the alternate approach suggested by Jim Blackler 
  athttp://jimblackler.net/blog/?p=151. His approach does not rely on
  com.google.gdata classes, but instead uses an Intents mechanism that
  is not documented by Google.

  Regards,
  Tom

  On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:

   Yes. The reason I do copy them (and recommend copying them) to a lib/
   directory is twofold:

   1) It makes them an explicit part of your project for versioning. If
   you use Subversion you can make these be a copy from a directory of
   third-party components. You could copy the third-party directory for
   tagging as well as your project, but this makes the dependency more
   apparent.

   2) It's compatible with how the ant build scripts are set up out-of-
   the-box, so it makes it easier to transition to an ant-based
   production build.

   But as you note, Eclipse doesn't really care.

   On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

It doesn't really matter if you create a lib folder and put the jars
and link them. It just works if you have added the jars the the build
path. Though I am not able to figure out why you are getting this
error.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-16 Thread DJC
I'm having the same problem :(

On Mar 15, 11:52 am, Brion Emde brione2...@gmail.com wrote:
 Hi Tom,

 I went down the same path as you with the gdata library and I was
 going to take a look at this library, which the developer claims does
 work on Android:

 http://code.google.com/p/simply-gdata/

 I'd be interested in if this works for you, as I haven't gotten around
 to looking at it and if it solves my medium-term needs.

 On Mar 15, 10:00 am, Tom orei...@mbari.org wrote:



  Thanks everyone for all of your suggestions. I haven't been able to
  get the com.google.gdata classes to load properly in the emulator or
  my N1 phone.

  The stack trace indicates that the DVM cannot load classes in the
  com.google.gdata.client packages, despite the jars being included in
  the Eclipse project. My test app generates the following messages when
  trying to instantiate a
  com.google.gdata.client.calendar.CalendarService object:

  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  E/dalvikvm(  220): Could not find class
  'com.google.gdata.client.calendar.Cale
  ndarService', referenced from method
  com.tomoreilly.CalendarTest.onCreate
  W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
  gdata/c
  lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
  D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
  D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
  CalendarTest;.onCreate cod
  e (608 bytes)
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  I/dalvikvm(  220): Could not find method
  com.google.gdata.client.calendar.Cale
  ndarService.setUserCredentials, referenced from method
  com.tomoreilly.Calendar
  Test.onCreate
  W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
  google/gdata
  /client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
  String;Ljava/
  lang/String;)V
  D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  data/cale
  ndar/CalendarFeed; (20)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
  CalendarFeed
  ;' failed

  I haven't been able to solve this specific problem, but instead have
  decided to take the alternate approach suggested by Jim Blackler 
  athttp://jimblackler.net/blog/?p=151. His approach does not rely on
  com.google.gdata classes, but instead uses an Intents mechanism that
  is not documented by Google.

  Regards,
  Tom

  On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:

   Yes. The reason I do copy them (and recommend copying them) to a lib/
   directory is twofold:

   1) It makes them an explicit part of your project for versioning. If
   you use Subversion you can make these be a copy from a directory of
   third-party components. You could copy the third-party directory for
   tagging as well as your project, but this makes the dependency more
   apparent.

   2) It's compatible with how the ant build scripts are set up out-of-
   the-box, so it makes it easier to transition to an ant-based
   production build.

   But as you note, Eclipse doesn't really care.

   On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

It doesn't really matter if you create a lib folder and put the jars
and link them. It just works if you have added the jars the the build
path. Though I am not able to figure out why you are getting this
error.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-16 Thread DJC
I too am encountering the same issue.

I'm using MOTODEV to develop an Android app using the Google Calendar
API.  I downloaded gdata-src.java-1.40.3 and unzipped it.  In Project -
 Properties I pull up the Java Build Path tab, Libraries subtab and
click Add External Jars.  I navigate down to gdata-src.java-1.40.3/
gdata/java/lib, and inside there are like 50 jar files.  I'm a noob
but I admit this seems odd straight away - why so many?  So I pick
gdata-calendar-2.0.jar and click through and I'm happy to see that my
compile now reads clean, plus there is a new Referenced Libraries
entry (peer to src, assets, etc.) and that it is populated with 5 jar
files: calendar, calendar-meta, client, client-meta, and core.  Sweet,
looks like dependencies are handled too. (Noob here, and if my method
sucks I invite instruction).

Upon run (in the Emulator) I get a force close and the logcat shows a
stack traceback for a java.lang.NoClassDefFoundError:
com.google.gdata.client.calendar.CalendarService at this line:
CalendarService myCalendar = new 
CalendarService(dcd-Timeline-1);

I've looked round lots and don't see where I can tell the runtime how
to find this... I would have thought it would be statically compiled
into my .apk??

thanks,
DJC

On Mar 15, 11:52 am, Brion Emde brione2...@gmail.com wrote:
 Hi Tom,

 I went down the same path as you with the gdata library and I was
 going to take a look at this library, which the developer claims does
 work on Android:

 http://code.google.com/p/simply-gdata/

 I'd be interested in if this works for you, as I haven't gotten around
 to looking at it and if it solves my medium-term needs.

 On Mar 15, 10:00 am, Tom orei...@mbari.org wrote:



  Thanks everyone for all of your suggestions. I haven't been able to
  get the com.google.gdata classes to load properly in the emulator or
  my N1 phone.

  The stack trace indicates that the DVM cannot load classes in the
  com.google.gdata.client packages, despite the jars being included in
  the Eclipse project. My test app generates the following messages when
  trying to instantiate a
  com.google.gdata.client.calendar.CalendarService object:

  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  E/dalvikvm(  220): Could not find class
  'com.google.gdata.client.calendar.Cale
  ndarService', referenced from method
  com.tomoreilly.CalendarTest.onCreate
  W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
  gdata/c
  lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
  D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
  D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
  CalendarTest;.onCreate cod
  e (608 bytes)
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  client/ca
  lendar/CalendarService; (6)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
  CalendarSe
  rvice;' failed
  I/dalvikvm(  220): Could not find method
  com.google.gdata.client.calendar.Cale
  ndarService.setUserCredentials, referenced from method
  com.tomoreilly.Calendar
  Test.onCreate
  W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
  google/gdata
  /client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
  String;Ljava/
  lang/String;)V
  D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
  W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
  data/cale
  ndar/CalendarFeed; (20)
  W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
  CalendarFeed
  ;' failed

  I haven't been able to solve this specific problem, but instead have
  decided to take the alternate approach suggested by Jim Blackler 
  athttp://jimblackler.net/blog/?p=151. His approach does not rely on
  com.google.gdata classes, but instead uses an Intents mechanism that
  is not documented by Google.

  Regards,
  Tom

  On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:

   Yes. The reason I do copy them (and recommend copying them) to a lib/
   directory is twofold:

   1) It makes them an explicit part of your project for versioning. If
   you use Subversion you can make these be a copy from a directory of
   third-party components. You could copy the third-party directory for
   tagging as well as your project, but this makes the dependency more
   apparent.

   2) It's compatible with how the ant build scripts are set up out-of-
   the-box, so it makes it easier to transition to an ant-based
   production build.

   But as you note, Eclipse doesn't really care.

   On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

It doesn't really matter if you create a lib folder and put the jars
and link them. It just works if you have added the jars the the build
path. Though I am not able to figure out why you are getting this
error.

-- 

[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-16 Thread Bob Kerns
From your log messages, I would guess that the class
com.google.gdata.client.GoogleService lives in a different .jar, that
you haven't included somehow.

(At least, googling com.google.gdata.client.calendar.CalendarService
suggests that's the superclass in question).

Check inside the .dex file to see if it's got the classes in question.
You can pull out the classes.dex file from the .apk using any .zip
tool, and then tear IT apart using dexdump (from the Android platform
SDK) or baksmali.

On Mar 15, 9:00 am, Tom orei...@mbari.org wrote:
 Thanks everyone for all of your suggestions. I haven't been able to
 get the com.google.gdata classes to load properly in the emulator or
 my N1 phone.

 The stack trace indicates that the DVM cannot load classes in the
 com.google.gdata.client packages, despite the jars being included in
 the Eclipse project. My test app generates the following messages when
 trying to instantiate a
 com.google.gdata.client.calendar.CalendarService object:

 W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
 client/ca
 lendar/CalendarService; (6)
 W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
 CalendarSe
 rvice;' failed
 E/dalvikvm(  220): Could not find class
 'com.google.gdata.client.calendar.Cale
 ndarService', referenced from method
 com.tomoreilly.CalendarTest.onCreate
 W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
 gdata/c
 lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
 D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
 D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
 CalendarTest;.onCreate cod
 e (608 bytes)
 W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
 client/ca
 lendar/CalendarService; (6)
 W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
 CalendarSe
 rvice;' failed
 I/dalvikvm(  220): Could not find method
 com.google.gdata.client.calendar.Cale
 ndarService.setUserCredentials, referenced from method
 com.tomoreilly.Calendar
 Test.onCreate
 W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
 google/gdata
 /client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
 String;Ljava/
 lang/String;)V
 D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
 W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
 data/cale
 ndar/CalendarFeed; (20)
 W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
 CalendarFeed
 ;' failed

 I haven't been able to solve this specific problem, but instead have
 decided to take the alternate approach suggested by Jim Blackler 
 athttp://jimblackler.net/blog/?p=151. His approach does not rely on
 com.google.gdata classes, but instead uses an Intents mechanism that
 is not documented by Google.

 Regards,
 Tom

 On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:



  Yes. The reason I do copy them (and recommend copying them) to a lib/
  directory is twofold:

  1) It makes them an explicit part of your project for versioning. If
  you use Subversion you can make these be a copy from a directory of
  third-party components. You could copy the third-party directory for
  tagging as well as your project, but this makes the dependency more
  apparent.

  2) It's compatible with how the ant build scripts are set up out-of-
  the-box, so it makes it easier to transition to an ant-based
  production build.

  But as you note, Eclipse doesn't really care.

  On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

   It doesn't really matter if you create a lib folder and put the jars
   and link them. It just works if you have added the jars the the build
   path. Though I am not able to figure out why you are getting this
   error.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-15 Thread Tom
Thanks everyone for all of your suggestions. I haven't been able to
get the com.google.gdata classes to load properly in the emulator or
my N1 phone.

The stack trace indicates that the DVM cannot load classes in the
com.google.gdata.client packages, despite the jars being included in
the Eclipse project. My test app generates the following messages when
trying to instantiate a
com.google.gdata.client.calendar.CalendarService object:

W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
client/ca
lendar/CalendarService; (6)
W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
CalendarSe
rvice;' failed
E/dalvikvm(  220): Could not find class
'com.google.gdata.client.calendar.Cale
ndarService', referenced from method
com.tomoreilly.CalendarTest.onCreate
W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
gdata/c
lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
CalendarTest;.onCreate cod
e (608 bytes)
W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
client/ca
lendar/CalendarService; (6)
W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
CalendarSe
rvice;' failed
I/dalvikvm(  220): Could not find method
com.google.gdata.client.calendar.Cale
ndarService.setUserCredentials, referenced from method
com.tomoreilly.Calendar
Test.onCreate
W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
google/gdata
/client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
String;Ljava/
lang/String;)V
D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
data/cale
ndar/CalendarFeed; (20)
W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
CalendarFeed
;' failed


I haven't been able to solve this specific problem, but instead have
decided to take the alternate approach suggested by Jim Blackler at
http://jimblackler.net/blog/?p=151 . His approach does not rely on
com.google.gdata classes, but instead uses an Intents mechanism that
is not documented by Google.

Regards,
Tom

On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:
 Yes. The reason I do copy them (and recommend copying them) to a lib/
 directory is twofold:

 1) It makes them an explicit part of your project for versioning. If
 you use Subversion you can make these be a copy from a directory of
 third-party components. You could copy the third-party directory for
 tagging as well as your project, but this makes the dependency more
 apparent.

 2) It's compatible with how the ant build scripts are set up out-of-
 the-box, so it makes it easier to transition to an ant-based
 production build.

 But as you note, Eclipse doesn't really care.

 On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

  It doesn't really matter if you create a lib folder and put the jars
  and link them. It just works if you have added the jars the the build
  path. Though I am not able to figure out why you are getting this
  error.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-15 Thread David Williams
They go under resource



On Sat, Mar 13, 2010 at 6:21 PM, Tom orei...@mbari.org wrote:



 On Mar 13, 3:15 pm, Mark Murphy mmur...@commonsware.com wrote:
  Tom wrote:
   I'm writing an android 2.1 application that writes an entry to my
   Google calendar. The relevant part of my application code looks like
   this:
 
  void addCalendarEntry(String googleUser, String password)
  throws Exception {
 
  URL postURL =
   new URL(http://www.google.com/calendar/feeds/; +
   googleUser +
/private/full);
 
  CalendarService myService =
   new CalendarService(myCompany-exampleApp-1.0);
 
   This code compiles with no errors, using Eclipse on MacOS, using
   external jar files from the Google gdata project:
   gdata/java/lib/gdata-calendar-2.0.jar
   gdata/java/lib/gdata-calendar-meta-2.0.jar
 
  Did you copy these into your project's libs/ directory?
 

 No, I merely specified the path to the external jar in the Eclipse
 Java build path libraries dialog. This seemed to work for other
 projects I've developed. I look in my Eclipse project workspace and
 see assets, bin, gen, res, and src directories but no libs. Where
 should that directory appear?

 Thanks very much,
 Tom

  --
   Mark Murphy (a Commons Guy)http://commonsware.com|
 http://twitter.com/commonsguy
 
  Android Training in US: 14-18 June 2010:http://bignerdranch.com

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-15 Thread Brion Emde
Hi Tom,

I went down the same path as you with the gdata library and I was
going to take a look at this library, which the developer claims does
work on Android:

http://code.google.com/p/simply-gdata/

I'd be interested in if this works for you, as I haven't gotten around
to looking at it and if it solves my medium-term needs.


On Mar 15, 10:00 am, Tom orei...@mbari.org wrote:
 Thanks everyone for all of your suggestions. I haven't been able to
 get the com.google.gdata classes to load properly in the emulator or
 my N1 phone.

 The stack trace indicates that the DVM cannot load classes in the
 com.google.gdata.client packages, despite the jars being included in
 the Eclipse project. My test app generates the following messages when
 trying to instantiate a
 com.google.gdata.client.calendar.CalendarService object:

 W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
 client/ca
 lendar/CalendarService; (6)
 W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
 CalendarSe
 rvice;' failed
 E/dalvikvm(  220): Could not find class
 'com.google.gdata.client.calendar.Cale
 ndarService', referenced from method
 com.tomoreilly.CalendarTest.onCreate
 W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
 gdata/c
 lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
 D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
 D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
 CalendarTest;.onCreate cod
 e (608 bytes)
 W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
 client/ca
 lendar/CalendarService; (6)
 W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
 CalendarSe
 rvice;' failed
 I/dalvikvm(  220): Could not find method
 com.google.gdata.client.calendar.Cale
 ndarService.setUserCredentials, referenced from method
 com.tomoreilly.Calendar
 Test.onCreate
 W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
 google/gdata
 /client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
 String;Ljava/
 lang/String;)V
 D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
 W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
 data/cale
 ndar/CalendarFeed; (20)
 W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
 CalendarFeed
 ;' failed

 I haven't been able to solve this specific problem, but instead have
 decided to take the alternate approach suggested by Jim Blackler 
 athttp://jimblackler.net/blog/?p=151. His approach does not rely on
 com.google.gdata classes, but instead uses an Intents mechanism that
 is not documented by Google.

 Regards,
 Tom

 On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:



  Yes. The reason I do copy them (and recommend copying them) to a lib/
  directory is twofold:

  1) It makes them an explicit part of your project for versioning. If
  you use Subversion you can make these be a copy from a directory of
  third-party components. You could copy the third-party directory for
  tagging as well as your project, but this makes the dependency more
  apparent.

  2) It's compatible with how the ant build scripts are set up out-of-
  the-box, so it makes it easier to transition to an ant-based
  production build.

  But as you note, Eclipse doesn't really care.

  On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

   It doesn't really matter if you create a lib folder and put the jars
   and link them. It just works if you have added the jars the the build
   path. Though I am not able to figure out why you are getting this
   error.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-13 Thread Tom


On Mar 13, 3:15 pm, Mark Murphy mmur...@commonsware.com wrote:
 Tom wrote:
  I'm writing an android 2.1 application that writes an entry to my
  Google calendar. The relevant part of my application code looks like
  this:

     void addCalendarEntry(String googleUser, String password)
     throws Exception {

             URL postURL =
                      new URL(http://www.google.com/calendar/feeds/; +
  googleUser +
                               /private/full);

             CalendarService myService =
                      new CalendarService(myCompany-exampleApp-1.0);

  This code compiles with no errors, using Eclipse on MacOS, using
  external jar files from the Google gdata project:
  gdata/java/lib/gdata-calendar-2.0.jar
  gdata/java/lib/gdata-calendar-meta-2.0.jar

 Did you copy these into your project's libs/ directory?


No, I merely specified the path to the external jar in the Eclipse
Java build path libraries dialog. This seemed to work for other
projects I've developed. I look in my Eclipse project workspace and
see assets, bin, gen, res, and src directories but no libs. Where
should that directory appear?

Thanks very much,
Tom

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Training in US: 14-18 June 2010:http://bignerdranch.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-13 Thread Mark Murphy
Tom wrote:
 This code compiles with no errors, using Eclipse on MacOS, using
 external jar files from the Google gdata project:
 gdata/java/lib/gdata-calendar-2.0.jar
 gdata/java/lib/gdata-calendar-meta-2.0.jar
 Did you copy these into your project's libs/ directory?

 
 No, I merely specified the path to the external jar in the Eclipse
 Java build path libraries dialog. This seemed to work for other
 projects I've developed. I look in my Eclipse project workspace and
 see assets, bin, gen, res, and src directories but no libs. Where
 should that directory appear?

As a peer to assets/, bin/, gen/, res/, and src/.

Now, it is conceivable that Eclipse handles things differently. I don't
use Eclipse, and from the command line, just dropping the dependent JARs
in libs/ is all you need. My recommendation to my students is that they
put their dependent JARs in libs/ plus add them to the Eclipse build path.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-13 Thread Tom
I created the libs directory where you specified and copied the
gdata .jar files in there, then from Eclipse ran Export project,
then installed on the phone - but with the same result -
NoClassDefFoundError for CalendarService.

It seems that Eclipse is silently failing to handle the gdata jar
files somehow - my project contains another 3rd party jar file which
appears to work just fine.

Something tells me that I have to stop relying on Eclipse and actually
learn how to use the Android SDK command-line tools... I knew it
wouldn't be this easy. ;-)

Thanks for all of your help.


On Mar 13, 3:24 pm, Mark Murphy mmur...@commonsware.com wrote:
 Tom wrote:
  This code compiles with no errors, using Eclipse on MacOS, using
  external jar files from the Google gdata project:
  gdata/java/lib/gdata-calendar-2.0.jar
  gdata/java/lib/gdata-calendar-meta-2.0.jar
  Did you copy these into your project's libs/ directory?

  No, I merely specified the path to the external jar in the Eclipse
  Java build path libraries dialog. This seemed to work for other
  projects I've developed. I look in my Eclipse project workspace and
  see assets, bin, gen, res, and src directories but no libs. Where
  should that directory appear?

 As a peer to assets/, bin/, gen/, res/, and src/.

 Now, it is conceivable that Eclipse handles things differently. I don't
 use Eclipse, and from the command line, just dropping the dependent JARs
 in libs/ is all you need. My recommendation to my students is that they
 put their dependent JARs in libs/ plus add them to the Eclipse build path.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-13 Thread Bob Kerns
What I do is to create a libs/ directory in Eclipse, and add them to
the Eclipse build path.  Android Tools/Export Signed Application
Properties works fine.

But I *highly* recommend not using Eclipse for your production builds,
but rather have a build script that handles checkout, version
numbering, naming the resulting builds, etc. A disciplined build
process greatly reduces the possibility of confusion and mistakes
making it into customer's hands.

Unforutnately, the way Eclipse does things, that means two different
build methodologies; one for debugging, one for production.
Fortunately, the Eclipse side of that is generally pretty painless,
and the 'android' command gives you a leg up on an ant script for the
production builds.

But as to your problem. If you have a 3rd party jar file which is
working fine, and it's set up the same way, then the way it's set up
isn't really the problem. You need to find out what the problem is.

NoClassDefFoundError does not mean what you think it means. Reading
the name, you'd think it means what ClassNotFoundException means.

No, what it means is that while LOADING a class, and probably while
actually running the static initializers of a class, an exception was
encountered. If that happens, you don't get a reference to the class,
and NoClassDefFoundError is thrown.

Unfortunately, you don't get told what the problem was. So you have to
use the debugger to figure it out. Set an exception breakpoint on
NoClassDefFoundError, and ones for Exception and Error, and run your
code. This should expose what the original problem was.

I can never understand why NoClassDefFoundError doesn't include the
original cause -- it really makes such problems a lot more obscure
than they need to be.

On Mar 13, 4:00 pm, Tom orei...@mbari.org wrote:
 I created the libs directory where you specified and copied the
 gdata .jar files in there, then from Eclipse ran Export project,
 then installed on the phone - but with the same result -
 NoClassDefFoundError for CalendarService.

 It seems that Eclipse is silently failing to handle the gdata jar
 files somehow - my project contains another 3rd party jar file which
 appears to work just fine.

 Something tells me that I have to stop relying on Eclipse and actually
 learn how to use the Android SDK command-line tools... I knew it
 wouldn't be this easy. ;-)

 Thanks for all of your help.

 On Mar 13, 3:24 pm, Mark Murphy mmur...@commonsware.com wrote:



  Tom wrote:
   This code compiles with no errors, using Eclipse on MacOS, using
   external jar files from the Google gdata project:
   gdata/java/lib/gdata-calendar-2.0.jar
   gdata/java/lib/gdata-calendar-meta-2.0.jar
   Did you copy these into your project's libs/ directory?

   No, I merely specified the path to the external jar in the Eclipse
   Java build path libraries dialog. This seemed to work for other
   projects I've developed. I look in my Eclipse project workspace and
   see assets, bin, gen, res, and src directories but no libs. Where
   should that directory appear?

  As a peer to assets/, bin/, gen/, res/, and src/.

  Now, it is conceivable that Eclipse handles things differently. I don't
  use Eclipse, and from the command line, just dropping the dependent JARs
  in libs/ is all you need. My recommendation to my students is that they
  put their dependent JARs in libs/ plus add them to the Eclipse build path.

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-13 Thread Kumar Bibek
It doesn't really matter if you create a lib folder and put the jars
and link them. It just works if you have added the jars the the build
path. Though I am not able to figure out why you are getting this
error.

 But I *highly* recommend not using Eclipse for your production builds,
 but rather have a build script that handles checkout, version
 numbering, naming the resulting builds, etc.

Well, as far as developing with Eclipse is concerned, I would say that
eclipse is the best and the only IDE available for Android. You can
also try Motodev Studio, but that's almost similar to eclipse.
Learning Android command line tools is great, but eclipse does make
your development and publishing task a lot easier.

Thanks and Regards,
Kumar Bibek

On Mar 14, 8:54 am, Bob Kerns r...@acm.org wrote:
 What I do is to create a libs/ directory in Eclipse, and add them to
 the Eclipse build path.  Android Tools/Export Signed Application
 Properties works fine.

 But I *highly* recommend not using Eclipse for your production builds,
 but rather have a build script that handles checkout, version
 numbering, naming the resulting builds, etc. A disciplined build
 process greatly reduces the possibility of confusion and mistakes
 making it into customer's hands.

 Unforutnately, the way Eclipse does things, that means two different
 build methodologies; one for debugging, one for production.
 Fortunately, the Eclipse side of that is generally pretty painless,
 and the 'android' command gives you a leg up on an ant script for the
 production builds.

 But as to your problem. If you have a 3rd party jar file which is
 working fine, and it's set up the same way, then the way it's set up
 isn't really the problem. You need to find out what the problem is.

 NoClassDefFoundError does not mean what you think it means. Reading
 the name, you'd think it means what ClassNotFoundException means.

 No, what it means is that while LOADING a class, and probably while
 actually running the static initializers of a class, an exception was
 encountered. If that happens, you don't get a reference to the class,
 and NoClassDefFoundError is thrown.

 Unfortunately, you don't get told what the problem was. So you have to
 use the debugger to figure it out. Set an exception breakpoint on
 NoClassDefFoundError, and ones for Exception and Error, and run your
 code. This should expose what the original problem was.

 I can never understand why NoClassDefFoundError doesn't include the
 original cause -- it really makes such problems a lot more obscure
 than they need to be.

 On Mar 13, 4:00 pm, Tom orei...@mbari.org wrote:

  I created the libs directory where you specified and copied the
  gdata .jar files in there, then from Eclipse ran Export project,
  then installed on the phone - but with the same result -
  NoClassDefFoundError for CalendarService.

  It seems that Eclipse is silently failing to handle the gdata jar
  files somehow - my project contains another 3rd party jar file which
  appears to work just fine.

  Something tells me that I have to stop relying on Eclipse and actually
  learn how to use the Android SDK command-line tools... I knew it
  wouldn't be this easy. ;-)

  Thanks for all of your help.

  On Mar 13, 3:24 pm, Mark Murphy mmur...@commonsware.com wrote:

   Tom wrote:
This code compiles with no errors, using Eclipse on MacOS, using
external jar files from the Google gdata project:
gdata/java/lib/gdata-calendar-2.0.jar
gdata/java/lib/gdata-calendar-meta-2.0.jar
Did you copy these into your project's libs/ directory?

No, I merely specified the path to the external jar in the Eclipse
Java build path libraries dialog. This seemed to work for other
projects I've developed. I look in my Eclipse project workspace and
see assets, bin, gen, res, and src directories but no libs. Where
should that directory appear?

   As a peer to assets/, bin/, gen/, res/, and src/.

   Now, it is conceivable that Eclipse handles things differently. I don't
   use Eclipse, and from the command line, just dropping the dependent JARs
   in libs/ is all you need. My recommendation to my students is that they
   put their dependent JARs in libs/ plus add them to the Eclipse build path.

   --
   Mark Murphy (a Commons 
   Guy)http://commonsware.com|http://twitter.com/commonsguy

   Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-13 Thread Bob Kerns
Yes. The reason I do copy them (and recommend copying them) to a lib/
directory is twofold:

1) It makes them an explicit part of your project for versioning. If
you use Subversion you can make these be a copy from a directory of
third-party components. You could copy the third-party directory for
tagging as well as your project, but this makes the dependency more
apparent.

2) It's compatible with how the ant build scripts are set up out-of-
the-box, so it makes it easier to transition to an ant-based
production build.

But as you note, Eclipse doesn't really care.

On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:
 It doesn't really matter if you create a lib folder and put the jars
 and link them. It just works if you have added the jars the the build
 path. Though I am not able to figure out why you are getting this
 error.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en