无法使用gradle将Android Kotlin项目上传到Fabric Beta

无法使用gradle将Android Kotlin项目上传到Fabric Beta,第1张

概述我用AndroidStudioPreview3.0(Canary2)创建了一个项目来开始Kotlin开发.我使用AndroidStudioFabric插件为我的项目设置Fabric.但是,当我想使用以下命令将我的应用程序的测试版上传到FabricBeta(Crashlytics)时./gradlewcrashlyticsUploadDistributionDebug我收到以下

我用Android Studio PrevIEw 3.0(Canary 2)创建了一个项目来开始Kotlin开发.我使用AndroID Studio Fabric插件为我的项目设置Fabric.

但是,当我想使用以下命令将我的应用程序的测试版上传到Fabric Beta(Crashlytics)时

./gradlew crashlyticsuploaddistributionDeBUG

我收到以下错误:

Configuration ‘compile’ in project ‘:app’ is deprecated. Use
‘implementation’ instead. Configuration ‘testCompile’ in project
‘:app’ is deprecated. Use ‘testImplementation’ instead. The
Task.leftShift(Closure) method has been deprecated and is scheduled to
be removed in Gradle 5.0. Please use Task.dolast(Action) instead.
registerResGeneratingTask is deprecated, use
registerGeneratedFolders(fileCollection) registerResGeneratingTask is
deprecated, use registerGeneratedFolders(fileCollection)
:app:crashlyticsuploaddistributionDeBUG Failed

FAILURE: Build Failed with an exception.

What went wrong: Execution Failed for task ‘:app:crashlyticsuploaddistributionDeBUG’.

Not valID.

  >尝试:使用–stacktrace选项运行以获取堆栈跟踪.使用–info或–deBUG选项运行以获取更多日志输出.
  
  
  在1s 1可 *** 作的任务中建立失败:1执行,0避免(0%)

我不知道,什么“无效”的意思.

这是我的root build.gradle:

buildscript {    ext.kotlin_version = '1.1.2-4'    repositorIEs {        maven { url 'https://maven.Google.com' }        maven { url 'https://maven.fabric.io/public' }        jcenter()    }    dependencIEs {        classpath 'com.androID.tools.build:gradle:3.0.0-Alpha2'        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"        classpath 'org.ajoberstar:grgit:1.9.0'        classpath 'io.fabric.tools:gradle:1.22.1'        // NOTE: Do not place your application dependencIEs here; they belong        // in the indivIDual module build.gradle files    }}ext {    supportlibVersion = "25.3.1"    buildVersion = "25.0.3"    daggerVersion = "2.9"    rxJavaVersion = "2.1.0"    rxAndroIDVersion = "2.0.1"    countGitCommits = { ->        git = Grgit.open()        def commitCount = git.log(includes: ['head']).size()        println("INFO: Number of commits $commitCount")        return commitCount    }}allprojects {    repositorIEs {        jcenter()        maven { url 'https://maven.Google.com' }        maven { url 'https://maven.fabric.io/public' }        mavenCentral()    }}task clean(type: Delete) {    delete rootProject.buildDir}

这是app build.gradle

apply plugin: 'com.androID.application'apply plugin: 'io.fabric'apply plugin: 'kotlin-androID'apply plugin: 'kotlin-android-extensions'apply plugin: 'kotlin-kapt'androID {    compileSdkVersion 25    buildToolsversion "$buildVersion"    defaultConfig {        applicationID "com.kotlin.sample"        minSdkVersion 21        targetSdkVersion 25        def numberOfCommits = countGitCommits()        versionCode 1000 + numberOfCommits        versionname "0.1.$numberOfCommits"        testInstrumentationRunner "androID.support.test.runner.AndroIDJUnitRunner"    }    buildTypes {        release {            MinifyEnabled false            proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro'           }    }}dependencIEs {    compile files('libs/API_ADK.jar')    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"    compile "com.androID.support:appcompat-v7:$supportlibVersion"    compile "com.androID.support:support-v4:$supportlibVersion"    compile "com.androID.support:design:$supportlibVersion"    compile 'com.androID.support.constraint:constraint-layout:1.0.2'    compile 'io.reactivex.rxjava2:rxkotlin:2.0.3'    compile "io.reactivex.rxjava2:rxandroID:$rxAndroIDVersion"    compile "io.reactivex.rxjava2:rxjava:$rxJavaVersion"    compile 'com.jakewharton.timber:timber:4.5.1'    compile "com.Google.dagger:dagger:$daggerVersion"    // Needed for @Generated annotation (missing in Java <= 1.6; therefore, AndroID)    compile 'javax.annotation:Jsr250-API:1.0'    compile('com.crashlytics.sdk.androID:crashlytics:2.6.8@aar') {        transitive = true;    }    kapt "com.Google.dagger:dagger-compiler:$daggerVersion"    testCompile 'junit:junit:4.12'}

带有APISecret的fabric.propertIEs文件也放在项目中.

编辑:

手动上传APK到Fabric Beta可以正常运行.

解决方法:

我只是想指出Mike Bonnell的评论,因为它回答了这个问题:

Our command line tools are not compatible with the Alpha version of Gradle 3. We’re looking into the changes that have come with the Alpha versions, but we test against betas and stable versions of the releases.

编辑2017/08/25
尝试使用AndroID Studio 3.0 Beta 3和相应的androID gradle插件. gradle任务crashlyticsuploaddistributionDeBUG似乎再次起作用.

总结

以上是内存溢出为你收集整理的无法使用gradle将Android Kotlin项目上传到Fabric Beta全部内容,希望文章能够帮你解决无法使用gradle将Android Kotlin项目上传到Fabric Beta所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1108723.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存