我正在使用linkedin-j-android.jar
. 它在三星 Galaxy y 等 android 2.3 设备中正常运行,但是当我尝试在 android 4.0 或更高版本中运行它时,它崩溃并给出以下异常:
My LOGCAT :
09-03 16:38:24.880: E/AndroidRuntime(1169): FATAL EXCEPTION: main
09-03 16:38:24.880: E/AndroidRuntime(1169): com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceException: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: null
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:180)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.mukesh.linkedin.LinkedinDialog.setWebView(LinkedinDialog.java:69)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.mukesh.linkedin.LinkedinDialog.onCreate(LinkedinDialog.java:55)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.app.Dialog.dispatchOnCreate(Dialog.java:355)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.app.Dialog.show(Dialog.java:260)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.mukesh.linkedin.LinkedInSampleActivity.linkedInLogin(LinkedInSampleActivity.java:92)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.mukesh.linkedin.LinkedInSampleActivity.access$0(LinkedInSampleActivity.java:86)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.mukesh.linkedin.LinkedInSampleActivity$1.onClick(LinkedInSampleActivity.java:61)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.view.View.performClick(View.java:4202)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.view.View$PerformClick.run(View.java:17340)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.os.Handler.handleCallback(Handler.java:725)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.os.Handler.dispatchMessage(Handler.java:92)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.os.Looper.loop(Looper.java:137)
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.app.ActivityThread.main(ActivityThread.java:5039)
09-03 16:38:24.880: E/AndroidRuntime(1169): at java.lang.reflect.Method.invokeNative(Native Method)
09-03 16:38:24.880: E/AndroidRuntime(1169): at java.lang.reflect.Method.invoke(Method.java:511)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
09-03 16:38:24.880: E/AndroidRuntime(1169): at dalvik.system.NativeStart.main(Native Method)
09-03 16:38:24.880: E/AndroidRuntime(1169): Caused by: oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: null
09-03 16:38:24.880: E/AndroidRuntime(1169): at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:214)
09-03 16:38:24.880: E/AndroidRuntime(1169): at oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.java:69)
09-03 16:38:24.880: E/AndroidRuntime(1169): at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceImpl.getOAuthRequestToken(LinkedInOAuthServiceImpl.java:172)
09-03 16:38:24.880: E/AndroidRuntime(1169): ... 18 more
09-03 16:38:24.880: E/AndroidRuntime(1169): Caused by: android.os.NetworkOnMainThreadException
09-03 16:38:24.880: E/AndroidRuntime(1169): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
09-03 16:38:24.880: E/AndroidRuntime(1169): at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
09-03 16:38:24.880: E/AndroidRuntime(1169): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
09-03 16:38:24.880: E/AndroidRuntime(1169): at java.net.InetAddress.getAllByName(InetAddress.java:214)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:70)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:461)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:433)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81)
09-03 16:38:24.880: E/AndroidRuntime(1169): at libcore.net.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:165)
09-03 16:38:24.880: E/AndroidRuntime(1169): at oauth.signpost.basic.DefaultOAuthProvider.sendRequest(DefaultOAuthProvider.java:48)
09-03 16:38:24.880: E/AndroidRuntime(1169): at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:177)
09-03 16:38:24.880: E/AndroidRuntime(1169): ... 20 more
请有人告诉我他们是否面临这样的问题。请帮我。