2016-06-15 2 views
1

Firebase를 사용하는 새로운 Android 애플리케이션을 만들고 있습니다. 필자는 goolge 가이드를 따라 Firebase SDK를 프로젝트에 추가했습니다.Android Studio - 프로젝트에 가져온 라이브러리가 너무 많아서 종속성으로 컴파일되지 않았습니다.

buildscript { 
    repositories { 
     jcenter(){ 
      url "http://jcenter.bintray.com/" 
     } 
     mavenCentral() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.0' 
     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() 
    } 
} 

그리고 응용 프로그램 build.gradle .... 나는 내 프로젝트의 외부 라이브러리 체크

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    /* For Google Play Services */ 
    //Firebase 
    //addd firebase notification - messaging. 
    //add firbaes dynamic link: 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:design:23.4.0' 
    compile 'com.android.support:support-v4:23.4.0' 
    compile 'com.android.support:cardview-v7:23.4.0' 
    compile 'com.google.android.gms:play-services-safetynet:9.0.2' 
    compile 'com.google.android.gms:play-services-auth:9.0.2' 
    compile 'com.firebaseui:firebase-ui:0.2.2' 
    compile 'com.google.firebase:firebase-messaging:9.0.2' 
    compile 'com.google.firebase:firebase-invites:9.0.2' 
    compile 'com.google.android.gms:play-services:9.0.2' 
} 
// ADD THIS AT THE BOTTOM 
apply plugin: 'com.google.gms.google-services' 

: 아래 내 프로젝트 Gradle을합니다. play-service-location-9.0.2, play-service-maps-9.0.2, play-service-nearby-9.0.2 ...과 같이 필요하지 않은 라이브러리가 너무 많습니다. enter image description here

내 프로젝트에 추가하지 않은 사용되지 않는 라이브러리를 설명하고 도와 줄 수 있습니까?

답변

2

build.gradle에서 종속성을 하나씩 삭제하여 필요없는 종속성을 제거하십시오. 종속성 중 하나를 제거한 후에 오류가 발생하는 경우 제거한 종속성을 추가하십시오.

필요없는 종속성을 제거 할 때 오류나 문제가 없으면 모든 것이 정상적으로 작동합니다.

+0

"com.google.android.gms을 컴파일하십시오 : play-services : 9.0.2 '"가 삭제되었습니다. 일부 사용하지 않는 라이브러리가 제거되었습니다. –

+0

그래서 문제가 해결 되었습니까? 마지막 코멘트를 이해하지 못했습니다. –

+0

예. 나는 그랬다. build.gradle에서 'com.google.android.gms : play-services : 9.0.2'파일을 삭제했습니다. play-service-location-9.0.2, play-service-maps-9.0.2, play-service-nearby-9.0.2와 같은 사용되지 않는 라이브러리가 제거되었습니다. 고맙습니다. –

관련 문제