2017-09-13 2 views
0

私はGoogleカレンダーの作業をしようとしていますが、私はFIrebaseとGoogle APIの両方が必要かどうかわかりません。FirebaseとGoogleをコンパイルしますか?

私は `

Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials).setApplicationName("applicationName").build(); 
    // Retrieve an event 
    Event event = service.events().get('primary', "eventId").execute(); 

    System.out.println(event.getSummary()); 
    texty = (TextView)findViewById(R.id.texty1); 
    Button b2 = (Button)findViewById(R.id.button2); 

    b2.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View view) { 
      new doit().execute(); 

     } 
    }); 

このコードをテストしようとしています。しかし、私の両方がFirebaseとGoogleのAPIを持っていても、私は必要なライブラリをインポートすることはできません。

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 
    defaultConfig { 
     applicationId "com.ticketApp.myName.ticketApp" 
     minSdkVersion 15 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 


Calendar service = new Calendar.Builder(httpTransport, jsonFactory, credentials).setApplicationName("applicationName").build(); 

    // Retrieve an event 
    Event event = service.events().get('primary', "eventId").execute(); 

android { 
    configurations.all { 
     resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' 
    } 
} 


dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
}) 

//Extra dependecies 


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

//androidTestCompile 'com.google.code.findbugs:jsr305:3.0.1' 


//Google firebase 
compile 'com.google.firebase:firebase-core:11.2.2' 




//compile 'com.android.support:appcompat-v7:26.+' 
compile 'com.squareup.picasso:picasso:2.5.2' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.facebook.android:facebook-android-sdk:[4,5)' 



//Jsoup för kalendern 
compile 'org.jsoup:jsoup:1.10.3' 

testCompile 'junit:junit:4.12' 
compile 'junit:junit:4.12' 

}

// ADD THIS AT THE BOTTOM 
apply plugin: 'com.google.gms.google-services' 

任意のアイデア:これは私のbuild.gradleファイルのですか?それは、 'builder'シンボル、 'events'や 'getSummary'のいずれのメソッドも解決できないと言います。

よろしくお願いします。

+0

[sample build.gradle](https://developers.google.com/google-apps/calendar/quickstart/android#step_4_pr)があります。 epare_the_project)をクイックスタートプロジェクトに追加します。それはあなたのリストにないいくつかの依存関係を持っています。 –

答えて

1

ことは、これを解決するために、あなたのbuild.gradleファイル(モジュール:アプリ)を開いて、このような依存関係の前Maven Central Repositoryを追加します。

compile 'com.facebook.android:facebook-android-sdk:[4,5)' 

と:

repositories { 
    mavenCentral() 
} 

は、その後のコード行を変更します

compile 'com.facebook.android:facebook-android-sdk:4.+' 
関連する問題