自动测试版与crashlytics [英] Automatic Beta Releases with crashlytics
问题描述
我的android应用程序有一个包含'crashlytics.start()'的库。我只将Crashlytics.jar设置为Library项目的依赖项。构建是成功的。
我在app> build.gradle文件中配置了多种口味。
考虑到我的一个构建味道被称为生产,我在我的应用程序> build.gradle文件中有以下配置:
$ p $ buildscript {
存储库{
mavenCentral()
}
依赖关系{
classpath'com.android.tools.build:gradle:0.13+'
apply插件:'android'
仓库{
mavenCentral()
}
android {
compileSdkVersion 21
buildToolsVersion21.1.1
defaultConfig {
applicationIdcom。 test.testapp
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName0.0.6
}
buildTypes {
release {
ext.enableCrashlytics = true
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
ext.betaDistributionEmails =email
ext.betaDistributionReleaseNotes ='测试自动发布。忽略此版本'
}
debug {
ext.enableCrashlytics = true
runProguard false
}
}
productFlavors {
production {
applicationIdcom.test.testapp
}
staging {
applicationIdcom.test.testapp。暂存
}
preprod {
applicationIdccom.test.testapp.preprod
}
}
}
依赖关系{
编译'com.android.support:support-v4:18.+'
编译'com.android.support:appcompat-v7:21.0.2'
编译项目(':lib1')
编译项目(':lib2')
}
我使用以下命令将构建的'制作'风格上传至crashlytics
assembleproductionRelease crashlyticsUploadDistributionproductionRelease
然而,我得到以下错误
在root项目中找不到任务'crashlyticsUploadDistributionproductionRelease'
这看起来类似于这个问题但是,解决方案不适合我。注意:在包含crashlytics依赖项时,我添加了一个本地crashlytics.jar。由于在编译项目时包含托管的crashlytics依赖项存在问题。
我在我的环境中进行工作配置, gradle.build不同的部分:
1. Buildscript
buildscript {
repositories {
jcenter()
maven {url'http://download.crashlytics.com/maven'}
}
依赖项{
classpath'com.android.tools.build: gradle:1.0.0'
classpath'com.crashlytics.tools.todle:crashlytics-gradle:1. +'
classpath'com.jakewharton.sdkmanager:gradle-plugin:0.12。+'
$ b
- Don '忘记申请插件
apply plugin:'crashlytics'
- 存储库
repositories {
mavenCentral()
maven {url'http://download.crashlytics.com/maven'}
}
希望这会有所帮助
My android application has a Library which includes 'crashlytics.start()'. I have only set Crashlytics.jar as a dependency for the Library project. Builds are successful.
I have multiple flavors configured in app> build.gradle file as well.
Given that one of my builds flavors are called "production", I have the following configuration in my app> build.gradle file
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.test.testapp"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "0.0.6"
}
buildTypes {
release {
ext.enableCrashlytics=true
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.betaDistributionEmails="email"
ext.betaDistributionReleaseNotes='Testing automatic release.Ignore this version'
}
debug{
ext.enableCrashlytics=true
runProguard false
}
}
productFlavors {
production {
applicationId "com.test.testapp"
}
staging {
applicationId "com.test.testapp.staging"
}
preprod {
applicationId "ccom.test.testapp.preprod"
}
}
}
dependencies {
compile 'com.android.support:support-v4:18.+'
compile 'com.android.support:appcompat-v7:21.0.2'
compile project(':lib1')
compile project(':lib2')
}
I use following command to upload the built 'production 'flavor to crashlytics
assembleproductionRelease crashlyticsUploadDistributionproductionRelease
However I get the following error
Task 'crashlyticsUploadDistributionproductionRelease' not found in root project
This looks similar to this question however the solution is not working for me. There for posting with details.
NOTE: I have added a local crashlytics.jar when including crashlytics dependency. Since including the hosted crashlytics dependency had issues when compiling the project.
解决方案 I have working configuration in my environment, so will just share gradle.build pieces that are different:
1. Buildscript
buildscript {
repositories {
jcenter()
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
}
}
- Don't forget to apply plugin
apply plugin: 'crashlytics'
- Repositories
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
}
Hope this will help
这篇关于自动测试版与crashlytics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!