2016-06-13 108 views
0

目前在https://github.com/lucasr/probe的分岔上工作。剛剛進入開始,但由於某些原因,當我嘗試建立它,我得到這個錯誤好幾次:爲什麼不能找到com.google.dexmaker?

/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 
       } 
      } 
     } 
    } 
} 
+0

請出示您的完整'build.gradle'文件。 – ishmaelMakitla

+0

看看這個密切相關的討論[這裏](http://stackoverflow.com/questions/31219624/android-studio-gradle-cannot-find-mockito),我想你可能也必須將'compile'改成androidTestCompile '。 – ishmaelMakitla

+0

不幸的是,它沒有工作將其更改爲androidTestCompile,可能是因爲它在項目的測試之外使用。 – iHowell

回答

0

dexmaker Github上說:

搖籃用戶可以導入該項目是這樣的:

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