react-native-camera 填坑

安装过程无法编译, 按以下方法修正


A mix of things worked for me.


  react: 16.3.1 => 16.3.1
  react-native: 0.55.1 => 0.55.1
Add the following to your dependecies inside android/app/build.gradle


    compileSdkVersion 26
    buildToolsVersion '26.0.2'
      targetSdkVersion 26
compile ("com.android.support:support-v4:26.0.1") {
        force = true //<-- force dependency resolution to 26.0.1 in my case
    }
Also make sure to update android/build.gradle to use gradle 3 and add google


// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}


allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}
Don't forget to also to update the distribuitionUrl in android/gradle/wrapper/gradle-wrapper.properties


distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值