2017-01-01 139 views
1

我有開發人員選項啓用,驅動程序更新(稱爲操作系統win10),我按照文檔的說明。我的清單:Android Studio無法識別我的設備 - LG Spirit 4G

<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 
     } 

兩個清單,並構建代碼的文檔複製。但它無法build.graddle。它說︰expectin'}'發現「 我不知道這是什麼意思,因爲我已經做了所有的文件說。我已經在這裏所有的答案,所以沒有任何工作......任何ideias 鏈接:https://developer.android.com/studio/run/device.html

+0

是整個'build.gradle'文件嗎?如果是,那麼這就是你的問題 – Blundell

+0

不,當然不是,它只是文檔中的一行,我將編輯帖子 – glassraven

+0

你還應該鏈接哪些文檔是指 – Blundell

回答

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,它會坐下在你的項目的根目錄中,應該有另一個 build.gradle在一個可能被稱爲的文件夾內這是你添加和修改android{} gradle clojure的文件

+0

好吧,漸進式運行,但當我按」播放「我唯一看到的東西是模擬器...在您的設備上沒有任何實際設備 – glassraven

+0

,是否啓用了USB調試?https://www.google.co.uk/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q = android%20enable%20usb%20debugging – Blundell

+0

謝謝blundell,它工作:) – glassraven

相關問題