Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes when trying to add file from device #184

Open
neel1998 opened this issue Feb 20, 2020 · 3 comments
Open

App crashes when trying to add file from device #184

neel1998 opened this issue Feb 20, 2020 · 3 comments

Comments

@neel1998
Copy link
Contributor

Summary:

In the files screen, after adding a file from local storage, app immediately crashed

Steps to reproduce:

  1. Go to Files option
  2. Select Share files option
  3. Select a file from device storage

System logs:

    Process: memphis.myapplication, PID: 27776
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=65536, result=-1, data=Intent { dat=content://com.android.externalstorage.documents/document/primary:chess.jpg flg=0x43 }} to activity {memphis.myapplication/memphis.myapplication.IntroActivity}: java.lang.StringIndexOutOfBoundsException: String index out of range: -31
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4729)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4771)
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1993)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7285)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
     Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -31
        at java.lang.String.substring(String.java:2036)
        at memphis.myapplication.utilities.FileManager.saveFileQR(FileManager.java:286)
        at memphis.myapplication.UI.FilesFragment.onActivityResult(FilesFragment.java:264)
        at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:170)
        at android.app.Activity.dispatchActivityResult(Activity.java:7814)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4722)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4771) 
        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1993) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:216) 
        at android.app.ActivityThread.main(ActivityThread.java:7285) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975) 

Device and Android version:
Samsung M30s (Android 9)

Screen-shots:

Would you like to work on the issue?
Yes

@jrandallclark
Copy link
Contributor

Honestly, while this bug needs to be fixed, the "Share Files" feature likely needs to be disabled until some sort of stream publishing is added to jNDN (or our app directly, if necessary). Right now the size of a file you can share is limited by your phone's memory. I was working on this some last summer, but got pulled away onto other projects and never finished.

@jrandallclark
Copy link
Contributor

You can fix the problem, but I will likely be disabling the feature. I'll just remove the button, but keep all the code. That way we can reuse it when publishing is fixed.

@neel1998
Copy link
Contributor Author

Awesome. For now I think let's just make the button invisible, people don't get confused. Is that okay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants