0

我得到了这个例外:

java.lang.NoClassDefFoundError: com.actionbarsherlock.R$styleable
        at com.actionbarsherlock.view.MenuInflater$MenuState.readItem(MenuInflater.java:343)
        at com.actionbarsherlock.view.MenuInflater.parseMenu(MenuInflater.java:162)
        at com.actionbarsherlock.view.MenuInflater.inflate(MenuInflater.java:112)
        at com.geek.MainActivity.onCreateOptionsMenu(MainActivity.java:119)
        at com.actionbarsherlock.app.SherlockActivity.onCreatePanelMenu(SherlockActivity.java:184)
        at com.actionbarsherlock.ActionBarSherlock.callbackCreateOptionsMenu(ActionBarSherlock.java:559)
        at com.actionbarsherlock.internal.ActionBarSherlockNative.dispatchCreateOptionsMenu(ActionBarSherlockNative.java:65)
        at com.actionbarsherlock.app.SherlockActivity.onCreateOptionsMenu(SherlockActivity.java:149)
        at android.app.Activity.onCreatePanelMenu(Activity.java:2444)
        at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:388)
        at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:739)
        at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:2833)
        at android.os.Handler.handleCallback(Handler.java:605)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4424)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
        at dalvik.system.NativeStart.main(Native Method)

它指向这个方法的第一行代码:

  @Override
  public boolean onCreateOptionsMenu(Menu menu) 
  {
      // Inflate your menu.     
      getSupportMenuInflater().inflate(R.menu.share_action_provider, menu);

      // Set file with share history to the provider and set the share intent.
      MenuItem actionItem = menu.findItem(R.id.menu_item_share_action_provider_action_bar);
      ShareActionProvider actionProvider = (ShareActionProvider) actionItem.getActionProvider();        

      //actionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
      // Note that you can set/change the intent any time,
      // say when the user has selected an image.
      actionProvider.setShareIntent(createShareIntent());

      return true;
  }    

关于为什么会发生这种情况以及如何解决它的任何想法?谢谢,亚历克斯

4

0 回答 0