windows环境里React-Native运行失败的原因之一,缺少依赖

命令行react-native run-android遇到如下错误:

windows环境里React-Native运行失败的原因之一,缺少依赖

Could not resolve project :react-native-camera

用下列命令行安装依赖后问题仍旧存在:

npm install --save react-native-camera

windows环境里React-Native运行失败的原因之一,缺少依赖

在这里链接里找到了解决方案:
https://github.com/react-native-community/react-native-camera/blob/master/docs/migrationV2.md#android

windows环境里React-Native运行失败的原因之一,缺少依赖windows环境里React-Native运行失败的原因之一,缺少依赖
android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.bacardi"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        missingDimensionStrategy 'react-native-camera', 'general'
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
windows环境里React-Native运行失败的原因之一,缺少依赖

上一篇:flutter 报错 x86


下一篇:【Android小技巧】通过gradle给module中资源文件自动加上前缀