[英]Android Build Failed in Running the Project While Building APK Works Fine
I have got a new mac from the company and cloned the project from the Git. 我从公司那里得到了一台新的Mac,并从Git克隆了该项目。 Works fine on my Windows PC. 在我的Windows PC上可以正常工作。
However it fails on the mac with this message: 但是,它在Mac上失败并显示以下消息:
Error:org.gradle.api.UnknownTaskException: Task with path 'dexBetaDebug' not found in project ':app'.
Cleaning, rebuilding, and building APK works fine but when I want to run it on my device, it fails. 清理,重建和构建APK可以正常工作,但是当我想在设备上运行它时,它会失败。
Any ideas? 有任何想法吗?
I looked deep into gradle logs and saw Crashlytics causes the problem, and ridicolously solved the problem by setting fabric dependency version speficially in app gradle. 我深入研究了gradle日志,发现Crashlytics导致了该问题,并通过在app gradle中专门设置结构依赖版本来荒谬地解决了该问题。
Problematic code was like this: 有问题的代码是这样的:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
I solved it by changing it like this: 我通过如下更改解决了它:
classpath 'io.fabric.tools:gradle:1.21.6'
It is really disappointing that the recent version of fabric causes the problem. 令人失望的是,最新版本的Fabric导致了该问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.