美文网首页
集成react-native-camera编遇到的坑

集成react-native-camera编遇到的坑

作者: 一只特例独行de猪 | 来源:发表于2018-10-15 15:18 被阅读0次

    该模块在打包编译的时候报错,可能跟墙有关,也有跟版本有关
    node_module/react-native-camera中build.gradle 替换成这个,
    修改为国内maven镜像库和版本号compile "com.google.android.gms:play-services-vision:${safeExtGet('googlePlayServicesVersion', '11.0.4')}",仅供参考

    def safeExtGet(prop, fallback) {
        rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
    }
    
    buildscript {
      repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
      }
    
      dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
      }
    }
    
    apply plugin: 'com.android.library'
    
    android {
      compileSdkVersion safeExtGet('compileSdkVersion', 26)
      buildToolsVersion safeExtGet('buildToolsVersion', '26.0.2')
    
      defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 16)
        targetSdkVersion safeExtGet('targetSdkVersion', 26)
      }
      lintOptions {
        abortOnError false
        warning 'InvalidPackage'
      }
    }
    
    repositories {
      maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
      maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
      maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
      }
    }
    
    dependencies {
      compile 'com.facebook.react:react-native:+'
      compile "com.google.zxing:core:3.3.0"
      compile "com.drewnoakes:metadata-extractor:2.9.1"
      compile "com.google.android.gms:play-services-vision:${safeExtGet('googlePlayServicesVersion', '11.0.4')}"
      compile "com.android.support:exifinterface:${safeExtGet('supportLibVersion', '27.1.0')}"
      compile "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '27.1.0')}"
      compile "com.android.support:support-v4:${safeExtGet('supportLibVersion', '27.1.0')}"
    }
    

    相关文章

      网友评论

          本文标题:集成react-native-camera编遇到的坑

          本文链接:https://www.haomeiwen.com/subject/dmmfzftx.html