Tinker: 添加gradle依赖遇见问题了?please help me!

Created on 1 Jun 2017  ·  14Comments  ·  Source: Tencent/tinker

当我Try Again之后,提示:
Error:Could not GET 'https://jcenter.bintray.com/com/tencent/tinker/tinker-patch-gradle-plugin/1.7.11/tinker-patch-gradle-plugin-1.7.11.pom'. Received status code 400 from server: Bad Request
Enable Gradle 'offline mode' and sync project
or
Error:No cached version of com.tencent.tinker:tinker-patch-gradle-plugin:1.7.11 available for offline mode.
Disable Gradle 'offline mode' and sync project

下面是我Gradle的接入:
项目中:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath ‘com.tencent.tinker:tinker-patch-gradle-plugin:1.7.11’

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

}
app中:
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.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'

//可选,用于生成application类
provided('com.tencent.tinker:tinker-android-anno:1.7.11')
//tinker的核心库
compile('com.tencent.tinker:tinker-android-lib:1.7.11')

}

All 14 comments

Error:No cached version of com.tencent.tinker:tinker-patch-gradle-plugin:1.7.11 available for offline mode.
Disable Gradle 'offline mode' and sync project

这个明显的问题,把offline mode关掉就好了。

@FlyInTheSkyToMe 在设置中关闭offline mode。。这种问题就不要提了吧,google下就知道

@iluhcm @memorycj 我之前试过,我刚又试了一次, 还是不行。

https://jcenter.bintray.com/com/tencent/tinker/tinker-patch-gradle-plugin/1.7.11/

看看你的网络环境是否能访问这个目录,如果可以,就是你配置有问题。如果你认为一切都没问题,就重启AS。

@iluhcm 可以访问。感谢您! 如果实在不行,我就卸载AS再重新装。

@iluhcm 大神, 我卸载了AS, 然后重装, 还是不行。还是这个错。 我要抓狂了。Please help me !我的AS版本是2.3.1

把这个钩去掉也不行么?

是的, 我刚刚又把我的配置那些都删除了,重新生成, 还是不行。 我该怎么办?

不可能的,如果还提示offline,那就是AS读取的配置和你删除的配置是两份配置,你可能删错地方了。取消打钩,然后点apply,重启AS,一般就可以了。如果还不行那就是你的电脑有问题。

classpath ('com.tencent.tinker:tinker-patch-gradle-plugin:1.6.2'), 这个版本我就能正常引用

能正常引用很有可能是你的本地maven库已经把相关的依赖下载下来了。

看一下下面这个目录对应有几个tinker plugins版本?

/Users/用户名/.m2/repository/com/tencent/tinker/tinker-patch-gradle-plugin

看一下目录下的maven-metadata-local.xml文件,有哪些version?

要不, 你远程我嘛,帮我看一下嘛。还是不行的话,我就换电脑,重新下载java,AS,重新安装来试一试,这是我最后一招了,还是不行的话,我真没法子了。关键是我朋友的AS就能正常引用,我的就不行了。 麻烦您了! QQ:470429998

@iluhcm 兄弟, 我成功了。 我把所有、一切与AS相关的文件卸载以及删除掉,然后清理了一下电脑。最后成功了。我发现此时我很淡定。感谢您!

检查网络以及代理配置

Was this page helpful?
0 / 5 - 0 ratings