0

Android 2.3.3 이전 버전의 Android 위젯 런타임 중에 문제가 있습니다. 내가 화면에 내 위젯을 설치하면런타임 Android 위젯

,이 오류가 인쇄되어 있습니다 :

11-03 10:26:31.127: E/AndroidRuntime(404): FATAL EXCEPTION: main 
11-03 10:26:31.127: E/AndroidRuntime(404): java.lang.NoClassDefFoundError: com.app.myapp.StackWidgetService 
11-03 10:26:31.127: E/AndroidRuntime(404): at com.app.myapp.StackWidgetProvider.onUpdate(StackWidgetProvider.java:229) 
11-03 10:26:31.127: E/AndroidRuntime(404): at android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java:61) 
11-03 10:26:31.127: E/AndroidRuntime(404): at com.app.mobideals.StackWidgetProvider.onReceive(StackWidgetProvider.java:216) 
11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1794) 
11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread.access$2400(ActivityThread.java:117) 
11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:981) 
11-03 10:26:31.127: E/AndroidRuntime(404): at android.os.Handler.dispatchMessage(Handler.java:99) 
11-03 10:26:31.127: E/AndroidRuntime(404): at android.os.Looper.loop(Looper.java:123) 
11-03 10:26:31.127: E/AndroidRuntime(404): at android.app.ActivityThread.main(ActivityThread.java:3683) 
11-03 10:26:31.127: E/AndroidRuntime(404): at java.lang.reflect.Method.invokeNative(Native Method) 
11-03 10:26:31.127: E/AndroidRuntime(404): at java.lang.reflect.Method.invoke(Method.java:507) 
11-03 10:26:31.127: E/AndroidRuntime(404): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
11-03 10:26:31.127: E/AndroidRuntime(404): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
11-03 10:26:31.127: E/AndroidRuntime(404): at dalvik.system.NativeStart.main(Native Method) 

문제는 compilator이 줄에서 StackWidgetService 클래스에 대한 링크를 수행하기 위해 도착하지 않는 때문이다

public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { 

     // update each of the widgets with the remote adapter 
     for (int i = 0; i < appWidgetIds.length; ++i) { 

      // Here we setup the intent which points to the StackViewService which will 
      // provide the views for this collection. 
      Intent intent = new Intent(context, StackWidgetService.class); 
      intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[i]); 

위젯은

도와주세요 ... 3.0, 4.0 등과 같은 안드로이드의 다른 버전과 함께 사용하기에 적합합니다 : StackWidgetProvider 클래스의 onUpdate 방법 나 :

+0

당신이 매니페스트에서 서비스를 선언 한 적이 있습니까? – GVillani82

+0

나는 똑같은 문제가있다. 이 문제가 해결 되었습니까? 이 문제를 해결하는 데 나를 도와주세요. – chaitu2408

답변

0

당신은 ADT 17 이클립스 플러그인 업데이트가 어쩌면 솔루션이 여기 경우 : Android java.lang.NoClassDefFoundError

은 여기를보세요 : http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17

+0

답장을 보내 주셔서 감사합니다. 이 오류가 아닌 것 같습니다. 사실,이 문제는 메소드에 관한 것입니다 : \t \t'appWidgetManager.notifyAppWidgetViewDataChanged (i, R.id.stack_view);'이 메소드는 내 매니 페스트에 지정된 최소 목표 sdk 10에서는 사용할 수 없습니다.' 안드로이드 2.3.3 (대상 10)을 다루고 싶기 때문에 나는 전에 min target = 11이었습니다. 어떻게하면이 방법을 대체 할 수 있습니까 (notifyAppWidgetViewDataChanged 또는이 코드를 target = 11과 함께 사용하기위한 조건을 도입 하시겠습니까? – pxrb66