没有这样的属性:类的ABI:org.gradle.api.tasks.OutputFile

时间:2018-08-29 10:47:23

标签: android react-native gradle android-gradle

我对React Native的开发是全新的。我开发了一个小项目,想要发布APK。不,我去发布构建堆栈。 谁能帮我? 谢谢。

错误是

  

没有这样的属性:类的ABI:org.gradle.api.tasks.OutputFile   org.gradle.api.ProjectConfigurationException:发生问题   配置项目':app'的原因:   groovy.lang.MissingPropertyException:无此类属性:类的ABI:   org.gradle.api.tasks.OutputFile

build.gradle(app)

apply plugin: "com.android.application"


project.ext.react = [
    resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
]

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


def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    defaultConfig {
        applicationId "com.ninjakod.vehiclevalue"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "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
            }
        }
    }
    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
            }
        }
    }
    buildToolsVersion '27.0.3'
}

dependencies {
    compile project(':react-native-admob')
    implementation project(':react-native-admob')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
}

// 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'
}

build.gradle(SampleMobileApp)

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0-alpha11'

        // 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"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

ext {
    buildToolsVersion = "26.0.3"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}

2 个答案:

答案 0 :(得分:5)

好的,我找到了解决方案。添加

----- amqxfdcp.c : 829 --------------------------------------------------------
9/3/2018 01:38:23 - Process(19732.115) User(SYSTEM) Program(rhs.exe)
                      Host(XXXXXXXXXX) Installation(AMHMQ)
                      VRMF(8.0.0.2)
AMQ6183: An internal WebSphere MQ error has occurred.

EXPLANATION:
An error has been detected, and the WebSphere MQ error recording routine has
been called. The failing process is process 19732.
ACTION:
Use the standard facilities supplied with your system to record the problem
identifier and to save any generated output files. Use either the MQ Support
site: http://www.ibm.com/software/integration/wmq/support/, or IBM Support
Assistant (ISA): http://www.ibm.com/software/support/isa/, to see whether a
solution is already available.  If you are unable to find a match, contact your
IBM support center.  Do not discard these files until the problem has been
resolved. 
----- amqxfdcp.c : 874 --------------------------------------------------------
9/3/2018 01:42:17 - Process(20948.153) User(SYSTEM) Program(rhs.exe)
                      Host(XXXXXXX) Installation(AMHMQ)
                      VRMF(8.0.0.2)
AMQ6119: An internal WebSphere MQ error has occurred (Timed-out waiting for
MSCS resource 'QM1', to be terminated)

EXPLANATION:
MQ detected an unexpected error when calling the operating system. The MQ error
recording routine has been called.
ACTION:
Use the standard facilities supplied with your system to record the problem
identifier and to save any generated output files. Use either the MQ Support
site: http://www.ibm.com/software/integration/wmq/support/, or IBM Support
Assistant (ISA): http://www.ibm.com/software/support/isa/, to see whether a
solution is already available.  If you are unable to find a match, contact your
IBM support center.  Do not discard these files until the problem has been
resolved. 
----- amqxfdcp.c : 829 --------------------------------------------------------
9/3/2018 01:42:17 - Process(20948.153) User(SYSTEM) Program(rhs.exe)
                      Host(XXXXXXX) Installation(AMHMQ)
                      VRMF(8.0.0.2)
AMQ6183: An internal WebSphere MQ error has occurred.

EXPLANATION:
An error has been detected, and the WebSphere MQ error recording routine has
been called. The failing process is process 20948.
ACTION:
Use the standard facilities supplied with your system to record the problem
identifier and to save any generated output files. Use either the MQ Support
site: http://www.ibm.com/software/integration/wmq/support/, or IBM Support
Assistant (ISA): http://www.ibm.com/software/support/isa/, to see whether a
solution is already available.  If you are unable to find a match, contact your
IBM support center.  Do not discard these files until the problem has been
resolved. 
----- amqxfdcp.c : 874 --------------------------------------------------------

到build.gradle(用于应用程序)解决了问题

答案 1 :(得分:0)

将此行替换为build.gradle(:app)

def abi = output.getFilter(OutputFile.ABI)

具有:

def abi = output.getFilter(com.android.build.OutputFile.ABI)