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 crash with RN 0.61.x. (Android) #68

Closed
carl0804 opened this issue Jan 1, 2020 · 4 comments
Closed

App crash with RN 0.61.x. (Android) #68

carl0804 opened this issue Jan 1, 2020 · 4 comments
Assignees

Comments

@carl0804
Copy link

carl0804 commented Jan 1, 2020

App crashed where open file selector. RN version is 0.61.5. Platform is Android

"dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-file-selector": "^1.0.0"
  },
import React, {Component} from 'react';
import {Text, View, TouchableOpacity} from 'react-native';
import RNFileSelector from 'react-native-file-selector';
export class App extends Component {
  openFile = () => {
    RNFileSelector.Show({
      title: 'Select File',
      onDone: path => {
        console.log('file selected: ' + path);
      },
      onCancel: () => {
        console.log('cancelled');
      },
    });
  };

  render() {
    return (
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
        <TouchableOpacity onPress={this.openFile}>
          <Text> open file selector </Text>
        </TouchableOpacity>
      </View>
    );
  }
}

export default App;

@prscX
Copy link
Owner

prscX commented Jan 2, 2020

@carl0804: Could you please share the crash logs, you can use flipper also have you added color properties as per defined in README?

Thanks
</ Pranav >

@prscX prscX self-assigned this Jan 2, 2020
@iremlaya
Copy link
Contributor

same issue

@iremlaya
Copy link
Contributor

Alright I solved it after checking the examples. It was as you said, about color.xml.
It has to be in .../res/values and the complete code is:

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

However, as I'm not well versed in android, going of just from your explanation in the installation part mislead me. Had you not added example codes in whole, I'd still be wandering aimlessly. I kindly ask you to be precise with the statements in the documentation. I am opening a PR regarding this as well: #69 @prscX

@prscX prscX closed this as completed Feb 23, 2020
@WynnLu
Copy link

WynnLu commented May 5, 2020

I met the same problem. I added the color.xml but it didn't work. Once I call the RNFileSelector.Show() my app crashes. How to solve it???

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