Problems adding Firebase SDK to an extension

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

matiasini
Posts: 2
Joined: 07 Feb 2020, 17:38

Problems adding Firebase SDK to an extension

Postby matiasini » 07 Feb 2020, 18:13

Hi,
I am trying to add firebase sdk to an extension.
I have added the .jar that I need in /Applications/SmartFoxServer_2X/SFS2X/lib
The problem is that Smartfox apparently does not recognize these libraries.
I have opened the .bash_profile file and added this:

Code: Select all

export CLASSPATH="/Applications/SmartFoxServer_2X/SFS2X/lib/"

What am I doing wrong?
In the log I have this error:

Code: Select all

07 Feb 2020 | 14:38:07,882 | ERROR | Thread-9 | entities.managers.SFSExtensionManager |     | java.lang.NoClassDefFoundError:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.NoClassDefFoundError
Message: com/google/firebase/FirebaseOptions$Builder
Description: An error occurred while reloading extension: MyHomeExtension in { Zone: Home }
The new extension might not function properly.
+--- --- ---+
Stack Trace:
+--- --- ---+
tv.ingames.myHomeExtension.MyHomeExtension.init(MyHomeExtension.java:29)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExtension(SFSExtensionManager.java:303)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.reloadExtension(SFSExtensionManager.java:534)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager$ExtensionFileChangeListener.fileChanged(SFSExtensionManager.java:111)
org.apache.commons.vfs.events.ChangedEvent.notify(ChangedEvent.java:34)
org.apache.commons.vfs.provider.AbstractFileSystem.fireEvent(AbstractFileSystem.java:519)
org.apache.commons.vfs.provider.AbstractFileSystem.fireFileChanged(AbstractFileSystem.java:487)
org.apache.commons.vfs.impl.DefaultFileMonitor$FileMonitorAgent.check(DefaultFileMonitor.java:647)
org.apache.commons.vfs.impl.DefaultFileMonitor$FileMonitorAgent.access$200(DefaultFileMonitor.java:418)
org.apache.commons.vfs.impl.DefaultFileMonitor.run(DefaultFileMonitor.java:373)
java.lang.Thread.run(Thread.java:748)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


This post comments on opening the file conf/wrapper.conf , but where can I find this file?
viewtopic.php?f=4&t=1878

Please, HELP :)
User avatar
Lapo
Site Admin
Posts: 21288
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problems adding Firebase SDK to an extension

Postby Lapo » 08 Feb 2020, 15:13

[ Thread was moved in the correct section ]
There seem to be some confusion here. You posted under the SFS1.x section but you're talking about SFS2X.

As regards copying the library under SFS2X/lib/ it is correct. Make sure you're not also bundling the library in your Extension jar file. Also you don't need to add anything else, including editing your bash profile.

I've tried adding the firabese jar found here:
https://mvnrepository.com/artifact/com. ... min/6.12.1
And I don't see any problems loading the FirebaseOptions class.

This post comments on opening the file conf/wrapper.conf , but where can I find this file?

Nowhere. This is stuff related to SFS1.x not 2X

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
matiasini
Posts: 2
Joined: 07 Feb 2020, 17:38

Re: Problems adding Firebase SDK to an extension

Postby matiasini » 11 Feb 2020, 01:50

Hi Lapo, thanks for you answer.
I'm new with smartfox and I was reading things from SFS1 by mistake.
It's really easy to add jars :)
I have already been able to run firebase.
Many Thanks!

Return to “SFS2X Questions”

Who is online

Users browsing this forum: DavinVicy, DerikFent, Google [Bot], JerodSa and 18 guests