简体   繁体   English

构建APK正常运行时,Android Build无法运行项目

[英]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.

相关问题 Android Studio在同一部手机上运行应用程序时生成的APK崩溃正常。 怎么了? - Android Studio generated APK crashes while running the application on the same phone works fine. What is wrong? Android BUILD FAILED同时发布apk - Android BUILD FAILED while release apk 构建 apk 时出现 Android 本机构建问题错误 - Android Native Build Issue error while building apk 构建 android apk、ionic 2 项目时无法加载包装器属性 - Wrapper properties fail to load while building android apk, ionic 2 project 在muti项目android应用中构建apk文件时出错? - error while building apk file in a muti project android app? 为本机Android项目构建APK时目标不兼容 - incompatible target while building apk for Native Android Project 在android studio中为flutter项目构建APK时出错 - error while building APK in android studio for flutter project 我收到此错误 Execution failed for task:app:processDebugMainManifest while running with npm run android 但使用 android studio 运行正常 - i got this error Execution failed for task :app:processDebugMainManifest while running with npm run android but with android studio it works fine 在Android中构建APK时出错 - error while building the apk in android Android - 运行应用程序时生成失败错误 - Android - Build Failed error While Running an App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM