2017-10-08 12 views
0

コードを実行するたびにこの実行エラーが発生し、 'googleservices.json'が自分のアプリケーションフォルダに存在します。私のSDKのバージョンも更新が、まだそれは、これらのコード行にエラーを与えている:アンドロイド: "googleservices.json"はありませんか?

compile 'com.android.support:design:24.2.0' 
compile 'com.android.support:appcompat-v7:24.2.0' 
compile 'com.github.bumptech.glide:glide:3.6.1' 

エラーメッセージ:

Error:Execution failed for task ':app:processDebugGoogleServices'. 
> File google-services.json is missing. The Google Services Plugin cannot 
function without it. 
    Searched Location: 
    C:\Users\hp\AndroidStudioProjects\Friendly Chat\app\src\debug\google- 
services.json 
    C:\Users\hp\AndroidStudioProjects\Friendly Chat\app\google-services.json 

そして、これが私のbuild.gradleのコードです。

apply plugin: 'com.android.application' 

repositories { 
    mavenLocal() 
    flatDir { 
     dirs 'libs' 
    } 
} 

android { 
    compileSdkVersion 24 
    buildToolsVersion '25.0.0' 

    defaultConfig { 
     applicationId "com.google.firebase.udacity.friendlychat" 
     minSdkVersion 16 
     targetSdkVersion 24 
     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(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 

    compile 'com.android.support:design:24.2.0' 
    compile 'com.android.support:appcompat-v7:24.2.0' 

    // Displaying images 
    compile 'com.github.bumptech.glide:glide:3.6.1' 
} 
apply plugin: 'com.google.gms.google-services' 
+0

https://developers.google.com/android/guides/google-services-plugin – Yoni

+0

の間にハイフンが欠落していますgoogle-services.json " – WitVault

+0

@WitVaultの名前は同じです。それでも私はこのエラーが発生しています。 –

答えて

0

@Iqra JSONファイルにパッケージ名が同じであることを確認してください

+0

ええ同じです –

0

あなたのパスにスペース文字が含まれているため、このエラーを得ている理由。 C:\Users\hp\AndroidStudioProjects\Friendly Chat\app\google-services.json ご覧のとおり、Friendly Chatにスペースがあります。

このスペースをディレクトリ名(プロジェクト名)から削除し、google-services.jsonappディレクトリに貼り付けます。

1つのアドバイス - 「製品を開発する際に、ファイル名やモジュール名、ディレクトリ名にスペース文字を使用しないでください」。

+0

まだエラーがあります –

+0

プロジェクト構造のスクリーンショットを貼り付けることはできますか?そのようなもの - https://i.stack.imgur.com/DyBJS.png –

0

開発者のサイトから設定ファイルを取得し、プロジェクトフォルダのアプリレベルディレクトリに貼り付ける必要があります。

0

それはgoogleservices.json

ないgoogleservices.json。

あなたは、その名は "と同じであることを確認して「GOOGLE」と「サービスの

関連する問題