Android Question Duplicate class in 2 referenced libraries (FirebaseNotification and SQLCipher)

Discussion in 'Android Questions' started by tucano2000, Jun 13, 2017.

  1. tucano2000

    tucano2000 Active Member Licensed User

    I'm trying to include Firebase to use the push notification feature.

    When I add the FirebaseNotifications library to B4A IDE and compile, the following error appears:


    I researched the problem and found it to be caused by duplicate classes. I also discovered that the other library that is in conflict is the SQLCipher. By referencing this library together with the FirebaseNotification library you can simulate the error.

    I tried opening .jar file with 7zip to delete the duplicate class but I did not find it and the .class file appears scrambled in the text editor.

    How do I solve this? I need the 2 libraries in my application. Is it possible to resolve using #ExcludeClasses?
     
    Last edited: Jun 13, 2017
  2. DonManfred

    DonManfred Expert Licensed User

    Can you post a small example project which shows the problem?

    Edit: you noticed this comment?

    Code:
    SQLCipher v1.20 is now available. The previous version crashes on Android 4.4.

    Starting from v1
    .20 the native libraries are included in the jar file. This means that you should delete sqlcipher_native.zip from the files tab. However you should add instead a file named icudt46l.zip.

    The last parameter 
    in the Initialize method is not used anymore.
    Not sure if this is the issue here... But worth a try i guess
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    I've created a new project with FirebaseNotifications and SQLCipher and it compiles successfully. Do you get this error with a new project with these two libraries?
     
  4. tucano2000

    tucano2000 Active Member Licensed User

    I am using SQLCIpher V1.30. It is based on SQLCipher v3.3.1 because older versions are not compatible with Android 6. FirebaseNotifications library V1.10.

    https://www.b4x.com/android/forum/threads/android-database-encryption-with-sqlcipher-library.14965/

    Link to download library SQLCipher v1.30 => http://www.b4x.com/android/files/SQLCipher330.zip

    Link to download library FirebaseNotifications v1.10 => https://www.b4x.com/android/forum/attachments/firebasenotifications-zip.52228/

    Project link to download: http://www.infranote.net/b4x_forum/FIrebase_Push_Notification_Test.zip

    To test the issue, simply create an empty project by marking the libraries:

    [​IMG]
     
    Last edited: Jun 14, 2017
  5. Erel

    Erel Administrator Staff Member Licensed User

    tucano2000 likes this.
  6. tucano2000

    tucano2000 Active Member Licensed User

    Excellent !!! Works !!! Thank you Erel.

    I was using the SDK Manager to update the SDK. But the latest available version of Google Repository showed 53.

    I used the B4A SDK Manager tool and it was showing version 54. After downloading the new version, I just replace the m2repository folder located in android-sdk \ extras \ google.

    As I had previously compiled the project with the old m2respository folder, I needed to use the Tools / Clean Project function in B4A IDE to success in compiling.

    Therefore, SDK Manager was not showing the latest version properly since I had followed all the steps to install and configure Firebase.

    B4A SDK Manager is another great tool to help us !!!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice