Android 无法同步年级项目
将此行添加到我的build.gradle后Android 无法同步年级项目,android,build.gradle,Android,Build.gradle,将此行添加到我的build.gradle后 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' // in t
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// in the individual module build.gradle files
compile "com.android.support:support-core-utils:25.0.1"
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
和同步渐变文件。我得到这个错误
然后我按照链接打开Android SDK管理器,我发现我已经安装了Android支持库
我之所以将此文件添加到我的成绩中,是因为它已发布,这将解决我的初始错误,其中
Cannot resolve symbol 'TabsPagerAdapter'
这一行:
compile“com.android.support:support-core-utils:25.0.1”
位于另一个build.gradle文件中。。如果要将其添加到主build.gradle中,则应将其添加到应用程序模块的特定gradle文件中。根据错误消息,将compile
行放在build.gradle
文件中的错误位置。你可以考虑编辑你的问题并发布完整的代码> Bug .Goelle 文件。好的,我做了你的建议编辑。你想把编译行放在哪里?Matias的回答涵盖了这一点。FWIW,我提出了关于安装Android支持库的错误建议。另外,关于TabsPagerAdapter
,我在Android SDK中找不到这样的类,因此这似乎是一个单独的问题。