2016-11-01 4 views
-4

für firebasse Storage. Beim Hinzufügen von Classpath 'com.google.gms: google-services: 3.0.0' zu build.gradle (Projektmodul) und Synchronisieren des Projekts.Sie geben einen Fehler vor vorzeitigem Ende der Datei an.Android Studio - Fehler: Vorzeitiges Ende der Datei

dies ist build.gradle (APP-Modul)

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.example.ammar.backupcontacts_sms" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/NOTICE' 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile 'com.firebase:firebase-client-android:2.5.2+' 
    compile 'com.jakewharton:butterknife:7.0.1' 
    compile 'commons-lang:commons-lang:2.6' 
    compile 'com.google.firebase:firebase-auth:9.6.0' 
    compile 'com.google.firebase:firebase-storage:9.6.0' 
    compile 'com.google.android.gms:play-services:9.8.00' 
} 
apply plugin: 'com.google.gms.google-services' 

build.gradle (Projektmodul)

// 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' 
     classpath 'com.google.gms:google-services:3.0.0' 
     /*classpath 'com.google.gms:google-services:1.3.0-beta1'*/ 
     // 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 
} 

Error:Premature end of file.

+0

Ich denke, sie nicht zeigen eine elementare Kenntnisse der Feuerbasis Downvoted werden. Auch um uns nicht zu sagen, wie Sie bisher Fehler behoben haben. –

+1

Bitte keine Screenshots anhängen. Bearbeiten Sie Ihre Frage, um relevanten Code als Text hinzuzufügen – rafid059

Antwort

0

Löschen .gradle/Caches fol Das hat das Problem für mich gelöst.

[Für Linux (Solus) können Sie den .gradle Ordner in Startseite finden. Wenn Sie es nicht sehen, ist es wahrscheinlich CTRL+H versteckt versteckte Ordner sehen]

Hoffe, es hilft :)

+0

Hat nicht für mich funktioniert :( –

Verwandte Themen