【问题标题】:Why can't gradle find com.google.dexmaker?为什么gradle找不到com.google.dexmaker?
【发布时间】:2016-06-13 21:21:53
【问题描述】:

目前正在处理https://github.com/lucasr/probe 的一个分支。刚开始,但由于某种原因,当我尝试构建它时,我多次收到此错误:

/Users/me/probe/library/src/main/java/org/lucasr/probe/DexProxyBuilder.java:27: error: package com.google.dexmaker does not exist
import com.google.dexmaker.Code;

我真的不知道这是怎么回事,因为库项目的 build.gradle 有:

dependencies {
    compile 'com.google.dexmaker:dexmaker:1.2'
}

编辑:完整build.gradle

apply plugin: 'com.android.library'
apply plugin: 'maven'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion "21.1.2"
}

dependencies {
    compile 'com.google.dexmaker:dexmaker:1.2'
}

apply from: "${rootDir}/gradle/scripts/gradle-mvn-push.gradle"

afterEvaluate { project ->
    uploadArchives {
        repositories {
            mavenDeployer {
                pom.whenConfigured {
                    def dep = dependencies.find { it.groupId == 'com.google.dexmaker' }
                    dep.optional = true
                    dep.scope = null
                }
            }
        }
    }
}

【问题讨论】:

  • 请出示完整的build.gradle 文件。
  • 看这个密切相关的讨论here,我想你可能还得把compile改成androidTestCompile
  • 很遗憾,改成androidTestCompile没有效果,可能是在项目的测试之外使用。

标签: android maven android-layout gradle dexmaker


【解决方案1】:

dexmaker Github 说:

Gradle 用户可以通过这种方式导入项目:

testCompile "com.crittercism.dexmaker:dexmaker:1.4"
testCompile "com.crittercism.dexmaker:dexmaker-dx:1.4"
testCompile "com.crittercism.dexmaker:dexmaker-mockito:1.4"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-07
    • 2011-06-17
    • 2020-11-18
    • 1970-01-01
    相关资源
    最近更新 更多