1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Java Question Firebase InAppMessaging and Dagger dependency

Discussion in 'Libraries developers questions' started by DonManfred, Jul 7, 2019.

  1. DonManfred

    DonManfred Expert Licensed User

    I´m trying to do a wrap for Firebase InAppMessaging (which is currently still in Beta)
    The library is using
    When reloading the Librarytab i get an error missing com.google.dagger:dagger

    I then tried to add it manually in the SDK

    i added the folder Dagger to Android.readytorunsdk\extras\b4a_remote\com\google\

    and added
    to the installed-components.txt

    It works but it then requests another dependency:
    I added them too. See the updated content of the dagger-folder attached.

    Are .androidx.jar/aar recognized and used in the maven-artifacts inside the b4a_remote folder?

    I guess it is the dependecy to dagger-android or dagger-android-support which are not fetified by default (download from maven). i copied them to addlibs folder and run the jetifier tool to get the androidx.* for them and added them to the dagger folder.

    I tried it in a new project using just the wrapper with the DependsOn seen above.
    The new project does not have any active additionaljar lines.
    '#AdditionalJar: com.google.dagger:dagger
    '#AdditionalJar: com.google.dagger:dagger-android
    '#AdditionalJar: com.google.dagger:dagger-android-support

    '#AdditionalJar: com.google.firebase:firebase-core
    '#AdditionalJar: com.google.firebase:firebase-common
    '#AdditionalJar: com.google.gms:google-services
    '#AdditionalJar: com.google.firebase:firebase-iid
    '#AdditionalJar: com.google.firebase:firebase-abt
    '#AdditionalJar: com.google.firebase:firebase-inappmessaging-display
    '#AdditionalJar: com.google.firebase:firebase-inappmessaging
    '#AdditionalJar: com.google.android.datatransport:transport-api
    '#AdditionalJar: com.google.android.datatransport:transport-runtime
    '#AdditionalJar: dagger-2.23.jar
    '#AdditionalJar: dagger-android-2.23.2.aar
    '#AdditionalJar: dagger-android-support-2.22.1.aar
    '#AdditionalJar: guice-4.2.2.jar
    '#AdditionalJar: javax.inject-1.jar
    '#AdditionalJar: javax.servlet-api-4.0.1.jar
    '#AdditionalJar: rxjava-2.2.9.jar
    '#AdditionalJar: rxandroid-2.1.1.aar
    '#AdditionalJar: rxjava-reactive-streams-1.2.1.jar
    '#AdditionalJar: reactive-streams-1.0.2.jar
    '#AdditionalJar: picasso-2.71828.aar
    '#AdditionalJar: okhttp-2.7.5.jar
    '#AdditionalJar: grpc-protobuf-lite-1.20.0.jar
    '#AdditionalJar: grpc-android-1.21.0.aar
    '#AdditionalJar: grpc-core-1.21.0.jar
    '#AdditionalJar: grpc-stub-1.21.0.jar
    '#AdditionalJar: grpc-services-1.21.0.jar

    '#AdditionalJar: opencensus-api-0.20.0.jar
    '#AdditionalJar: transport-runtime-1.0.0.aar
    But i run into
    when trying to compile the project.

    My fear is that the .androidx.jar/aar are not used inside the b4a_remote folder. Due to this i guess it is fetching the jar/aar which depends on "old" Support-classes and due to this b4a is using the old support appcompat resourcefolder. Just a thought as i can not figure out where reference for the old support classes are coming from.

    I tried to use the jars directly in the additional libs folder but it always stops with a missing dependency when reloading the libraries.
    I got rid of this problem with adding the mavens to the SDK and patching the installed-components.
    I also got Firebase Firestore running this way.

    But here my fear is that the jetified jars (if available in the SDK) are not used.

    Any thoughts/hints/advices are welcome :)

    Attached Files:

    Last edited: Jul 7, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

    I recommend you to only support androidx in this case as the dependencies will be quite complicated.

    I'm able to compile with these references:
    #AdditionalJar: com.google.firebase:firebase-inappmessaging
    #AdditionalJar: dagger-2.23.2.jar
    #AdditionalJar: dagger-android-2.23.2.aar
    #AdditionalJar: dagger-android-support-2.23.2.aar
    I've copied the three attached jars to the additional libs folder. The first two are just stubs to prevent the compiler from throwing an error about missing references.

    You will probably need to add more references to make it actually work.

    Attached Files:

  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