line / line-sdk-starter-android-v2

A starter application that demonstrates how to use LINE SDK V2 for Android.
MIT License
35 stars 27 forks source link

Calling LineLoginApi.getLoginIntent getting ActivityNotFoundException #4

Open JustinLim0318 opened 7 years ago

JustinLim0318 commented 7 years ago

SDK Version: 4.0.2 Device Model: Samsung S4 Here is stack trace: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://access.line.me/dialog/oauth/weblogin?response_type=code&client_id=1509810234&state=sn1XUQ99mS0&otpId=7O3NQAgKclnwKUl+ej6/gT8KUd0=&redirect_uri=intent://result#Intent;package=com.gobike.consumer.stg;scheme=lineauth;end pkg=jp.naver.line.android } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1801) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1499) at android.app.Activity.startActivityForResult(Activity.java:3942) at android.support.v4.app.ActivityCompatJB.startActivityForResult(ActivityCompatJB.java:26) at android.support.v4.app.ActivityCompat.startActivityForResult(ActivityCompat.java:146) at com.linecorp.linesdk.auth.internal.c$c.onPostExecute(SourceFile:1120) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

Anyone has idea?

mrmaakun commented 7 years ago

Hi @JustinLim0318

Can you try using the latest version of the LINE SDK (4.0.2)? Some fixes were made to resolve some issues with Android 4.x.

Also, were you able to reproduce this in this starter as it is? I tested the starter on a Galaxy S4 and I didn't see this problem.

JustinLim0318 commented 7 years ago

Hi @mrmaakun

Thanks for the response. Yes im using SDK(4.0.2) the issue has been solved. There is another issue with the latest sdk. After logged in using LINE account, it does not redirect back to the app. I have to manually close the LINE app and redirect back to my app and the response status i get from onActivityResult is 'CANCEL'. Tested using the starter and having the same issue.

mrmaakun commented 7 years ago

@JustinLim0318

We made another update to the SDK that may help resolve this issue. Can you try LINE SDK 4.0.4 to see if it resolves this problem?

zack-barakat commented 7 years ago

Hi @mrmaakun We have updated the SDK to the latest release 4.0.4 and we encountered another issue while starting activity for result with the login intent.

here is the code:

Intent loginIntent = LineLoginApi.getLoginIntent(view.getContext(), getContext().getResources().getString(R.string.line_channel_id)); startActivityForResult(loginIntent, LINE_REQUEST_CODE);

and here is the stack trace:

FATAL EXCEPTION: main Process: com.gobike.consumer.debug, PID: 1527 java.lang.NoSuchMethodError: No static method startActivity(Landroid/app/Activity;Landroid/content/Intent;Landroid/os/Bundle;)V in class Landroid/support/v4/app/ActivityCompat; or its super classes (declaration of 'android.support.v4.app.ActivityCompat' appears in /data/app/com.gobike.consumer.debug-2/split_lib_dependencies_apk.apk:classes56.dex) at com.linecorp.linesdk.auth.internal.c$c.onPostExecute(SourceFile:1125) at android.os.AsyncTask.finish(AsyncTask.java:651) at android.os.AsyncTask.access$500(AsyncTask.java:180) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:168) at android.app.ActivityThread.main(ActivityThread.java:5845) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)

XAVlER-S commented 7 years ago

+1

XAVlER-S commented 7 years ago

@mrmaakun Hi, mrmaakun, this problem is caused by Google changing ActivityCompat's API. ActivityCompat#startActivity is removed in the latest version. Will you please upgrade appcompat lib of line sdk and sample to fix this problem? thx :)

zack-barakat commented 7 years ago

Hi @XavierSAndroid , Thank you for the reply. I upgraded to the appcompat latest version com.android.support:appcompat-v7:25.3.0, and I still have the same issue. Is it updated already in the latest version of the line sdk?. Thank you

XAVlER-S commented 7 years ago

@zack-barakat my bad. I should have given this information to developers of this lib : )

cchitsiang commented 7 years ago

Any expected date for new update?

mrmaakun commented 7 years ago

Thanks for bringing this issue up. We will look into it and try to have something in the next week or so.

mrmaakun commented 7 years ago

I apologize for the wait. We released LINE SDK for Android version 4.0.5 to the developer center. This version should fix the startActivity problem. Please check it out.

zack-barakat commented 7 years ago

@mrmaakun Thank you for your response. will try out the latest SDK and let you know if it has been solved.