Java 在Android上启用USB调试时出错
我正在尝试根据为我的项目启用USB调试。然而,当我在build.gradle文件中写下这一点时:Java 在Android上启用USB调试时出错,java,android,android-studio,developer-tools,usb-debugging,Java,Android,Android Studio,Developer Tools,Usb Debugging,我正在尝试根据为我的项目启用USB调试。然而,当我在build.gradle文件中写下这一点时: android { buildTypes { debug { debuggable true } android:debuggable="true" /* Top-level build file where you can add configuration options common to all sub-projects/modules.*/ build
android {
buildTypes {
debug {
debuggable true
}
android:debuggable="true"
/* 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:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我得到一个错误,说:
错误:(25,0)找不到Gradle DSL方法:“android()”
可能原因:你已经在你的设备上启用USB调试了吗?发布你的
build.gradle
@Alok Gupta是的,我已经启用了。但我甚至没有在我的设备上进行调试。我发现文件本身有错误。@IntelliJAmiya我已将其作为编辑添加到问题中。