2017-01-01 19 views
1

開発者向けのオプションが有効になっています。ドライバが更新されています(OS win10と書かれています)。私のマニフェスト:Androidスタジオでデバイスが認識されません - 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 
     } 

マニフェスト両方とドキュメントからコピーしたコードをビルドします。しかしそれは失敗する。それは言う:expectin '}'が見つかりました 私はドキュメントが言うすべてを行ったので、これは意味するために、このsuposedが何であるかわかりません。私はここですべての答えをserachedしたが、どれideias リンク:?あなたのbuild.gradleを台無しにしている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 
} 

注意をプロジェクトのルートディレクトリにあります。もう1つ build.gradleはおそらくと呼ばれるフォルダの内部にあります。これは、android{}グラデルクロージャを追加して修正するファイルです

+0

これは、グラデーションが動作していますが、「再生」を押すと表示される唯一のことですエミュレータです...実際のデバイスはありません。お使いのデバイスの – glassraven

+0

は、USBデバッグを有効にしていますか?https://www.google.co.uk/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q =アンドロイド%20enable%20usb%20debugging – Blundell

+0

おかげでblundell、それは働いた:) – glassraven

関連する問題