android-notes / SwissArmyKnife

android ui调试工具
MIT License
1.35k stars 230 forks source link

Failed to resolve: com.wanjian:sak:0.0.2 #6

Closed HXQWill closed 7 years ago

HXQWill commented 7 years ago

你好,我想问一下为什么编译失败?

我在根目录build.gradle下dependencies中添加了这一行代码。 我的Android Studio版本是2.2。 classpath 'com.android.tools.build:gradle:2.1.2' distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

android-notes commented 7 years ago

在 module下的build.gradle中的dependencies{}中加入 compile 'com.wanjian:sak:0.0.2' ,如: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.0.1' testCompile 'junit:junit:4.12' compile 'com.wanjian:sak:0.0.2' }

HXQWill commented 7 years ago

恩,这行代码我放在类似的地方,但下载失败。 提示: Failed to resolve:'com.wanjian:sak:0.0.2'

android-notes commented 7 years ago

我这边可以的,你可以直接把代码下载下来也可以、

HXQWill commented 7 years ago

恩,我打算将它下载下来后将其作为Module导入,然后添加项目依赖。 但作为Module导入后,编译报错: Plugin with id 'com.novoda.bintray-release' not found.

android-notes commented 7 years ago

感谢反馈,是过期了,刚重新上传了,应该最迟明天就可以用来

android-notes commented 7 years ago

com.novoda.bintray-release 是上传aar到jfrog用的,报错可以删掉相关的内容

HXQWill commented 7 years ago

在相应位置添加: compile 'com.wanjian:sak:0.0.2' 提示: Failed to resolve:'com.wanjian:sak:0.0.2'

将它下载下来后将其作为Module导入,然后添加项目依赖。 但作为Module导入后,编译报错: Plugin with id 'com.novoda.bintray-release' not found. 删掉这行代码后编译,报错: Error:(38, 0) Could not find method publish() for arguments [build_f5hsnpjf9rhf3an2verbdsh0l$_run_closure3@66b448c9] on project ':appSwissArmyKnife' of type org.gradle.api.Project.

android-notes commented 7 years ago

前几天审核通过了,加入 compile 'com.wanjian:sak:0.0.2' 就可以,是不是没有科学上网?最近会上传一份同样的到国内maven仓库,方便使用

HXQWill commented 7 years ago

刚才在科学上网的环境下加入 compile 'com.wanjian:sak:0.0.2' 依然提示: Failed to resolve:'com.wanjian:sak:0.0.2'

android-notes commented 7 years ago

怎么会 /😲 ,gradle clean一下,android studio clean一下。或者新建个工程试试,或者使用阿里云maven镜像 。project 的gradle中按如下配置

buildscript { repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

android-notes commented 7 years ago

阿里云镜像中是有的 http://maven.aliyun.com/nexus/content/groups/public/com/wanjian/sak/