Android Studio无法识别我的设备--LG Spirit 4G

时间:2017-01-01 19:41:17

标签: android device

我启用了开发人员选项,驱动程序已更新(操作系统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">

构建graddle文件:

     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
       }

从文档中复制清单和构建代码。但它无法构建.graddle。它说:expectin'}'发现' 我不知道这是什么意思,因为我已经完成了文档所说的一切。我已经在SO中解释了所有的答案,但没有任何有用的......任何想法? 链接:https://developer.android.com/studio/run/device.html

1 个答案:

答案 0 :(得分:1)

你搞砸了你的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,它将位于项目的根目录中。应该在名为/app的文件夹中另一个 build.gradle这是您添加和修改android{} gradle clojure的文件

相关问题