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

该模块在打包编译的时候报错,可能跟墙有关,也有跟版本有关
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')}"
}
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 177,498评论 25 709
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 13,596评论 2 59
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,331评论 19 139
  • 分享文章 作者 不写就出局 一年级五班 小哼哼 小糖豆要两岁了,每天蹦蹦跳跳特别可爱,可是随着她知道的越来越多,开...
    不写就出局阅读 292评论 0 2
  • 林徽因曾说过:“终于明白, 有些路,只能一个人走,那些邀约好同行的人,一起相伴雨季,走过年华,但有一天终究会在某个...
    筱静的幸福生活阅读 1,969评论 0 1

友情链接更多精彩内容