myflashlab / common-dependencies-ANE

In this repository find all the required shared libraries for our Air Native Extensions to make sure your final app will have the minimum required libraries so your app won't be unnecessarily huge in size.
24 stars 10 forks source link

problem with firebase.common #45

Closed PhilCase closed 3 years ago

PhilCase commented 4 years ago

Hi,

I'm trying to include the OneSignal ANE into our app to replace MilkmanGame's Push Notification ANE (which does not appear to work correctly with modern devices).

I've taken steps back to just include the required libraries into a very basic FlashBuilder 4.6 project. It doesn't try to use them, just bundle them.

If I include Firebase.common - I get a message box telling me:

Error occurred while packaging the application:

dx tool failed: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000) at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472) at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388) at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251) at com.android.dx.command.dexer.Main.processClass(Main.java:709) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:678) at com.android.dx.command.dexer.Main.access$300(Main.java:83) at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:607) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) at com.android.dx.command.dexer.Main.processOne(Main.java:637) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:506) at com.android.dx.command.dexer.Main.runMultiDex(Main.java:335) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106) ...while parsing com/google/auto/value/extension/memoized/Memoized.class

1 error; aborting

I get this error if I compile for debug or (captive) release with AIR 32.0.
If I omit the firebase.common library it is fine.

PhilCase commented 4 years ago

My understanding is that our purchased OneSignal library has a dependency on the "firebase common library".

I can't currently use the OneSignal library at all.

kinaco2019 commented 4 years ago

I have the exact same error. I want to use firebaseMessaging.ane in my app. I'm trying to include firebaseCore.ane into my app and some ANEs that need to be included. (I purchased firebaseMessaging.ane and firebaseCore.ane.) When I build my app project on Flash builder 4.7, I get the exact same error of PhilCase's. Please help anyone!

PhilCase commented 4 years ago

MyFlashLabs support have told me:

the dx problem has two possible solutions:

  1. check your manifest and see if you have added android.support.multidex.MultiDexApplication to your Android manifest tag.
  2. if the first solution is not helping then you are surely using an old version of JDK! Update your JDK and that will fix the problem. at least use JDK V1.8

These haven't helped in the test I did. I was using OpenJDK 13 before, and had to log onto Oracle to get the JDKv1.8 (https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) My next step will be to download and install the latest official JDK from Oracle and try that.

I'm in the middle of other projects also, so I'm not able to advance this very quickly, but it might help you kinaco2019.

kinaco2019 commented 4 years ago

Thank you very much ,PhilCase! I checked my manifest and there was "android.support.multidex.MultiDexApplication". (I am testing sample app from https://github.com/myflashlab/Firebase-ANE/blob/master/AIR/Main-app.xml) Then I updated JDK 8 from 7.Restarted my windows pc. But these didn't work. I don't know where to go.

myflashlab commented 4 years ago

@kinaco2019 which AIR SDK are you using? one reason would be that you are using an old AIR SDK.

kinaco2019 commented 4 years ago

Thank you for your reply, myflashlab. I'm using AIR SDK 32.0.0.116. I'm using windows 7, is it the reason of the error?

myflashlab commented 4 years ago

AIR 32 should be fine. but anyhow, could you try the latest version of AIR also? And also can you confirm if you have installed the 64-bit version of JDK?

kinaco2019 commented 4 years ago

I was using 32-bit version of JDK , so I installed 64-bit version of JDK 8. But it didn't work. Then I tried to use AIR SDK 33.0.2.330 and I got the error which is different from previous error.

dx tool failed:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: com.android.dx.command.Main. Program will exit. Exception in thread "main"

PhilCase commented 4 years ago

I’ve got past the “cannot build problem”. I’m not using MultidexApplication as I reset my Application’s manifest file to suit the sample code (https://github.com/myflashlab/OneSignal-ANE/blob/master/AIR/src/Main.as)

I’ve added:

As per https://github.com/myflashlab/OneSignal-ANE (I note these are not present in the sample code). I’ve put my app’s “package name” in following the style of “air.com.ikimobile.myapp.debug” (for a debug version) ).

I can confirm that I’m using Java 1.8.0_231 (64 bit) to compile (I’ve set this up as the default java compiler according to my PC’s path), and I’m using java 1.8.0_231 (32 bit) to host Flashbuilder 4.6.

I AM using AIR 33.0. To build the Android version - the iOS version builds in AIR 32.0.

I have not used the “android.support.multidex.MultiDexApplication” setting at this point (I forgot about it when I moved away from the problems that I was having with my sample app, and was having some success without it)

I can build the app now – I’m having problems configuring it to use my OneSignal server.

I believe that the app is registering to OneSignal as I can see my “userId” on the OneSignal Dashboard.

I did have other problems, but they were down to the OneSignal Dashboard needing to be reconfigured to use Firebase instead of GCM. The OneSignal dashboard doesn't allow for configuration to use GCM (or if it does I have not found it) (and that's out of scope for this problem).

PhilCase commented 3 years ago

Noting that I've closed this because it was an old issue. The MyFlashLabs OneSignal support has moved to their FirebaseCore and FirebaseFCM libraries.

However - the documentation for the new libraries does appear to be fragmented.

The myFlashLabs silver support is frustrating at best. I've lost days to going around in circles trying to get the new libraries integrated into my app, and the myFlashLabs silver level support does not appear to want to help me to make it work.