React Native 无法读取 index.android.delta [英] React native cannot read index.android.delta

查看:42
本文介绍了React Native 无法读取 index.android.delta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了很多,但无法修复.在我在我的 packages.json 中添加 react-native-easy-gridview 之前,一切都运行良好,然后我检查了我的更改之后我得到了这个.

I have already tried a lot but could not get it fix. Everything was working good before I added react-native-easy-gridview in my packages.json and then I checked out my changes after that I got this.

这是我的 build.gradle

Here is my build.gradle

    apply plugin: "com.android.application"
import com.android.build.OutputFile


apply from: "../../node_modules/react-native/react.gradle"


def enableSeparateBuildPerCPUArchitecture = false


def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.pilbara_weed_management_mobile"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 8
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    signingConfigs {
            release {
                if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                    storeFile file(MYAPP_RELEASE_STORE_FILE)
                    storePassword MYAPP_RELEASE_STORE_PASSWORD
                    keyAlias MYAPP_RELEASE_KEY_ALIAS
                    keyPassword MYAPP_RELEASE_KEY_PASSWORD
                }
            }
        }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile project(':react-native-mauron85-background-geolocation')
    compile project(':react-native-background-task')
    compile project(':react-native-keep-awake')
    compile project(':react-native-background-timer')
    compile project(':react-native-image-resizer')
    compile project(':react-native-fcm')
    compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
    compile project(':react-native-fetch-blob')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile ("com.facebook.react:react-native:0.47.2") { force = true }  // From node_modules
    compile project(':react-native-smart-splashscreen')
    compile project(':react-native-fs')
    compile project(':react-native-file-opener')
    compile project(':react-native-camera')
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'

推荐答案

Edit android/app/build.gradle

Edit android/app/build.gradle

使用这个

compile ("com.facebook.react:react-native:0.44.0") { force = true }

compile ("com.facebook.react:react-native:0.44.0") { force = true }

并编写您使用的应用程序版本而不是 0.44.0 并删除类似的内容编译com.facebook.react:react-native:+"或这个编译com.facebook.react:react-native:0.44.0"

and write version of app you use instead of 0.44.0 and delete something like this compile "com.facebook.react:react-native:+" or this compile "com.facebook.react:react-native:0.44.0"

这篇关于React Native 无法读取 index.android.delta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆