15

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'
Makalele
  • 7,431
  • 5
  • 54
  • 81
  • 1
    Have you tried to migrate your project to Android Studio? [Here](http://stackoverflow.com/questions/34207158/cocos2dx-based-project-in-android-studio-using-gradle-experimental-plugin) you have an Cocos2dx based project in android-studio using **gradle-experimental** plugin. – Gustavo Morales May 24 '16 at 15:10
  • It's very complex and troublesome right now and I prefer something more stable in production apps. Just few days ago Android Studio started supporting cmake, but it's still way to go and fix some bugs and other problems. I wondered if there's any workaround to just get new firebase working. Later (when gradle will be officially supported by cocos2d-x) I'd for sure migrate my projects. – Makalele May 25 '16 at 06:21

5 Answers5

5

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

halfer
  • 19,824
  • 17
  • 99
  • 186
Francisco Durdin Garcia
  • 12,540
  • 9
  • 53
  • 95
  • Thanks for sharing! I needed just that. Though I can't try if it's working until monday :) – Makalele May 29 '16 at 01:11
  • @Francisco Durdin Garcia can you be more specific. How to use that? – Soubhab Pathak Sep 20 '16 at 02:24
  • i tried it but can't found the classes i just find FirebaseApp class while can't get com.google.firebase.iid.FirebaseInstanceId classes what should i do ? – Mohamed Atef Oct 11 '16 at 07:13
  • Guys, have a look at this repository for details. https://github.com/dandar3/android-google-firebase-README – Dan Dar3 Nov 04 '16 at 15:32
  • @DanDar3 do you have same build for firebase crash report for eclipse – Hunt May 14 '17 at 18:44
  • 1
    @Hunt Not yet, but it has been requested already and working on it for 10.2.4 release. Curretly working to workaround an issue with strings and styleable with the AARs (code in JARs expects them in the base package but they are declared in every separate module. Android Studio doesn't have this issue as it merges them all at compile time). – Dan Dar3 May 16 '17 at 07:48
  • Thanks Dan kindly share onces you done :) would really help – Hunt May 17 '17 at 12:19
1

I agree with ErstwhileIII . We will have to migrate soon. In the meantime, try this: https://stackoverflow.com/a/37891421/6079935

Community
  • 1
  • 1
usajnf
  • 522
  • 3
  • 11
1

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).
Dan Dar3
  • 1,199
  • 13
  • 23
0

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

ErstwhileIII
  • 4,829
  • 2
  • 23
  • 37
  • I know and I want to migrate to gradle/android studio for sure but when I'd be stable and officially supported by cocos2d-x team. I saw that poll about removing adt support, which is a bit strange, because android-studio project template is a bad joke for now. But I know It'd change, because they are working with google engineer to use gradle with cmake: https://github.com/cocos2d/cocos2d-x/pull/15676 So for now I wanted to find some workaround to use .aar in eclipse and later migrate to gradle/android studio. – Makalele May 25 '16 at 06:25
  • This isn't an answer to the question. – zundi Aug 30 '16 at 20:58
  • This is the answer to the question ... sometimes one has to move the "questioner" to the right world. – ErstwhileIII Sep 05 '16 at 05:30
0

Open Properties on your app and click add external JARs.

https://jar-download.com/artifacts/com.google.firebase

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135