-
Notifications
You must be signed in to change notification settings - Fork 786
Android platform to use the correct method
佘小恒 edited this page Dec 29, 2016
·
4 revisions
$ git clone https://github.com/beefe/react-native-picker.git
- Correct screenshot
$ cd react-native-picker/example/PickerTest/android
- Correct screenshot
$ npm install
- Correct screenshot
$ react-native link react-native-picker
and
$ react-native run-android
- Correct screenshot
Be sure to be there:
rnpm-install info Android module react-native-picker is already linked
rnpm-install info iOS module react-native-picker is already linked
The corresponding changes in the file :
- android/settings.gradle
include ':react-native-picker'
project(':react-native-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-picker/android')
- android/app/build.gradle
compile project(':react-native-picker')
- android/src/main/java/com.xx/MainApplication.java
import com.beefe.picker.PickerViewPackage;
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new PickerViewPackage() // Added there
);
}
};
- react-native-picker: github:beefe/react-native-picker(current: v4.0.14)
- react-native: v0.32.0