0

enter image description here

My android app is crash when start run on phone or emulator. based on debug, it crash when code run "requestContext.registerListener(new AuthorizeListener() {"

I follow steps from "https://developer.amazon.com/docs/login-with-amazon/use-sdk-android.html" link and copy the sample app code ( java file, res files ) which include in Step 2.

could you please help me possible cause?

I installed login-with-amazon-sdk.jar library and add the API key. but my code does not have keystore file ( sample app has "debug.3p.keystore " file ).

manifest file

package="com.example.xxxx">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/btnlwa_gold_a"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name="com.amazon.identity.auth.device.workflow.WorkflowActivity"
        android:allowTaskReparenting="true"
        android:launchMode="singleTask"
        android:theme="@android:style/Theme.NoDisplay">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <!-- android:host must use the full package name found in Manifest General Attributes -->
            <data
                android:host="${applicationId}"
                android:scheme="amzn" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <service android:name="org.eclipse.paho.android.service.MqttService" />

    <activity android:name=".Main2Activity" />
    <activity android:name=".LoginWithAmazonActivity" />
      </application>

logcat:

 04-10 18:17:53.411 955-1082/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:53.411 955-1082/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:53.411 955-1082/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:53.411 955-1082/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:53.431 22942-22942/? E/Zygote: v2
    04-10 18:17:53.431 22942-22942/? E/SELinux: [DEBUG] get_category: variable seinfo: untrusted sensitivity: NULL, cateogry: NULL
    04-10 18:17:54.341 242-585/? E/Vold: Failed to find mounted volume for /storage/extSdCard/Android/data/com.google.android.music/files/
    04-10 18:17:54.361 242-585/? E/Vold: Failed to find mounted volume for /storage/extSdCard/Android/data/com.google.android.music/files/
    04-10 18:17:54.361 242-585/? E/Vold: Failed to find mounted volume for /storage/extSdCard/Android/data/com.google.android.music/files/
    04-10 18:17:54.471 955-1493/? E/PersonaManagerService: inState():  stateMachine is null !!
    04-10 18:17:54.481 955-1493/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:54.481 955-1493/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:54.481 955-1493/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:54.481 955-1493/? E/ActivityManager: checkUser: useridlist=null, currentuser=0
    04-10 18:17:54.491 22987-22987/? E/Zygote: v2
    04-10 18:17:54.491 22987-22987/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
    04-10 18:17:54.851 955-955/? E/EnterpriseSharedDevicePolicy: isSharedDeviceEnabled
    04-10 18:17:59.321 955-1264/? E/Watchdog: !@Sync 3309 [04-10 18:17:59.332]
    04-10 18:17:59.571 22942-23038/? E/GmsUtils: Failed to connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
    04-10 18:17:59.661 22942-23040/? E/GmsUtils: Failed to connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
    04-10 18:18:29.321 955-1264/? E/Watchdog: !@Sync 3310 [04-10 18:18:29.333]
    04-10 18:18:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:18:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:18:36.741 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:18:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:18:36.741 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:18:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:18:59.331 955-1264/? E/Watchdog: !@Sync 3311 [04-10 18:18:59.334]
    04-10 18:19:29.331 955-1264/? E/Watchdog: !@Sync 3312 [04-10 18:19:29.334]
    04-10 18:19:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:19:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:19:36.741 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:19:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:19:36.741 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:19:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:19:59.321 955-1264/? E/Watchdog: !@Sync 3313 [04-10 18:19:59.335]
    04-10 18:20:29.321 955-1264/? E/Watchdog: !@Sync 3314 [04-10 18:20:29.336]
    04-10 18:20:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:20:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:20:36.741 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:20:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:20:36.741 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:20:36.741 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:20:59.321 955-1264/? E/Watchdog: !@Sync 3315 [04-10 18:20:59.336]
    04-10 18:21:29.331 955-1264/? E/Watchdog: !@Sync 3316 [04-10 18:21:29.337]
    04-10 18:21:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:21:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:21:36.751 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:21:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:21:36.751 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:21:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:21:59.331 955-1264/? E/Watchdog: !@Sync 3317 [04-10 18:21:59.338]
    04-10 18:22:29.331 955-1264/? E/Watchdog: !@Sync 3318 [04-10 18:22:29.338]
    04-10 18:22:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:22:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:22:36.751 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:22:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:22:36.751 955-1811/? E/SAMP_SPCMtest: setPackageLockingTimeBySPCM() :-1
    04-10 18:22:36.751 955-1811/? E/ActivityThread: Failed to find provider info for com.samsung.android.sm
    04-10 18:22:59.331 955-1264/? E/Watchdog: !@Sync 3319 [04-10 18:22:59.339]

new logcat during crash:

04-10 19:08:25.621 27643-27643/com.example.ayezarnwe.awstesting D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
04-10 19:08:25.721 27643-27643/com.example.ayezarnwe.awstesting I/Timeline: Timeline: Activity_launch_request id:com.example.ayezarnwe.awstesting time:102324314
04-10 19:08:25.741 27643-27643/com.example.ayezarnwe.awstesting W/ResourcesManager: getTopLevelResources: null for user  0
04-10 19:08:25.751 27643-27643/com.example.ayezarnwe.awstesting D/PhoneWindow: *FMB* installDecor mIsFloating : false
04-10 19:08:25.751 27643-27643/com.example.ayezarnwe.awstesting D/PhoneWindow: *FMB* installDecor flags : -2139029248
04-10 19:08:25.781 27643-27643/com.example.ayezarnwe.awstesting V/PersistentOfflineMutationManager: Thread:[1]:In Constructor
04-10 19:08:25.781 27643-27643/com.example.ayezarnwe.awstesting V/PersistentOfflineMutationManager: Thread:[1]:Priming the pump - Fetching all the queued mutations from the persistent store
04-10 19:08:25.781 27643-27643/com.example.ayezarnwe.awstesting V/PersistentOfflineMutationManager: Thread:[1]: Fetching all mutation requests from persistent store
04-10 19:08:25.781 27643-27643/com.example.ayezarnwe.awstesting V/PersistentOfflineMutationManager: Thread:[1]:Exiting the constructor. There are [0] mutations in the persistent queue
04-10 19:08:25.781 27643-27643/com.example.ayezarnwe.awstesting V/AppSyncComplexObjectsInterceptor: Thread:[1]: Instantiating Complex Objects Interceptor
04-10 19:08:25.791 27643-27643/com.example.ayezarnwe.awstesting D/DisplayManager: DisplayManager()
04-10 19:08:25.801 27643-27643/com.example.ayezarnwe.awstesting D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
04-10 19:08:25.801 27643-27643/com.example.ayezarnwe.awstesting D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
04-10 19:08:25.821 27643-27679/com.example.ayezarnwe.awstesting D/AppSyncOfflineMutationManager: Thread:[34973]: Internet CONNECTED.
04-10 19:08:25.821 27643-27680/com.example.ayezarnwe.awstesting V/QueueUpdateHandler: Thread:[34974]: Got message to take action on the mutation queue.
04-10 19:08:25.821 27643-27680/com.example.ayezarnwe.awstesting V/QueueUpdateHandler: Thread:[34974]: Got message to process next mutation if one exists.
04-10 19:08:25.821 27643-27680/com.example.ayezarnwe.awstesting V/AppSyncOfflineMutationManager: Thread:[34974]:Persistent mutations queue is EMPTY!. Will check inMemory Queue next
04-10 19:08:25.821 27643-27680/com.example.ayezarnwe.awstesting V/AppSyncOfflineMutationManager: Thread:[34974]: In Memory mutations queue was EMPTY!. Nothing to process, exiting
04-10 19:08:25.861 27643-27662/com.example.ayezarnwe.awstesting D/OpenGLRenderer: endAllStagingAnimators on 0xb7f5b538 (RippleDrawable) with handle 0xb7f886d0
04-10 19:08:25.871 27643-27643/com.example.ayezarnwe.awstesting I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@c64afdf time:102324469
04-10 19:08:26.741 27643-27643/com.example.ayezarnwe.awstesting D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
04-10 19:08:26.831 27643-27643/com.example.ayezarnwe.awstesting I/Timeline: Timeline: Activity_launch_request id:com.example.ayezarnwe.awstesting time:102325422
04-10 19:08:26.841 27643-27685/com.example.ayezarnwe.awstesting D/RetryInterceptor: Retry Interceptor called
04-10 19:08:26.841 27643-27685/com.example.ayezarnwe.awstesting D/AppSyncSigV4SignerInterceptor: Signer Interceptor called
04-10 19:08:26.851 27643-27685/com.example.ayezarnwe.awstesting D/AppSyncSigV4SignerInterceptor: Subscriber ID is e71a39f4-7a0e-42fa-991d-e4e74988195b
04-10 19:08:26.851 27643-27643/com.example.ayezarnwe.awstesting W/ResourcesManager: getTopLevelResources: null for user  0
04-10 19:08:26.861 27643-27643/com.example.ayezarnwe.awstesting D/com.amazon.identity.auth.map.device.utils.MAPLog.PII: Extracting verison incremental:<obscured>
04-10 19:08:26.861 27643-27643/com.example.ayezarnwe.awstesting D/com.amazon.identity.auth.map.device.utils.MAPLog.PII: Incremental version '%s' was in invalid format.:<obscured>
04-10 19:08:26.861 27643-27643/com.example.ayezarnwe.awstesting D/com.amazon.identity.auth.device.api.workflow.RequestContext.PII: Created RequestContext b5aedfa2-dd65-4141-8074-3e7c0dfccfe4:<obscured>
04-10 19:08:26.861 27643-27643/com.example.ayezarnwe.awstesting D/com.amazon.identity.auth.device.api.workflow.RequestContext.PII: RequestContext b5aedfa2-dd65-4141-8074-3e7c0dfccfe4: registerListener for of request type com.amazon.identity.auth.device.authorization.request.authorize:<obscured>
04-10 19:08:26.871 27643-27682/com.example.ayezarnwe.awstesting I/Results: [Item{__typename=Todo, id=kk, name=ii, description=pp}, Item{__typename=Todo, id=gg, name=kk, description=pp}, Item{__typename=Todo, id=ppp, name=nn, description=jjj}, Item{__typename=Todo, id=ff, name=uu, description=pp}, Item{__typename=Todo, id=ayezar, name=gatewat infinity, description=heater confort}]
04-10 19:08:26.871 27643-27643/com.example.ayezarnwe.awstesting D/PhoneWindow: *FMB* installDecor mIsFloating : false
04-10 19:08:26.871 27643-27643/com.example.ayezarnwe.awstesting D/PhoneWindow: *FMB* installDecor flags : -2139029248
04-10 19:08:26.891 27643-27643/com.example.ayezarnwe.awstesting D/AndroidRuntime: Shutting down VM
04-10 19:08:26.891 27643-27643/com.example.ayezarnwe.awstesting E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.ayezarnwe.awstesting, PID: 27643
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ayezarnwe.awstesting/com.example.ayezarnwe.awstesting.LoginWithAmazonActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2697)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2771)
        at android.app.ActivityThread.access$900(ActivityThread.java:177)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1432)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5912)
        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:1405)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
        at com.example.ayezarnwe.awstesting.LoginWithAmazonActivity.initializeUI(LoginWithAmazonActivity.java:176)
        at com.example.ayezarnwe.awstesting.LoginWithAmazonActivity.onCreate(LoginWithAmazonActivity.java:85)
        at android.app.Activity.performCreate(Activity.java:6178)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2650)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2771) 
        at android.app.ActivityThread.access$900(ActivityThread.java:177) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1432) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5912) 
        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:1405) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200) 
04-10 19:08:27.181 27643-27685/com.example.ayezarnwe.awstesting I/RetryInterceptor: Returning network response: success
04-10 19:08:27.191 27643-27685/com.example.ayezarnwe.awstesting I/Results: [Item{__typename=Todo, id=kk, name=ii, description=pp}, Item{__typename=Todo, id=gg, name=kk, description=pp}, Item{__typename=Todo, id=ppp, name=nn, description=jjj}, Item{__typename=Todo, id=ff, name=uu, description=pp}, Item{__typename=Todo, id=ayezar, name=gatewat infinity, description=heater confort}]
04-10 19:08:29.061 27643-27661/com.example.ayezarnwe.awstesting V/AppSyncOfflineMutationInterceptor: Thread:[34964]: processing Mutations
04-10 19:08:29.061 27643-27661/com.example.ayezarnwe.awstesting V/QueueUpdateHandler: Thread:[34964]: Got message to take action on the mutation queue.
04-10 19:08:29.061 27643-27661/com.example.ayezarnwe.awstesting V/QueueUpdateHandler: Thread:[34964]: Got message to process next mutation if one exists.
04-10 19:08:29.061 27643-27661/com.example.ayezarnwe.awstesting V/AppSyncOfflineMutationManager: Thread:[34964]:Persistent mutations queue is EMPTY!. Will check inMemory Queue next
04-10 19:08:29.061 27643-27661/com.example.ayezarnwe.awstesting V/AppSyncOfflineMutationManager: Thread:[34964]: In Memory mutations queue was EMPTY!. Nothing to process, exiting

extract:

 mLoginButton = findViewById(R.id.login_with_amazon);
        mLoginButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                AuthorizationManager.authorize(
                        new AuthorizeRequest.Builder(requestContext)
                                .addScopes(ProfileScope.profile(), ProfileScope.postalCode())

invalid API Logcat druing app crash:

04-10 20:41:15.121 12587-12587/? E/Zygote: v2
04-10 20:41:15.131 12587-12587/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
04-10 20:41:17.611 12587-12587/com.example.ayezarnwe.awstesting E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.ayezarnwe.awstesting, PID: 12587
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ayezarnwe.awstesting/com.example.ayezarnwe.awstesting.LoginWithAmazonActivity}: java.lang.IllegalArgumentException: Invalid API Key
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2697)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2771)
        at android.app.ActivityThread.access$900(ActivityThread.java:177)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1432)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5912)
        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:1405)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
     Caused by: java.lang.IllegalArgumentException: Invalid API Key
        at com.amazon.identity.auth.device.authorization.InternalAuthManager.<init>(InternalAuthManager.java:58)
        at com.amazon.identity.auth.device.authorization.InternalAuthManager.getInstance(InternalAuthManager.java:47)
        at com.amazon.identity.auth.device.api.authorization.AuthorizationManager.getToken(AuthorizationManager.java:242)
        at com.example.ayezarnwe.awstesting.LoginWithAmazonActivity.onStart(LoginWithAmazonActivity.java:98)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
        at android.app.Activity.performStart(Activity.java:6213)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2660)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2771) 
        at android.app.ActivityThread.access$900(ActivityThread.java:177) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1432) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5912) 
        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:1405) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)

 

Usman Maqbool
  • 3,273
  • 10
  • 31
  • 45
daio
  • 11
  • 4
  • Please post your logcat as well – Nikos Hidalgo Apr 10 '19 at 10:07
  • i would like to share Error log cat. please refer to below. – daio Apr 10 '19 at 10:20
  • i edit my original post and add the logcat there as file size big.. thank you very much – daio Apr 10 '19 at 10:25
  • hello, i notice errors in my app's logcat are almost same as error logcat if run Sample app. but sample app is not crash upon launch. – daio Apr 10 '19 at 10:44
  • The logcat you posted doesn't include the crash of your app. Please make sure that on the logcat view the correct emulator is used and your app's package chosen. At the right end of the view you can find a filter drop-down menu that includes the option to show only your application related messages. Check this link for image https://developer.android.com/studio/debug#systemLogView – Nikos Hidalgo Apr 10 '19 at 10:47
  • hello noted thank you very much. i added the NG logcat during crash time. please refer to the above " new logcat during crash" information. – daio Apr 10 '19 at 11:10
  • in your LoginWithAmazonActivity, you're setting a clickListener on a null object hence the crash. Add breakpoint and evaluate the null object, then initialise/bind it appropriately. – Nikos Hidalgo Apr 10 '19 at 11:17
  • Possible duplicate of [What is a NullPointerException, and how do I fix it?](https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Nikos Hidalgo Apr 10 '19 at 11:23
  • noted sir. i saw mLoginButton= Null in my app but in sample app show as below. mLoginButton = android.widget.ImageButton{117b19fb VFED..C. ......I. 0,0-0,0 #7f07004c app:id/login_with_amazon} – daio Apr 10 '19 at 11:40
  • in the sample app they're binding the button mLoginButton = findViewById(R.id.login_with_amazon); and have the appropriate button on the activity_main.xml layout file. Are you binding that button correctly? make sure the name matches. – Nikos Hidalgo Apr 10 '19 at 11:52
  • hello sir, thank you very much for the reply. i copy past the whole "activity_main.xml" file from sample app and become ok ( not show Null when debug ). but still app crash. this time message show "invalid API"... i have attached the logcat message during app crash. – daio Apr 10 '19 at 12:43
  • hello sir, i haven't done "New App submission" step (below steps ). do i need to do these steps even my app is test app ( will not publish to google play store ) ? steps: Add a Registered AppStore or Developer Console app to your Security Profile If you have already registered your apps at https://developer.amazon.com/myapps.html, you can add them to your security profile to enable them for Login with Amazon. – daio Apr 10 '19 at 12:49
  • there are a few similar threads here. Have a look at this: https://stackoverflow.com/questions/47222641/login-with-amazon-not-working-after-publish-in-googleplay-store-it-working-in?noredirect=1&lq=1 – Nikos Hidalgo Apr 10 '19 at 13:40
  • Thank you very much sir. I will try tomorrow and inform. – daio Apr 10 '19 at 16:32
  • hello Nikos, today i am able to run my app.. no more API invalid error. Cause is i did not place the "api_key.txt" file in Android view. i put under Project view. after put correct place and after re-create api key again, app is not crash anymore. thank you very much. – daio Apr 11 '19 at 05:16
  • I'm glad you managed to work it out! – Nikos Hidalgo Apr 11 '19 at 07:40
  • :D thank you so much sir. – daio Apr 12 '19 at 07:31

0 Answers0