Skip to content

Manual Linking Android

terrylinla edited this page Feb 14, 2018 · 1 revision
  1. npm install @terrylinla/react-native-sketch-canvas --save

  2. Add the following lines to android/settings.gradle:

    include ':@terrylinla/react-native-sketch-canvas'
    project(':@terrylinla/react-native-sketch-canvas').projectDir = new File(rootProject.projectDir, '../node_modules/@terrylinla/react-native-sketch-canvas/android')
    
  3. In android/app/build.gradle, add the following lines inside the dependencies block :

    compile project(':react-native-svg')
    
  4. Edit MainApplication.java (in android/app/src/main/java/...) :

    ......
    import com.terrylinla.rnsketchcanvas.SketchCanvasPackage;  // <--- add here
    ......
    
    public class MainApplication extends Application implements ReactApplication {
        ......
    
        @Override
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(
                ......
                new SketchCanvasPackage(),            // <------ add here
                ......
            );
        }
    
        ......
    }
Clone this wiki locally