sumup / sumup-android-sdk

Sample App for the SumUp Android SDK
Other
100 stars 29 forks source link

I can't login. It gives me a NullPointerException. #171

Open videodvd opened 2 years ago

videodvd commented 2 years ago

I have 2 repositories, this one and another one able to make a connection to MySQL databases. Separately, both work like a charm, but as you may guess, I want to create an app that uses both functions: Calling some products info from the DB, and then charging the amount of money via the card reader thought the SumUp SDK. So I move the Java classes and Gradle dependencies from this repository to the MySQL one. But at the moment to make a login, the app crashes. 2021-12-28 14:24:52.784 26341-26341/com.example.holis E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.holis, PID: 26341 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.holis/com.sumup.merchant.reader.identitylib.ui.activities.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.sumup.merchant.reader.ReaderModuleCoreState.inject(java.lang.Object)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3455) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3598) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2164) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:241) at android.app.ActivityThread.main(ActivityThread.java:7582) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.sumup.merchant.reader.ReaderModuleCoreState.inject(java.lang.Object)' on a null object reference at com.sumup.merchant.reader.identitylib.ui.activities.LoginActivity.onCreate(SourceFile:8) at android.app.Activity.performCreate(Activity.java:7822) at android.app.Activity.performCreate(Activity.java:7811) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1328) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3430) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3598)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2164)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:241)  at android.app.ActivityThread.main(ActivityThread.java:7582)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)  I don't know why it happens. I hope someone can give me a solution please.