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

FilePicker crashes on tablet (devices uses layout-sw600dp-v13) #206

Open
ghost opened this issue Sep 6, 2019 · 3 comments
Open

FilePicker crashes on tablet (devices uses layout-sw600dp-v13) #206

ghost opened this issue Sep 6, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 6, 2019

I'm seeing the following crash when launching the app. Note this same build works on the phone. FsActivity.java:148 attempts to find a view with the id like this.

((TextView) nav.getHeaderView(0).findViewById(R.id.filestack__drawer_title)).setTextColor(theme.getBackgroundColor());

The app crashes with the following stacktrace.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nativestorybook/com.filestack.android.FsActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3260)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396)
        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:2009)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7319)
        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:934)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
        at com.filestack.android.FsActivity.onCreate(FsActivity.java:148)
        at android.app.Activity.performCreate(Activity.java:7783)
        at android.app.Activity.performCreate(Activity.java:7772)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3235)

I noticed there are two layouts version of filestack__activity_filestack.xml in the library for that particular screen: one in layout, the other is in layout-sw600dp-v13. The latter is for devices with width greater than 600dp (which applies to most tablets). The layout-sw600dp-v13 version of the layout doesn't have a view with ID filestack__drawer_title as a result the app crashes (FsActivity:148). Does this library work for tablets. How should this be fixed?

@ghost ghost changed the title FilePicker crashes on tablet FilePicker crashes on tablet (devices uses layout-sw600dp-v13) Sep 6, 2019
@MherKarapetyan
Copy link

Any solution?

@ghost
Copy link
Author

ghost commented Oct 29, 2019

No solution yet. I've raised the issue to support team but conversation has gone stale. I haven't had the chance to follow up and try to resolve this. Let me know if you have any more information.

@ryanlkuhn
Copy link

Since this package is clearly no longer being maintained my team has opted to fork this package and do our own maintenance. We ran into this issue as well and were able to resolve it by simply deleting the layout file noted above that's causing the issue. This resolves the bug and the existing layout for mobile looks and works fine on a tablet.

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