Sea*_*Shi 24 android proguard crashlytics
当我在Android Studio 2中运行应用程序时出现以下错误.
Gradle tasks [:app:assembleDebug]
Could not determine the dependencies of task ':app:crashlyticsStoreDeobsDebug'.
> Task with path 'dexDebug' not found in project ':app'.
BUILD FAILED
Run Code Online (Sandbox Code Playgroud)
这是模块的build.gradle
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url "http://dl.bintray.com/populov/maven" }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url "http://dl.bintray.com/populov/maven" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 17
targetSdkVersion 19
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.crashlytics.android:crashlytics:1.+'
}
Run Code Online (Sandbox Code Playgroud)
如果我将minfyEnabled设置为"false",则错误消失.但我确实希望它启用.
这是项目级别的build.gradle.
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
如果我将"2.0.0-alpha3"替换为"1.3.1",则错误也消失了.但我确实想要"2.0.0",因为我想要"即时运行"功能.
这是gradle-wrapper.properties.
#Mon Dec 21 14:43:00 CST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
Run Code Online (Sandbox Code Playgroud)
有谁知道如何修理它?谢谢.
Sol*_*ety 14
构建/清理项目+构建/重建项目+文件/无效缓存/重启的完整组合对我有用!
几天前我遇到了同样的问题,我发现这个帖子Twitter开发者论坛指出与gradle/build-tools/crashalics版本有些不兼容.
我的问题与你的问题略有不同,因为我没有使用alpha-3我正在使用1.5.但在我的更新中,我也改为最新的gradle发行版gradle-2.9-all.zip.
所以可能/也许您可以通过更改为最新的gradle版本来修复它.但如果它不起作用,你真的必须耐心等待,直到build tools V2.0不再是alpha 或 Crashalitycs团队,修复不兼容性.
在我的项目中集成 Firebase Cloud Store 时,我遇到了同样的问题。在项目级别的gradle里面,我添加了
classpath 'com.google.gms:google-services:4.0.1'
Run Code Online (Sandbox Code Playgroud)
解决了这个问题。
您可以在项目目录中运行此命令。基本上它只是清理构建和 gradle。
cd android && rm -R .gradle && cd app && rm -R build
Run Code Online (Sandbox Code Playgroud)
就我而言,我使用react-native,将其用作 package.json 中的脚本
"scripts": { "clean-android": "cd android && rm -R .gradle && cd app && rm -R build" }
Run Code Online (Sandbox Code Playgroud)
小智 5
我遇到了同样的问题,我通过替换应用程序级别 Build.gradle 文件中的依赖项解决了这个问题
”“”
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'androidx.multidex:multidex:2.0.0'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
androidTestImplementation 'com.androidx.support.test:runner:1.1.0'
androidTestImplementation 'com.androidx.support.test.espresso:espresso-core:3.1.0'
Run Code Online (Sandbox Code Playgroud)
经过
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:26.1.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.androidx.support.test:runner:1.1.0'
androidTestImplementation 'com.androidx.support.test.espresso:espresso-core:3.1.0'
Run Code Online (Sandbox Code Playgroud)
这解决了我的问题。
| 归档时间: |
|
| 查看次数: |
42436 次 |
| 最近记录: |