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

java.lang.RuntimeException: Unable to start activity ComponentInfo #84

Open
anonym24 opened this issue Feb 21, 2018 · 5 comments
Open

Comments

@anonym24
Copy link

java.lang.RuntimeException: Unable to start activity ComponentInfo

   new MaterialFilePicker()
                            .withActivity(mActivity)
                            .withRequestCode(78)
                            .withFilter(Pattern.compile(".*\\.txt$")) // Filtering files and directories by file name using regexp
                            .withFilterDirectories(true) // Set directories filterable (false by default)
                            .withHiddenFiles(true) // Show hidden files and folders
                            .start();
02-21 23:57:55.546 6715-6715/com.google.android.demo E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                  Process: com.google.android.exoplayer2.demo, PID: 6715
                                                                                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.exoplayer2.demo/com.nbsp.materialfilepicker.ui.FilePickerActivity}: java.lang.ArrayIndexOutOfBoundsException: length=1926; index=8172
                                                                                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2455)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2515)
                                                                                      at android.app.ActivityThread.access$1000(ActivityThread.java:154)
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                      at android.os.Looper.loop(Looper.java:157)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:5555)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
                                                                                   Caused by: java.lang.ArrayIndexOutOfBoundsException: length=1926; index=8172
                                                                                      at android.content.res.TypedArray.getValueAt(TypedArray.java:1134)
                                                                                      at android.content.res.TypedArray.getColor(TypedArray.java:448)
                                                                                      at android.app.Activity.onApplyThemeResource(Activity.java:3837)
                                                                                      at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:150)
                                                                                      at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:94)
                                                                                      at android.support.v7.app.AppCompatActivity.setTheme(AppCompatActivity.java:89)
                                                                                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2515) 
                                                                                      at android.app.ActivityThread.access$1000(ActivityThread.java:154) 
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379) 
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                      at android.os.Looper.loop(Looper.java:157) 
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:5555) 
                                                                                      at java.lang.reflect.Method.invoke(Native Method) 
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745) 
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635) 
@prscX
Copy link
Contributor

prscX commented Feb 23, 2018

Hi, I am also facing the same issue. Can some please guide how to fix this issue.

Thanks
Pranav

@prscX
Copy link
Contributor

prscX commented Feb 23, 2018

Hi @anonym24, I have got the fix in order to resolve this.

Basically it is trying to look for few color props. After looking to library example looks like we have to define colors.xml in app res with below value:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
</resources>

Ideally this should have been defined in README, not sure why they have missed to specify the same.

Thanks
Pranav

@ZeroCool00
Copy link

not color.xml.
it should be colors.xml

@prscX
Copy link
Contributor

prscX commented Jan 26, 2019

@ZeroCool00: noted. I have changed the same. Thanks

Thanks
</ Pranav >

@NokisDemox
Copy link

@prscX you saved my life, I didnt know what was wrong. That should be added to the readme

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

4 participants