注册

登录时,程序崩溃,但app服务器端可以返回数据,Logcat中提示错误信息如下

Logcat显示一下内容:内容1
 08-04 06:47:14.175: E/AndroidRuntime(1078): java.lang.RuntimeException: SDK is not initialized!
08-04 06:47:14.175: E/AndroidRuntime(1078):     at com.easemob.chat.EMChatManager.login(Unknown Source)
08-04 06:47:14.175: E/AndroidRuntime(1078):     at cn.tedu.weixinim.activity.LoginActivity.login(LoginActivity.java:157)
08-04 06:47:14.175: E/AndroidRuntime(1078):     at cn.tedu.weixinim.activity.LoginActivity.access$5(LoginActivity.java:152)
08-04 06:47:14.175: E/AndroidRuntime(1078):     at cn.tedu.weixinim.activity.LoginActivity$1$1.onDataCallBack(LoginActivity.java:79)
08-04 06:47:14.175: E/AndroidRuntime(1078):     at cn.tedu.weixinim.util.LoadDataFromServer$1.handleMessage(LoadDataFromServer.java:88)
同时后台答应了登录app服务器返回的数据
08-04 06:47:13.996: I/System.out(1078): 返回的数据是------->>>>>>>> {"code":"1","user":{"hxid":"11223349","fxid":"huangfangyi","avatar":"1113092131749.png","nick":"田满意","sex":"1","region":"0","sign":"0","time":"2016-08-04 17:44:15","tel":"123456","password":"123456","acount":"0.00","paypw":"","money":"79.68"}}
 
我在环信官网申请了一个appkey,重新运行后还是报以上错误,清单文件内容如下:
 

    package="cn.tedu.weixinim"
    android:versionCode="1"
    android:versionName="1.0" >

            android:minSdkVersion="14"
        android:targetSdkVersion="21" />

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

   
   

   

            android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

       

                    android:name="cn.tedu.weixinim.activity.SplashActivity"
            android:screenOrientation="portrait"
            android:theme="@style/horizontal_slide" >
       

       
                    android:name="cn.tedu.weixinim.activity.LoginActivity"
            android:screenOrientation="portrait"
            android:theme="@style/horizontal_slide" >
           
               

               
           

       

       
                    android:name="cn.tedu.weixinim.activity.MainActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/horizontal_slide"
            android:windowSoftInputMode="adjustPan" >
       

       
       
           
               
               

               
           

       


       
                    android:name="EASEMOB_APPKEY"
            android:value="tedu20160713#weixin2016" />
       
       

       
                    android:name="com.baidu.location.f"
            android:enabled="true"
            android:process=":remote" />
       
                    android:name="UMENG_APPKEY"
            android:value="53912a3156240b01a7075ed1" >
       
                    android:name="com.baidu.lbsapi.API_KEY"
            android:value="3ecea51f560650b1ed8a4b99808f52e8" />

       
                    android:name="cn.tedu.weixinim.activity.VoiceCallActivity"
            android:screenOrientation="portrait"
            android:theme="@style/nornal_style" >
       
   


 
已邀请:
我确定已经在代码中初始化了环信SDK ,一些类都是Demo中复制过来的
DemoHXSDKHelper   DefaultHXSDKModel  DemoHXSDKModel  HXSDKModel  DemoApplication
这个还是跟这个环信的demo的初始化有关系的 ,建议您这边下载个开源的demo,然后按照这个自定义的application中的初始化的代码走下 ,还是跟初始化 没有成功有关系的,嗯 可以debug下两边的初始化执行的过程,看看具体代码逻辑了。
你好,我用的是凡信2.0代码中的部分内容,DemoHXSDKHelper   DefaultHXSDKModel  DemoHXSDKModel  HXSDKModel  DemoApplication是直接从代码中复制过来的
没有在清单列表中注册初始化的application
谢谢啊,还真是没有

要回复问题请先登录注册