2016-06-23 23 views
0

Google +を自分のアプリに統合しようとしましたが、「com.google.android.gms.plus.Plus」クラスが見つかりません。私は最新のリリースに応じてGoogle Playサービスを更新します。android google plus integrationプロジェクトのシンボル "Plus"を解決できません

MainActivity.java:

mGoogleApiClient = new GoogleApiClient.Builder(this) 
      .enableAutoManage(this /* FragmentActivity */, 
        this /* OnConnectionFailedListener */) 
      .addApi(Plus.API) 
      .addScope(Scopes.PLUS_LOGIN) 
      .addScope(Scopes.PLUS_ME) 
      .build(); 

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.1.2' 
    classpath 'com.google.gms:google-services:3.0.0' 

    // 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(アプリケーションレベル):

apply plugin: 'com.android.application' 


android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 

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

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:design:23.4.0' 
    compile 'com.google.android.gms:play-services-auth:9.0.2' 
} 
apply plugin: 'com.google.gms.google-services' 
+1

あなたのアプリのgradleファイル 'compile 'com.google.android.gmsに以下を追加してください:play-services:9.0.2'' –

+0

ありがとう、それは働いています – Subham

+0

解決策がうまくいくなら@Subham回答は将来の訪問者のために役立つように、以下に掲載されています.. –

答えて

0

それはあなたの場合に動作しますあなたのグラデルファイルに以下を追加してください。

compile 'com.google.android.gms:play-services:9.0.2'

関連する問題