2016-10-12 2 views
0

공식 사이트에 제시된 단계에 따라 Firebase를 내 앱에 통합하려고했습니다. Google Play 서비스와 관련하여 몇 가지 오류가 발생합니다. 내 응용 프로그램 폴더에 또한 구글 - service.json 파일을 추가 한앱에 Firebase 통합 : "com.google.firebase : firebase-core : 9.6.1을 찾을 수 없습니다."

// 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.0' 
     classpath 'com.google.gms:google-services:3.0.0' 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 


allprojects { 
    repositories { 
     jcenter() 
     maven { url "https://jitpack.io" } 
    } 

} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

: 여기

apply plugin: 'com.android.application' 
    apply plugin: 'io.fabric' 
    apply plugin: 'android-apt' 
    apply plugin: 'newrelic' 

    android { 
     compileSdkVersion 23 
     buildToolsVersion '23.0.2' 

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/ASL2.0' 
    } 

    defaultConfig { 

     /** 
     * applicationId uniquely identifies the package for publishing. 
     * However, your source code should still reference the package name 
     * defined by the package attribute in the main/AndroidManifest.xml file. 
     */ 

     applicationId "com.mobiefit.walk" 

     // Defines the minimum API level required to run the app. 
     minSdkVersion 15 

     // Specifies the API level used to test the app. 
     targetSdkVersion 19 

     versionCode 10 
     versionName "1.3.3" 


     multiDexEnabled true 
     dexOptions { 
      javaMaxHeapSize "4g" 
     } 
     lintOptions { 
      checkReleaseBuilds false 
      abortOnError false 
     } 

    } 

    signingConfigs 
      { 
       release { 
        storeFile file("release_build_keystore.jks") 
        storePassword "mobiefit" 
        keyAlias "mobiefit-walk-release" 
        keyPassword "mobiefit" 
       } 
       debug { 
          storeFile file("debug_build_keystore.jks") 
          storePassword "mobiefit" 
          keyAlias "debug-build-keystore" 
          keyPassword "mobiefit" 
         } 
      } 


    buildTypes { 

     /** 
     * By default, Android Studio configures the release build type to enable code 
     * shrinking, using minifyEnabled, and specifies the Proguard settings file. 
     */ 
     release { 
      signingConfig signingConfigs.release 
      minifyEnabled true // Enables code shrinking for the release build type.P 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      resValue "string", "facebookAppId", "640495806088842" 
     } 
     debug { 
     /* ext.enableCrashlytics = false//for Crashlytics */ 
      signingConfig signingConfigs.debug 
      applicationIdSuffix ".debug" 
      minifyEnabled false // Disables code shrinking for the debug build type. 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      resValue "string", "facebookAppId", "215337192218344" 
     } 
    } 

} 

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
     mavenCentral() 
    } 
    dependencies { 
     // The Fabric Gradle plugin uses an open ended version to react 
     // quickly to Android tooling updates 
     classpath 'io.fabric.tools:gradle:1.+' 
     classpath "com.newrelic.agent.android:agent-gradle-plugin:5.+" 
    } 
} 
apply plugin: 'com.android.application' 
//Put Fabric plugin after Android plugin 
apply plugin: 'io.fabric' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 


dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile files('libs/commons-collections4-4.0.jar') 
    compile files('libs/YouTubeAndroidPlayerApi.jar') 
    compile files('libs/graphview-3.1.jar') 
    compile files('libs/httpcore-4.3.1.jar') 
    testCompile 'junit:junit:4.12' 
    compile project(':progresslibrary') 
    compile files('libs/gson-2.6.2.jar') 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.2' 
    compile 'com.android.support:multidex:1.0.0' 
    compile 'com.hrules:charter:1.4.0' 
    compile 'com.android.support:multidex:1.0.0' 
    compile 'com.hrules:charter:1.4.0' 
    compile 'com.amazonaws:aws-android-sdk-core:2.+' 
    compile 'com.amazonaws:aws-android-sdk-s3:2.+' 



    compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28' 
    compile 'com.facebook.android:facebook-android-sdk:4.0.0' 
    compile 'com.snappydb:snappydb-lib:0.5.2' 
    compile 'com.google.android.gms:play-services-auth:9.0.0' 
    compile 'com.google.android.gms:play-services-plus:9.0.0' 
    compile 'com.google.android.gms:play-services-gcm:9.0.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.google.android.gms:play-services-location:9.0.0' 
    compile 'com.wdullaer:materialdatetimepicker:2.2.0' 
    compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2' 

    compile 'com.shamanland:fab:0.0.8' 

    compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0' 
    compile 'com.github.hotchemi:permissionsdispatcher:2.1.2' 

    compile 'com.google.android.gms:play-services-analytics:9.0.0' 
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.15' 





    compile 'com.android.support:design:23.2.1' 
    compile 'com.android.support:support-v4:23.2.1' 
    compile 'com.android.support:recyclerview-v7:23.1.0' 
    compile 'com.android.support:cardview-v7:23.2.1' 
    compile 'com.android.support:appcompat-v7:23.0.1' 

    apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.2' 
    compile 'com.google.android.gms:play-services-analytics:9.0.0' 
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.15' 
    compile 'org.jsoup:jsoup:1.9.1' 
    compile 'com.flurry.android:analytics:6.2.0' 
    compile 'com.google.android.gms:play-services-fitness:9.0.0' 
    compile 'com.google.android.gms:play-services-appindexing:9.0.0' 
    compile 'com.github.danielemaddaluno.androidupdatechecker:library:1.0.2' 

    compile 'com.github.hotchemi:permissionsdispatcher:2.1.2' 
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1' 
    compile 'com.android.support:recyclerview-v7:23.2.1' 
    compile 'com.newrelic.agent.android:android-agent:5.+' 

    compile 'com.github.PhilJay:MPAndroidChart:v2.2.4' 

    // segment 

    compile('com.segment.analytics.android:analytics-core:+') { 
     transitive = true 
    } 
    // firebase 

    compile 'com.google.firebase:firebase-core:9.6.1' 
    compile 'com.google.firebase:firebase-crash:9.6.1' 
    compile 'com.google.firebase:firebase-messaging:9.6.1' 
    compile 'com.google.firebase:firebase-invites:9.6.1' 

} 

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

apply plugin: 'build-announcements' 
apply plugin: 'com.google.gms.google-services' 

내 프로젝트/build.gradle입니다 :

여기 내 build.gradle입니다. 이 오류가 발생합니다

Error:Could not find com.google.firebase:firebase-core:9.6.1. 
Required by: 
    mobiefitwalk:app:unspecified 

누군가가 문제를 해결할 수있는 방법을 알려주십시오.

+0

업데이트합니다'buildToolsVersion'에를 그 이동 안드로이드 SDK 관리자를 제안하고 구글이 서비스를 재생이 두 라이브러리의 최신 버전을 설치 24.0 + + –

+0

SDK 도구를 업데이트 해보십시오. –

+0

당신은 정말로 [mcve]로 시작해야합니다. 그리고 또 다른 요점 : Gradle 의존성으로 무엇을하고 있는지 이해하려고 노력하십시오. 중복 된 숫자가 많습니다. 앱에 많은 라이브러리를 추가하는 것도 안티 패턴입니다 –

답변

0

Android Studio 2.2를 사용하는 경우 톱 메뉴의 도구로 이동 한 다음 firebase를 클릭하십시오. 지침을 따르십시오. 또는 JSON 파일 com.google.firebase:firebase-core:9.0.1

에 그리고 대한 Gradle을

com.google.firebase:firebase-core:9.6.1 변화는 개발자 사이트를 통해 제공 중포 기지 지시를 따르십시오.

이 링크는 JSON 파일을 당신을 도울 수 : https://firebase.google.com/docs/server/setup

+0

왜 다운 그레이드를 권하고 있습니까? –

+0

안정적이지 않으므로 자신의 SDK가 업그레이드되지 않았을 수 있습니다! 그래서 이유가 있습니다! –

+0

충분히 안정되어 있으며 문서가 공개되어 있습니다. 게다가, 이것은 당신이 원하는 올바른 링크입니다. https://firebase.google.com/docs/android/setup –

1

나는, 구글 저장소

+0

내 sdk를 24.0.2로 업데이트했지만 여전히 오류가 발생했습니다. 오류 : 오류 : 중복 된 리소스 –

+0

중복 항목이있는 것 같습니다. –

관련 문제