简体   繁体   English

导入android studio项目时找不到参数android()方法

[英]Could not find method android() for arguments while import android studio project

when i import android studio project then arise the error could not find android error 22 hoe it is solve 当我导入android studio项目然后出现错误找不到android错误22 it这是解决

my gradle file is here 我的gradle文件在这里

buildscript
{
  repositories
  {
     jcenter()
  }
  dependencies
  {
    classpath 'com.android.tools.build:gradle:+'
  }
}



allprojects
{
   repositories
  {
    jcenter()
  }
}
task clean(type: Delete)
{
   delete rootProject.buildDir
}
android
{
  compileSdkVersion 25
  buildToolsVersion '24.0.3'
  defaultConfig
  {
    minSdkVersion 14
    targetSdkVersion 23
  }
  productFlavors
  {
  }
}

This is my gradle file and it show error like could not find the android 这是我的gradle文件,它显示错误,例如找不到android

Here is the screen shot of the error 这是错误的屏幕截图 在此处输入图片说明

So please tell me how to solve this error Thanks 所以请告诉我如何解决这个错误

Try this 尝试这个

buildscript
{
 repositories
 {
   jcenter()
 }
 dependencies
 {
 classpath 'com.android.tools.build:gradle:2.2.3'
 }
}

Do not use + in classpath 'com.android.tools.build:gradle:+' 不要在类路径'com.android.tools.build:gradle:+'中使用+

This is not where you are supposed to add android {} block. 这不是您应该添加android {}块的地方。

The project structure goes like: 项目结构如下:

DriverApp
--app
----build.gradle
--build.gradle

The android {} block is supposed to be in the DriverApp/app/build.gradle and not DriverApp/build.gradle . android {}块应该位于DriverApp/app/build.gradle ,而不DriverApp/build.gradle Move that block and it should fix your issue. 移动该块,它应该可以解决您的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Android Studio中导入项目(找不到用于参数的方法compile()) - Cant import project in Android studio(Could not find method compile() for arguments) Android Studio错误找不到模块项目上的参数的方法android() - Android Studio error Could not find method android() for arguments on module project 无法在Android Studio项目中为参数找到方法android() - Could not find method android() for arguments in Android Studio project 在 Android Studio 项目中找不到参数的方法 test() - Could not find method test() for arguments on Android studio project 在根项目 Android Studio 上找不到 arguments [:app] 的方法 include() - Could not find method include() for arguments [:app] on root project Android Studio Android Studio无法为参数找到方法runProguard()? - Android Studio Could not find method runProguard() for arguments? Android studio“找不到参数的方法实现()” - Android studio “Could not find method implementation() for arguments” 在根项目上找不到参数android()的方法… - Could not find method android() for arguments … on root project Gradle 同步失败:在 android studio 上找不到根项目参数的方法 android() - Gradle sync failed: Could not find method android() for arguments on root project on android studio Android studio错误:错误:(23,0)无法在根项目上找到方法android() - Android studio error:Error:(23, 0) Could not find method android() for arguments on root project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM