Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Bug: App crashes due to java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) #368

Closed
htg2704 opened this issue Mar 7, 2020 · 6 comments
Assignees
Labels
duplicate This issue or pull request already exists in progress

Comments

@htg2704
Copy link

htg2704 commented Mar 7, 2020

Software and hardware versions

Android v9, device used - Realme X2 pro

Problem description

App crashes due to java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
The activities crash while performing a specific task twice.

Steps to reproduce the problem

While sending any form, if you click send it will take you to activity_send. Now if back button is clicked and we revert back to the previos activity where forms were to be selected and if we click send again the app crashes and we are back to home screen.

Expected behavior

After solving the issue, upon clicking send again, the activity won't crash and will take you to the required send_activity.

Logacat

10:00:26.951 6421-6421/org.odk.share E/WifiHospotConnector: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at org.odk.share.network.WifiHospotConnector.setWifiConfig(WifiHospotConnector.java:110) at org.odk.share.network.WifiHospotConnector.disableHotspot(WifiHospotConnector.java:133) at org.odk.share.views.ui.hotspot.HpSenderActivity.onCreate(HpSenderActivity.java:137) at android.app.Activity.performCreate(Activity.java:7346) at android.app.Activity.performCreate(Activity.java:7337) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3173) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3343) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:114) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:74) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7290) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:497) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915) Caused by: java.lang.SecurityException: App not allowed to read or update stored WiFi AP config (uid = 10331) at android.os.Parcel.createException(Parcel.java:1966) at android.os.Parcel.readException(Parcel.java:1934) at android.os.Parcel.readException(Parcel.java:1884) at android.net.wifi.IWifiManager$Stub$Proxy.setWifiApConfiguration(IWifiManager.java:2442) at android.net.wifi.WifiManager.setWifiApConfiguration(WifiManager.java:2565) at java.lang.reflect.Method.invoke(Native Method)  at org.odk.share.network.WifiHospotConnector.setWifiConfig(WifiHospotConnector.java:110)  at org.odk.share.network.WifiHospotConnector.disableHotspot(WifiHospotConnector.java:133)  at org.odk.share.views.ui.hotspot.HpSenderActivity.onCreate(HpSenderActivity.java:137)  at android.app.Activity.performCreate(Activity.java:7346)  at android.app.Activity.performCreate(Activity.java:7337)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3173)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3343)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:114)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:74)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7290)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:497)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915)  Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.wifi.WifiServiceImpl.setWifiApConfiguration(WifiServiceImpl.java:2060) at android.net.wifi.IWifiManager$Stub.onTransact(IWifiManager.java:648) at android.os.Binder.execTransact(Binder.java:731) 2020-03-07 10:00:26.951 6421-6421/? D/AndroidRuntime: Shutting down VM 2020-03-07 10:00:26.952 6421-6421/? E/AndroidRuntime: FATAL EXCEPTION: main Process: org.odk.share, PID: 6421 java.lang.RuntimeException: Unable to start activity ComponentInfo{org.odk.share/org.odk.share.views.ui.hotspot.HpSenderActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3193) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3343) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:114) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:74) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7290) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:497) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference at org.odk.share.network.WifiHospotConnector.toggleHotspot(WifiHospotConnector.java:139) at org.odk.share.network.WifiHospotConnector.disableHotspot(WifiHospotConnector.java:134) at org.odk.share.views.ui.hotspot.HpSenderActivity.onCreate(HpSenderActivity.java:137) at android.app.Activity.performCreate(Activity.java:7346) at android.app.Activity.performCreate(Activity.java:7337) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3173) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3343)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:114)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:74)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7290)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:497)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915) 

Other information

I would like to resolve this issue.
@opendatakit-bot claim

@getodk-bot
Copy link
Member

Hello @htg2704!

You have attempted to claim an issue without the labels "help wanted", "good first issue". It seems like you are new to Open Data Kit, so we suggest working on a good first issue issue first. After doing one quick win, then try a help wanted issue. We also recommend reading README.md and CONTRIBUTING.md before getting started.

To claim this issue anyway, comment on this issue again with the command @opendatakit-bot claim --force.

@htg2704 htg2704 changed the title No up navigation button in send activity App crashes due to java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) Mar 7, 2020
@htg2704 htg2704 changed the title App crashes due to java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) App crashes due to java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) Mar 7, 2020
@htg2704 htg2704 changed the title App crashes due to java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) Bug: App crashes due to java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) Mar 7, 2020
@htg2704
Copy link
Author

htg2704 commented Mar 7, 2020

@opendatakit-bot claim --force

@getodk-bot
Copy link
Member

Welcome to Open Data Kit, @htg2704! We just sent you an invite to collaborate on this repository at https://github.com/opendatakit/skunkworks-crow/invitations. Please accept this invite in order to claim this issue and begin a fun and rewarding experience contributing to Open Data Kit!

Here are some tips to get you off to a good start:

  • Please read the README.md and CONTRIBUTING.md in this repo. Those two documents have much of what you need to get started.
  • Join the ODK developer Slack to get help, chat about this issue, and meet the other developers.
  • Sign up and introduce yourself on the ODK community forum to meet the broader ODK community.

See you on the other side (that is, the pull request side)!

@ajay-prabhakar
Copy link
Contributor

Hello, @htg2704 thanks for raising the issue, but it looks like a duplicate of #323
if you don't have any queries please close this issue, thanks

@htg2704
Copy link
Author

htg2704 commented Mar 8, 2020

@Chromicle Yes the issue is already mentioned under #323. It didn't showed under similar issues sections. I am closing the issue.

@htg2704 htg2704 closed this as completed Mar 8, 2020
@ajay-prabhakar
Copy link
Contributor

ajay-prabhakar commented Mar 8, 2020

You specified the error message name instead of what is the issue about so, GitHub didn't show in similar issues, from the next time please have a look on all issues then open it
@opendatakit-bot label "duplicate"

@getodk-bot getodk-bot added the duplicate This issue or pull request already exists label Mar 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists in progress
Projects
None yet
Development

No branches or pull requests

3 participants