在 android eclipse 项目中使用新的 firebase sdk
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37319236/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Use new firebase sdk in android eclipse project
提问by Makalele
new firebase with awesome features was just announced, but according to documentation (https://firebase.google.com/docs/android/setup#prerequisites) android studio (as well as gradle) is required now. For now in my cocos2d-x apps I have to use ADT/Eclipse to build apps, because gradle isn't supported yet (however cocos2d-x team is working on it). I'm now using an older version of the sdk, which is just a jar file. Is there a way to use new firebase in eclipse? What worries me the most is that plugin:
刚刚宣布了具有出色功能的新 Firebase ,但根据文档(https://firebase.google.com/docs/android/setup#prerequisites),现在需要 android studio(以及 gradle)。现在在我的 cocos2d-x 应用程序中,我必须使用 ADT/Eclipse 来构建应用程序,因为尚不支持 gradle(但是 cocos2d-x 团队正在研究它)。我现在使用的是旧版本的 sdk,它只是一个 jar 文件。有没有办法在eclipse中使用新的firebase?最让我担心的是那个插件:
apply plugin: 'com.google.gms.google-services'
回答by Francisco Durdin Garcia
Take a look at this Github repository, I was using it as example to use Firebase with Eclipse (but finally I moved my project to Android Studio with Gradle because it was really awful).
看看这个 Github 存储库,我使用它作为示例将 Firebase 与 Eclipse 结合使用(但最终我将我的项目移至带有 Gradle 的 Android Studio,因为它真的很糟糕)。
README Project: https://github.com/dandar3/android-google-firebase-README
自述项目:https: //github.com/dandar3/android-google-firebase-README
Actual Project: https://github.com/dandar3/android-google-firebase-common
实际项目:https: //github.com/dandar3/android-google-firebase-common
回答by usajnf
I agree with ErstwhileIII . We will have to migrate soon. In the meantime, try this: https://stackoverflow.com/a/37891421/6079935
我同意 ErstwhileIII 。我们将不得不很快迁移。同时,试试这个:https: //stackoverflow.com/a/37891421/6079935
回答by Dan Dar3
Have a look at this repository:
https://github.com/dandar3/android-google-firebase-README
看看这个存储库:https:
//github.com/dandar3/android-google-firebase-README
There is a video at the end showing how to easily download the entire set of libraries (requires Subversive plugin, see the video above it).
最后有一个视频,展示了如何轻松下载整套库(需要 Subversive 插件,请参阅上面的视频)。
UPDATE:
更新:
Read all you need here:
http://dandar3.blogspot.com/2016/11/eclipse-integrate-firebase-analytics.html
在这里阅读您需要的所有内容:http:
//dandar3.blogspot.com/2016/11/eclipse-integrate-firebase-analytics.html
In short, it's all about:
简而言之,它是关于:
- following the
Processing the JSON file
section in the Google Services Gradle plugin documentation to bring the google-services.json configuration into your project - see https://firebase.google.com/docs/reference/gradle/#processing_the_json_file - updating AndroidManifest.xml to add all the permissions, receivers, service etc that the Gradle plugin would generate for you in Android Studio (
app\intermediates\manifests\full\debug\AndroidManifest.xml
).
- 按照
Processing the JSON file
Google Services Gradle 插件文档中的部分将 google-services.json 配置引入您的项目 - 请参阅https://firebase.google.com/docs/reference/gradle/#processing_the_json_file - 更新 AndroidManifest.xml 以添加 Gradle 插件将为您在 Android Studio (
app\intermediates\manifests\full\debug\AndroidManifest.xml
) 中生成的所有权限、接收器、服务等。
回答by ahmed haron
Open Properties on your app and click add external JARs.
在您的应用程序上打开属性,然后单击添加外部 JAR。
回答by ErstwhileIII
The Android team has moved away from Eclipse and onto Android Studio .. this transition has taken more than a year. You will continue to face ever increasing problems by staying on Eclipse (this issue with Firebase is one of them).
Android 团队已经从 Eclipse 转移到了 Android Studio .. 这个转变用了一年多的时间。如果继续使用 Eclipse,您将继续面临越来越多的问题(Firebase 的这个问题就是其中之一)。
I would recommend moving to Android Studio and using the cocos game development mechanism discussed (briefly) in http://discuss.cocos2d-x.org/t/poll-remove-android-adt-support/29243
我建议转到 Android Studio 并使用http://discuss.cocos2d-x.org/t/poll-remove-android-adt-support/29243 中(简要)讨论的 cocos 游戏开发机制