我启用了开发人员选项,并更新了驱动程序( OS win10说),并且我遵循了文档的说明。我的舱单:
<application
android:debuggable="true" //this line says it shouldnt be harcoded?
android:allowBackup="true"
android:icon="@drawable/ic_piano"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">以及构建等级文件:
android {
// 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'
// 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
}
android {
buildTypes {
debug {
debuggable true
}从文档中复制的清单代码和生成代码。但它没有通过build.graddle。它说:“我不知道这是什么意思,因为我已经做了文档上说的所有事情。我在这里讲过所有的答案,但是没有worked...Any的想法吗?链接:https://developer.android.com/studio/run/device.html。
发布于 2017-01-01 19:58:26
你把你的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'
// 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
}注意,这是您的顶级build.gradle,它将位于项目的根目录中。应该在一个可能名为的文件夹中添加另一个 build.gradle,这是您添加和修改android{} gradle clojure的文件
https://stackoverflow.com/questions/41418383
复制相似问题