Android 没有这样的属性:使用crashlytics生成时betaDistributionApkFilePath

Android 没有这样的属性:使用crashlytics生成时betaDistributionApkFilePath,android,android-gradle-plugin,crashlytics,google-fabric,Android,Android Gradle Plugin,Crashlytics,Google Fabric,今天我更新了crashlytics的最新版本,很久没有更新了 我在构建文件时遇到以下错误 错误:没有此类属性:类的BetadistributionAppFilePath: java.lang.String 我没有在我的gradle文件中设置任何betaDistributionApkFilePath属性 这是在我按照fabric网站上的说明将其更新为最新版本后发生的。我试着把它降到一个稍旧的版本,但没有帮助。我也试图找出更多的错误,但似乎我是第一个面对这个问题的人 我的项目级build.gradl

今天我更新了crashlytics的最新版本,很久没有更新了

我在构建文件时遇到以下错误

错误:没有此类属性:类的BetadistributionAppFilePath: java.lang.String

我没有在我的gradle文件中设置任何
betaDistributionApkFilePath
属性

这是在我按照fabric网站上的说明将其更新为最新版本后发生的。我试着把它降到一个稍旧的版本,但没有帮助。我也试图找出更多的错误,但似乎我是第一个面对这个问题的人

我的项目级build.gradle

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
    all*.exclude group: 'com.google.android.gms', module: 'play-services'
}

buildscript {

    ext {
        // root project
        androidGradleVersion = "3.0.1"
        googleServices = "3.2.0"
        crashlytics = "1.25.1"
    }

    repositories {
        jcenter()
        mavenCentral()
        google()

        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath "com.android.tools.build:gradle:$androidGradleVersion"
        classpath "com.google.gms:google-services:$googleServices"
        classpath "io.fabric.tools:gradle:$crashlytics"
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}


task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

ext {

    // android
    playService = "11.4.2"
    supportLibrary = "27.0.2"
    constrainLayout = "1.0.2"

    // libraries
    retofit = "1.9.0"
    okHttp = "2.0.0"
    eventBus = "1.3.8"
    picasso = "2.5.2"
    calligraphy = "2.3.0"
    socketIo = "0.3.0"
    facebook = "4.30.0"
    circularReveal = "1.3.1"
    imageCropper = "1.2.2"
    expandableRecyclerView = "2.1.1"
    crashlytics = "2.9.0"
    selectableBackgroudImageView = "1.0.1"
    multidex = "1.0.1"
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "myappid"
        minSdkVersion 16
        targetSdkVersion 21

        versionCode 01
        versionName "01"
        multiDexEnabled true
    }

    buildTypes {
        debug {
            resValue "string", "app_name", "MyApp Dev"
            applicationIdSuffix ".debug"
        }

        release {
            resValue "string", "app_name", "MyApp"
            zipAlignEnabled true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "6g"
    }

    sourceSets {
        main {
            res.srcDirs = ['src/main/res', 'src/main/res/anim-v21']
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

repositories {
    mavenCentral()

    maven {
        url "https://jitpack.io"
    }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {

    implementation files('libs/YouTubeAndroidPlayerApi.jar')

    implementation "com.google.firebase:firebase-database:$playService"
    implementation "com.google.firebase:firebase-auth:$playService"
    implementation "com.google.firebase:firebase-core:$playService"
    implementation "com.google.firebase:firebase-messaging:$playService"
    implementation "com.google.android.gms:play-services-cast:$playService"
    implementation "com.google.android.gms:play-services-gcm:$playService"
    implementation "com.google.android.gms:play-services-analytics:$playService"
    implementation "com.google.android.gms:play-services-maps:$playService"
    implementation "com.google.android.gms:play-services-location:$playService"
    implementation "com.google.android.gms:play-services-auth:$playService"

    implementation "com.squareup.retrofit:retrofit:$retofit"
    implementation "com.squareup.okhttp:okhttp-urlconnection:$okHttp"
    implementation "com.squareup.okhttp:okhttp:$okHttp"
    implementation "com.squareup:otto:$eventBus"
    implementation "com.squareup.picasso:picasso:$picasso"

    implementation "com.android.support:support-v4:$supportLibrary"
    implementation "com.android.support:recyclerview-v7:$supportLibrary"
    implementation "com.android.support:design:$supportLibrary"
    implementation "com.android.support:appcompat-v7:$supportLibrary"
    implementation "com.android.support:cardview-v7:$supportLibrary"
    implementation "com.android.support:mediarouter-v7:$supportLibrary"
    implementation "com.android.support.constraint:constraint-layout:$constrainLayout"

    implementation "uk.co.chrisjenx:calligraphy:$calligraphy"
    implementation "com.github.nkzawa:socket.io-client:$socketIo"
    implementation "com.facebook.android:facebook-android-sdk:$facebook"
    implementation "com.facebook.android:facebook-login:$facebook"
    implementation "com.github.ozodrukh:CircularReveal:$circularReveal"
    implementation "com.theartofdev.edmodo:android-image-cropper:$imageCropper"
    implementation "com.bignerdranch.android:expandablerecyclerview:$expandableRecyclerView"
    implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics@aar") {
        transitive = true
    }

    implementation "com.joooonho:selectableroundedimageview:$selectableBackgroudImageView"
    implementation "com.android.support:multidex:$multidex"
}

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

ext {
    crashlytics = '2.9.0'
   }
 } 
这是我的应用程序级别build.gradle

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
    all*.exclude group: 'com.google.android.gms', module: 'play-services'
}

buildscript {

    ext {
        // root project
        androidGradleVersion = "3.0.1"
        googleServices = "3.2.0"
        crashlytics = "1.25.1"
    }

    repositories {
        jcenter()
        mavenCentral()
        google()

        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath "com.android.tools.build:gradle:$androidGradleVersion"
        classpath "com.google.gms:google-services:$googleServices"
        classpath "io.fabric.tools:gradle:$crashlytics"
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}


task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

ext {

    // android
    playService = "11.4.2"
    supportLibrary = "27.0.2"
    constrainLayout = "1.0.2"

    // libraries
    retofit = "1.9.0"
    okHttp = "2.0.0"
    eventBus = "1.3.8"
    picasso = "2.5.2"
    calligraphy = "2.3.0"
    socketIo = "0.3.0"
    facebook = "4.30.0"
    circularReveal = "1.3.1"
    imageCropper = "1.2.2"
    expandableRecyclerView = "2.1.1"
    crashlytics = "2.9.0"
    selectableBackgroudImageView = "1.0.1"
    multidex = "1.0.1"
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "myappid"
        minSdkVersion 16
        targetSdkVersion 21

        versionCode 01
        versionName "01"
        multiDexEnabled true
    }

    buildTypes {
        debug {
            resValue "string", "app_name", "MyApp Dev"
            applicationIdSuffix ".debug"
        }

        release {
            resValue "string", "app_name", "MyApp"
            zipAlignEnabled true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "6g"
    }

    sourceSets {
        main {
            res.srcDirs = ['src/main/res', 'src/main/res/anim-v21']
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

repositories {
    mavenCentral()

    maven {
        url "https://jitpack.io"
    }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {

    implementation files('libs/YouTubeAndroidPlayerApi.jar')

    implementation "com.google.firebase:firebase-database:$playService"
    implementation "com.google.firebase:firebase-auth:$playService"
    implementation "com.google.firebase:firebase-core:$playService"
    implementation "com.google.firebase:firebase-messaging:$playService"
    implementation "com.google.android.gms:play-services-cast:$playService"
    implementation "com.google.android.gms:play-services-gcm:$playService"
    implementation "com.google.android.gms:play-services-analytics:$playService"
    implementation "com.google.android.gms:play-services-maps:$playService"
    implementation "com.google.android.gms:play-services-location:$playService"
    implementation "com.google.android.gms:play-services-auth:$playService"

    implementation "com.squareup.retrofit:retrofit:$retofit"
    implementation "com.squareup.okhttp:okhttp-urlconnection:$okHttp"
    implementation "com.squareup.okhttp:okhttp:$okHttp"
    implementation "com.squareup:otto:$eventBus"
    implementation "com.squareup.picasso:picasso:$picasso"

    implementation "com.android.support:support-v4:$supportLibrary"
    implementation "com.android.support:recyclerview-v7:$supportLibrary"
    implementation "com.android.support:design:$supportLibrary"
    implementation "com.android.support:appcompat-v7:$supportLibrary"
    implementation "com.android.support:cardview-v7:$supportLibrary"
    implementation "com.android.support:mediarouter-v7:$supportLibrary"
    implementation "com.android.support.constraint:constraint-layout:$constrainLayout"

    implementation "uk.co.chrisjenx:calligraphy:$calligraphy"
    implementation "com.github.nkzawa:socket.io-client:$socketIo"
    implementation "com.facebook.android:facebook-android-sdk:$facebook"
    implementation "com.facebook.android:facebook-login:$facebook"
    implementation "com.github.ozodrukh:CircularReveal:$circularReveal"
    implementation "com.theartofdev.edmodo:android-image-cropper:$imageCropper"
    implementation "com.bignerdranch.android:expandablerecyclerview:$expandableRecyclerView"
    implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics@aar") {
        transitive = true
    }

    implementation "com.joooonho:selectableroundedimageview:$selectableBackgroudImageView"
    implementation "com.android.support:multidex:$multidex"
}

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

ext {
    crashlytics = '2.9.0'
   }
 } 

您的应用程序级别build.gradle中的以下行导致了该问题

ext {

// android
playService = "11.4.2"
supportLibrary = "27.0.2"
constrainLayout = "1.0.2"

// libraries
retofit = "1.9.0"
okHttp = "2.0.0"
eventBus = "1.3.8"
picasso = "2.5.2"
calligraphy = "2.3.0"
socketIo = "0.3.0"
facebook = "4.30.0"
circularReveal = "1.3.1"
imageCropper = "1.2.2"
expandableRecyclerView = "2.1.1"
crashlytics = "2.9.0"
selectableBackgroudImageView = "1.0.1"
multidex = "1.0.1"
}
在项目级build.gradle的buildScript{}中声明它

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
    all*.exclude group: 'com.google.android.gms', module: 'play-services'
}

buildscript {

    ext {
        // root project
        androidGradleVersion = "3.0.1"
        googleServices = "3.2.0"
        crashlytics = "1.25.1"
    }

    repositories {
        jcenter()
        mavenCentral()
        google()

        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath "com.android.tools.build:gradle:$androidGradleVersion"
        classpath "com.google.gms:google-services:$googleServices"
        classpath "io.fabric.tools:gradle:$crashlytics"
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}


task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

ext {

    // android
    playService = "11.4.2"
    supportLibrary = "27.0.2"
    constrainLayout = "1.0.2"

    // libraries
    retofit = "1.9.0"
    okHttp = "2.0.0"
    eventBus = "1.3.8"
    picasso = "2.5.2"
    calligraphy = "2.3.0"
    socketIo = "0.3.0"
    facebook = "4.30.0"
    circularReveal = "1.3.1"
    imageCropper = "1.2.2"
    expandableRecyclerView = "2.1.1"
    crashlytics = "2.9.0"
    selectableBackgroudImageView = "1.0.1"
    multidex = "1.0.1"
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "myappid"
        minSdkVersion 16
        targetSdkVersion 21

        versionCode 01
        versionName "01"
        multiDexEnabled true
    }

    buildTypes {
        debug {
            resValue "string", "app_name", "MyApp Dev"
            applicationIdSuffix ".debug"
        }

        release {
            resValue "string", "app_name", "MyApp"
            zipAlignEnabled true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "6g"
    }

    sourceSets {
        main {
            res.srcDirs = ['src/main/res', 'src/main/res/anim-v21']
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

repositories {
    mavenCentral()

    maven {
        url "https://jitpack.io"
    }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {

    implementation files('libs/YouTubeAndroidPlayerApi.jar')

    implementation "com.google.firebase:firebase-database:$playService"
    implementation "com.google.firebase:firebase-auth:$playService"
    implementation "com.google.firebase:firebase-core:$playService"
    implementation "com.google.firebase:firebase-messaging:$playService"
    implementation "com.google.android.gms:play-services-cast:$playService"
    implementation "com.google.android.gms:play-services-gcm:$playService"
    implementation "com.google.android.gms:play-services-analytics:$playService"
    implementation "com.google.android.gms:play-services-maps:$playService"
    implementation "com.google.android.gms:play-services-location:$playService"
    implementation "com.google.android.gms:play-services-auth:$playService"

    implementation "com.squareup.retrofit:retrofit:$retofit"
    implementation "com.squareup.okhttp:okhttp-urlconnection:$okHttp"
    implementation "com.squareup.okhttp:okhttp:$okHttp"
    implementation "com.squareup:otto:$eventBus"
    implementation "com.squareup.picasso:picasso:$picasso"

    implementation "com.android.support:support-v4:$supportLibrary"
    implementation "com.android.support:recyclerview-v7:$supportLibrary"
    implementation "com.android.support:design:$supportLibrary"
    implementation "com.android.support:appcompat-v7:$supportLibrary"
    implementation "com.android.support:cardview-v7:$supportLibrary"
    implementation "com.android.support:mediarouter-v7:$supportLibrary"
    implementation "com.android.support.constraint:constraint-layout:$constrainLayout"

    implementation "uk.co.chrisjenx:calligraphy:$calligraphy"
    implementation "com.github.nkzawa:socket.io-client:$socketIo"
    implementation "com.facebook.android:facebook-android-sdk:$facebook"
    implementation "com.facebook.android:facebook-login:$facebook"
    implementation "com.github.ozodrukh:CircularReveal:$circularReveal"
    implementation "com.theartofdev.edmodo:android-image-cropper:$imageCropper"
    implementation "com.bignerdranch.android:expandablerecyclerview:$expandableRecyclerView"
    implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics@aar") {
        transitive = true
    }

    implementation "com.joooonho:selectableroundedimageview:$selectableBackgroudImageView"
    implementation "com.android.support:multidex:$multidex"
}

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

ext {
    crashlytics = '2.9.0'
   }
 } 
要在app-level build.gradle中访问这些变量,请如下使用

 compile("com.crashlytics.sdk.android:crashlytics:$rootProject.ext.crashlytics@aar") {
    transitive = true
}

希望这有助于……

很高兴知道这一点