问题
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:
apply plugin: 'com.google.gms.google-services'
回答1:
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).
README Project: https://github.com/dandar3/android-google-firebase-README
Actual Project: https://github.com/dandar3/android-google-firebase-common
回答2:
I agree with ErstwhileIII . We will have to migrate soon. In the meantime, try this: https://stackoverflow.com/a/37891421/6079935
回答3:
Have a look at this repository:
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).
UPDATE:
Read all you need here:
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
).
回答4:
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).
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
回答5:
Open Properties on your app and click add external JARs.
https://jar-download.com/artifacts/com.google.firebase
来源:https://stackoverflow.com/questions/37319236/use-new-firebase-sdk-in-android-eclipse-project