如何用jar文件替换google依赖项

时间:2017-12-01 18:54:56

标签: android eclipse jar dependencies

我要将google firebase消息传递给我的android项目。 Google文档提供了使用依赖项。如果我可以导入JAR文件而不是依赖项,或者需要JAR和依赖项,我很困惑?使用this method导入JAR文件是否足够?

这是Google文档:

dependencies {
     compile 'com.google.firebase:firebase-messaging:11.6.2'
}

这是google JAR文件列表:

https://github.com/nsiatras/Google-Play-Firebase-jars/tree/master/Version%209.0.1/firebase

1 个答案:

答案 0 :(得分:1)

理论上,您还可以导入JAR文件。但是,难点在于找出依赖关系的依赖关系,依赖关系的依赖关系等等,直到所有依赖关系都得到解决。

在Eclipse中,您可以使用Eclipse Buildship来解决Gradle依赖关系。

使用

repositories {
    maven {
         url 'https://maven.google.com'
    }
}

依赖项com.google.firebase:firebase-messaging:11.6.2已解析为跟随JAR / AAR文件:

https://maven.google.com/com/google/firebase/firebase-messaging/11.6.2/firebase-messaging-11.6.2.aar
https://maven.google.com/com/google/firebase/firebase-iid/11.6.2/firebase-iid-11.6.2.aar
https://maven.google.com/com/google/android/gms/play-services-basement/11.6.2/play-services-basement-11.6.2.aar
https://maven.google.com/com/google/firebase/firebase-common/11.6.2/firebase-common-11.6.2.aar
https://maven.google.com/com/google/firebase/firebase-messaging-license/11.6.2/firebase-messaging-license-11.6.2.aar
https://maven.google.com/com/google/android/gms/play-services-tasks/11.6.2/play-services-tasks-11.6.2.aar
https://maven.google.com/com/google/firebase/firebase-iid-license/11.6.2/firebase-iid-license-11.6.2.aar
https://maven.google.com/com/android/support/support-v4/25.2.0/support-v4-25.2.0.aar
https://maven.google.com/com/google/android/gms/play-services-basement-license/11.6.2/play-services-basement-license-11.6.2.aar
https://maven.google.com/com/google/firebase/firebase-common-license/11.6.2/firebase-common-license-11.6.2.aar
https://maven.google.com/com/google/android/gms/play-services-tasks-license/11.6.2/play-services-tasks-license-11.6.2.aar
https://maven.google.com/com/android/support/support-compat/25.2.0/support-compat-25.2.0.aar
https://maven.google.com/com/android/support/support-media-compat/25.2.0/support-media-compat-25.2.0.aar
https://maven.google.com/com/android/support/support-core-utils/25.2.0/support-core-utils-25.2.0.aar
https://maven.google.com/com/android/support/support-core-ui/25.2.0/support-core-ui-25.2.0.aar
https://maven.google.com/com/android/support/support-fragment/25.2.0/support-fragment-25.2.0.aar
https://maven.google.com/com/android/support/support-annotations/25.2.0/support-annotations-25.2.0.jar
https://maven.google.com/com/android/support/support-compat/25.2.0/support-compat-25.2.0-sources.jar
https://maven.google.com/com/android/support/support-media-compat/25.2.0/support-media-compat-25.2.0-sources.jar
https://maven.google.com/com/android/support/support-core-utils/25.2.0/support-core-utils-25.2.0-sources.jar
https://maven.google.com/com/android/support/support-core-ui/25.2.0/support-core-ui-25.2.0-sources.jar
https://maven.google.com/com/android/support/support-fragment/25.2.0/support-fragment-25.2.0-sources.jar
https://maven.google.com/com/android/support/support-annotations/25.2.0/support-annotations-25.2.0-sources.jar 

另请参阅:How to integrate .aar file to Eclipse