- 
                Notifications
    You must be signed in to change notification settings 
- Fork 783
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-pickerand
$ 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 linkedThe 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