Android工作室找不到类路径

时间:2017-11-07 10:36:10

标签: java android

我在android studio中的项目出错了,有一个无法修改的类路径,类路径是

dependencies {
      classpath 'com.android.tools.build:gradle:2.2.0'
             }

依赖性

dependencies {   
  classpath 'com.android.tools.build:gradle:2.2.0'    
  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:26.0.1'        
  compile 'com.android.support:design:26.0.0-alpha1'        
  compile 'com.google.android.gms:play-services-maps:11.0.4'         
  compile 'com.google.android.gms:play-services-location:11.0.4'         
  compile 'com.mcxiaoke.volley:library-aar:1.0.0'       
  compile 'com.android.support:cardview-v7:26.0.1'    
  compile 'com.android.support:recylcerview-v7:26+'     
  compile 'com.google.firebase:firebase-database:10.2.0'     
 compile 'com.google.firebase:firebase-auth:1.2.0'     
 compile 'com.firebaseui:firebase-ui-auth:1.2.0'     
 compile 'com.firebaseui:firebase-ui-database:10.2.0'    
 compile 'com.google.android.gms:play-services-maps:10.2.6'     
 testCompile 'junit:junit:4.12'
}

我添加了这个

        maven {  url "https://maven.google.com"    }

在Gradle。

1 个答案:

答案 0 :(得分:0)

Classpath应添加到 app 级别build.gradle中,而不是模块build.gradle

dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.0'
} 

请在build.gradle(项目:yourappname)

中添加此行