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

undefined is not an object (evaluating 'Picker._init') (android) #294

Open
hiradary opened this issue Mar 20, 2018 · 3 comments
Open

undefined is not an object (evaluating 'Picker._init') (android) #294

hiradary opened this issue Mar 20, 2018 · 3 comments

Comments

@hiradary
Copy link

Hi guys. I've been strugling with this issue and as I searched for that, It turned out that it causes because I haven't linked this package properly. but It's not true since I carefully checked the app/build.gradle and setting.gradle and ...

"react-native": "^0.51.0"
"react-native-picker": "^4.3.5",

@UniKylin
Copy link

What a pity, Such problem also appeared on my IOS simulator, But I don't have a nice solution, Ask for help

@UniKylin
Copy link

"react": "16.3.1"
"react-native": "0.55.3"
"react-native-picker": "^4.3.5"

@mmiedlarz
Copy link

mmiedlarz commented Apr 25, 2018

Hey guys, I think that react-native link is broken now. I had same issue and I fixed it by adding:

new PickerViewPackage(),

in MainApplication.java:

protected List<ReactPackage> getPackages() {
    return Arrays.asList(
        new MainReactPackage(),
        ...
        new PickerViewPackage()
    );
}

Just make sure that there is import:

import com.beefe.picker.PickerViewPackage;

at the top of the file.

jwdunne added a commit to jwdunne/react-native-picker that referenced this issue Apr 30, 2018
Found issue where attempting to call `._init()` on the native module
threw a red screen of death in React Native v0.54.

In the docs for RN v.54, the tutorial says nothing about the RCT
prefix. Removing this, inline with the current documentation, seems to
have fixed the problem.

There seemed to be issues with the gradle file, preventing builds on
Android. I had to bump the compiler SDK versions for it to build so I
could test. The `Build.VERSION_CODES.O` constant is apparently only
available after API level 26. Changing the compiler SDK version,
whilst keeping the target the same fixed the build.
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

3 participants