glassraven
glassraven

Reputation: 323

Android Studio doesnt recognize my device - LG Spirit 4G

I have developer options enabled, the driver is updated(says the OS win10), and I followed the instructions of the documentation. My manifest :

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

And the build graddle file:

     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
       }

Both manifest and build code copied from the documentation. But it fails to build.graddle. It says: expectin '}' found " I dont know what is this suposed to mean, since i've done everything the documentation says. I've serached all the answers here in SO but haven't any that worked...Any ideias? The link: https://developer.android.com/studio/run/device.html

Upvotes: 1

Views: 125

Answers (1)

Blundell
Blundell

Reputation: 76536

You have messed up your build.gradle, it should look like this:

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

Note that this is your top level build.gradle, it will sit in the root directory of your project. There should another build.gradle inside of a folder likely called /app this is the file where you add and amend the android{} gradle clojure

Upvotes: 1

Related Questions