我正在使用Firebase创建一个新的Android应用程序。我按照goolge指南将Firebase SDK添加到我的项目中。
以下是我的项目gradle:
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'
我 checkin 了我的项目的外部库。我不需要太多的库,例如:play-service-location-9.0.2,play-service-maps-9.0.2,play-service--nearby-9.0.2 ...
enter image description here
您能解释一下并帮助我减少未添加到项目中的未使用的库吗?
最佳答案
尝试通过从build.gradle逐个删除依赖项来删除不需要的依赖项,如果在删除其中一个依赖项后出现错误,请添加刚刚删除的依赖项。
只要在删除不需要的依赖项时没有任何错误或问题,一切都会好起来的。
关于android-studio - Android Studio-导入的库太多,即使它们未在依赖项中进行编译也无法投影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37832459/