chendongMarch / SocialSdkLibrary

提供微博、微信、QQ、Tim、QQ 轻聊版、钉钉的登陆分享功能支持;
http://zfyx.coding.me/article/3067853428/
Apache License 2.0
424 stars 72 forks source link

QQ 登录的时候报的错误,导致黑屏一下 #14

Closed Gaoyongxian666 closed 5 years ago

Gaoyongxian666 commented 5 years ago

E/openSDK_LOG.APNUtil: getApn has exception: No permission to write APN settings E/openSDK_LOG.Util: getPackageInfo has exception: com.qzone I/openSDK_LOG.Tencent: handleResultData() data = null ? false, listener = null ? false I/openSDK_LOG.UIListenerManager: handleDataToListener E/SocialSdk|QQLoginHelper: 获取到 qq token = BaseAccessToken{openid='A2B25C8427B8F2B5E906777F9C154CB4', unionid='null', access_token='34D624E44BE7F068BB74DC88399DBFF1', expires_in=7776000} D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.bcz.wlw, PID: 18065 java.lang.BootstrapMethodError: Exception from call site #3 bootstrap method at com.zfy.social.core.model.token.AccessToken.saveToken(AccessToken.java:117) at com.zfy.social.qq.QQLoginHelper$LoginUiListener.onComplete(QQLoginHelper.java:96) at com.tencent.connect.common.UIListenerManager.handleDataToListener(ProGuard:128) at com.tencent.tauth.Tencent.handleResultData(ProGuard:463) at com.zfy.social.qq.QQLoginHelper.handleResultData(QQLoginHelper.java:60) at com.zfy.social.qq.QQPlatform.onActivityResult(QQPlatform.java:135) at com.zfy.social.core.uikit.BaseActionActivity.onActivityResult(BaseActionActivity.java:75) at android.app.Activity.dispatchActivityResult(Activity.java:7528) at android.app.ActivityThread.deliverResults(ActivityThread.java:4412) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4461) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6806) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) Caused by: java.lang.ClassCastException: Bootstrap method returned null at com.zfy.social.core.model.token.AccessToken.saveToken(AccessToken.java:117)  at com.zfy.social.qq.QQLoginHelper$LoginUiListener.onComplete(QQLoginHelper.java:96)  at com.tencent.connect.common.UIListenerManager.handleDataToListener(ProGuard:128)  at com.tencent.tauth.Tencent.handleResultData(ProGuard:463)  at com.zfy.social.qq.QQLoginHelper.handleResultData(QQLoginHelper.java:60)  at com.zfy.social.qq.QQPlatform.onActivityResult(QQPlatform.java:135)  at com.zfy.social.core.uikit.BaseActionActivity.onActivityResult(BaseActionActivity.java:75)  at android.app.Activity.dispatchActivityResult(Activity.java:7528)  at android.app.ActivityThread.deliverResults(ActivityThread.java:4412)  at android.app.ActivityThread.handleSendResult(ActivityThread.java:4461)  at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:201)  at android.app.ActivityThread.main(ActivityThread.java:6806)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 

chendongMarch commented 5 years ago

看起来应该是配置的问题,报错的地方是个 lambda 表达式,考虑是 配置支持 JDK8 等问题导致的

你有配置

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

吗?

参照一个类似的问题,https://github.com/NordicSemiconductor/Android-BLE-Library/issues/38

Gaoyongxian666 commented 5 years ago

OK,谢啦,成功解决