NoClassDefFoundError的:android.support.v4.content.LocalBroadcastManagersupport、android、NoClassDefFoun

2023-09-04 10:12:40 作者:你践踏不起劳资的心彡

我读了很多话题有关此错误:E / AndroidRuntime(16097):java.lang.NoClassDefFoundError的:android.support.v4.content.LocalBroadcastManager

我只是Facebook的SDK链接到我的项目,compil是好的,但有以下$ C $词得到了错误

这是我的Java构建路径: http://i.stack.imgur.com/GzqO5巴纽

  Session.openActiveSession(这一点,真,新Session.StatusCallback(){

      //回调时,会话状态变化
      @覆盖
      公共无效呼叫(会话的会话,SessionState会状态,例外的例外){
        如果(session.isOpened()){

          //使请求/ ME API
          Request.executeMeRequestAsync(会话,新Request.GraphUserCallback(){

            @覆盖
            公共无效onCompleted(GraphUser用户,响应响应){
                // TODO自动生成方法存根

            }

            //后与用户对象图形API响应回调
          });
        }
      }
    });
 

非常感谢。

解决方案

不要在构建路径添加jar文件请按照下列步骤

删除从Java构建路径中的所有jar文件并执行这些步骤

您应该试试这个:

从Java的删除在项目中的JAR的所有引用   

项目 - >属性 - > Java构建路径 - >库

创建一个库文件夹,如果你的项目的根不存在的JAR文件复制到libs文件夹。

Android Studio Service AIDL 详解

如果仍然无法运行正常。 右键点击您的项目>安卓工具>修复项目属性

清理项目并运行。它的工作

i read a lot of topic about this error : E/AndroidRuntime(16097): java.lang.NoClassDefFoundError: android.support.v4.content.LocalBroadcastManager

i just link facebook sdk to my project, compil is ok, but with the following code i got the error

here is my Java Build Path : http://i.stack.imgur.com/GzqO5.png

    Session.openActiveSession(this, true, new Session.StatusCallback() {

      // callback when session changes state
      @Override
      public void call(Session session, SessionState state, Exception exception) {
        if (session.isOpened()) {

          // make request to the /me API
          Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {

            @Override
            public void onCompleted(GraphUser user, Response response) {
                // TODO Auto-generated method stub

            }

            // callback after Graph API response with user object
          });
        }
      }
    });

thanks a lot.

解决方案

Don't add jar files in Build-path follow these steps

Remove all jar files from java build path and follow these steps

You should try this:

Remove all references to the JAR in your project from Java

project -> properties -> Java build path -> libraries

Create a libs folder if not exist at the root of your project Copy the JAR into the libs folder.

If still not running OK. Right click your project > Android Tools > Fix Project Properties

clean your project and run. it will work