Java Question Firebase InAppMessaging and Dagger dependency

DonManfred

Expert
Licensed User
Longtime User
I´m trying to do a wrap for Firebase InAppMessaging (which is currently still in Beta)
The library is using
B4X:
@DependsOn(values={
    "com.google.firebase:firebase-inappmessaging",
    "com.google.firebase:firebase-inappmessaging-display" 
})

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
B4X:
com.google.dagger\:dagger=2.23.2
com.google.dagger\:dagger-android=2.23.2
to the installed-components.txt

It works but it then requests another dependency:
B4X:
com.google.dagger\:dagger-android-support=2.23.2
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.
B4X:
'#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
 

Attachments

  • dagger.zip
    104.2 KB · Views: 403
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime 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:
B4X:
#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.
 

Attachments

  • com.google.dagger-dagger.zip
    418 bytes · Views: 457
  • com.google.protobuf-protobuf-lite.jar
    240.7 KB · Views: 430
Cookies are required to use this site. You must accept them to continue using the site. Learn more…