【发布时间】:2017-02-02 02:26:50
【问题描述】:
在我移至java 8 后,我在应用发布时收到此错误,因为fabric crashlytics:
Could not determine the dependencies of task ':app:crashlyticsStoreDeobsRelease'.
> Task with path 'dexRelease' not found in project ':app'.
我正在使用Android Studio 2.2,Gradle version 2.14.1,Android插件版本2.2.0
项目运行没有任何问题,但是我无法生成签名的apk!
我阅读了这篇文章 Can't run project - Android Studio 2.0 Crashlytics issues 和 Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug' if I enable the proguard,但答案对我没有帮助。
这是我的 gradle 文件:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "..."
minSdkVersion 16
targetSdkVersion 22
versionCode 17
versionName "0.14.1"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "3g"
}
signingConfigs {
release {
storeFile file("....jks")
storePassword "..."
keyAlias "..."
keyPassword "..."
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
debuggable true
signingConfig signingConfigs.release
}
debug{
debuggable true
//applicationIdSuffix ".debug"
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//Material edit text
compile 'com.rengwuxian.materialedittext:library:2.1.4'
//Circle progress bar
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.1.0'
//a divider for recyclerview
compile 'com.yqritc:recyclerview-flexibledivider:1.2.9'
//Field and method binding for Android views
compile 'com.jakewharton:butterknife:7.0.1'
//crash reporting and streamline solution for distributing apps
compile('com.crashlytics.sdk.android:crashlytics:2.6.3@aar') {
transitive = true;
}
//LeakCanary
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
compile('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
transitive = true;
}
compile project(':core')
}
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
-
将 multidex enable true 添加到您的 gradle 并清理项目
-
gradle 和 fabri 插件之间似乎有些不兼容。避免在织物的类路径中使用“+”。使用类似
classpath 'io.fabric.tools:gradle:1.20.1 -
@ShrenikShah 我启用了 multidex >>>
multiDexEnabled true但它没有帮助 -
@NarayanAcharya 我将类路径更改为最新版本 >>>
classpath 'io.fabric.tools:gradle:1.21.5'但没有帮助 -
@HamedGh 你解决了这个问题吗?
标签: java android crashlytics twitter-fabric