Android Question Maven artifact not found com.google.firebase/

ashton293

Member
Licensed User
Longtime User
I am upgrading a number of apps to incorporate Firebase.

When I click on a library to include it in my B4A project i receive the following error message in a popup window:

"Maven artifact not found. com.google.firebase/firebase-crash"
and also:
"Maven artifact not found. com.google.firebase/firebase-ads"

This message appears irrespective of the library I select - ie it occurs with Firebase and non Firebase libraries.

To try to stop this popup appearing I have:

1] reloaded B4A v6;

2] reloaded my Android SDK - which was up to date - but hadn't been reloaded for some time [ with this I found the path for the repository's weren't correct - I've now fixed that by adding relevant folders in my SDK files to match the SDK popup over Google repository and Android repository]

3] checked my Firebase integration steps - the Json file I have downloaded does have an api key.

4] included
#AdditionalJar: com.google.android.gms:play-services
#AdditionalJar: com.google.gms:google-services
#AdditionalJar: com.google.firebase:firebase-core
#AdditionalJar: com.google.firebase/firebase-crash
#AdditionalJar: com.google.firebase/firebase-ads

[I don't have anything in the libraries folder within the app.]

I can't compile the app because of the maven artifact error appearing before compilation is completed.

I look forward to a suggestion to solve this issue. Thank you.

Leigh
 

ashton293

Member
Licensed User
Longtime User
Thanks Erel - I knew it had to be something simple. The Old SDK had it but not the new one - now seems to be working.
 
Upvote 0

Serdar K.

Member
Licensed User
Longtime User
Hi,

Thanks DonManfred for making this awesome library available for B4X world.
I also want to thank Erel and everyone on the forum very much for their efforts in this forum.

I have a little problem running this library and its demo application, i am getting
an error message loading the B4A project (and libraries).
The screenshot :View attachment 47450



I installed related SDK libraries :
- Android Support Repository Rev.36
- Google Repository Rev.32
I have made the arrangements regarding Erel's message for Firebase services.
I arranged a test project and made changes in the code for referencing the test db.
Downloaded the JSON file.

If older SDK revisions are needed, i can't see a way to revert them.
When i try to reinstall, i can only access the latest ones.
Also, in that case, shouldn't the SDK libraries in "extras" be backwards compatible (since they are used common)?

Could anyone help me about this issue ?

Regards,
Serdar
 

Attachments

  • err001.jpg
    err001.jpg
    21.5 KB · Views: 583
Last edited:
Upvote 0

Serdar K.

Member
Licensed User
Longtime User
OK, i think it was my fault. I seem to have two different SDK locations and the one i have changed was not the one
B4A IDE referenced. I will download to that location, check this and let you know again.

Apologies for disturbance.
 
Upvote 0

ashton293

Member
Licensed User
Longtime User
Hi Serdar K.

When i did as Erel suggested everything worked fine.

My reference to Old SDK probably could've been better worded - "previous" may have been better, as what I did was replaced the sdk version that I had.... with a newly downloaded sdk version.

Sorry if that confused you - I think you will find it will work by referencing the correct SDK location.
 
Upvote 0

Serdar K.

Member
Licensed User
Longtime User
Hi ashton293,

My misunderstanding, no problem.
Also thank you for your reply and information.
My download to the correct location is just completed but the issue is still going on.
I will check everything again and work on that.

Regards,
Serdar
 
Upvote 0

Serdar K.

Member
Licensed User
Longtime User
Hello,

I managed to make it work by switching my SDK setting to the other directory.
Now i don't get the above message, but when i connect my Samsung tablet and run the demo
application, i see the log below :

** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
ref imagesizes = (DatabaseReference) https://test-93507.firebaseio.com
** Activity (main) Resume **
lib:Raising.. reference_oncancelled()
lib:Raising.. reference_oncancelled()
lib:Raising.. reference_oncancelled()
java.lang.Exception: Sub reference_oncancelled signature does not match expected signature.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:171)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
Main-Activity_Pause : App closed
...
...
...
This function is the like the example, not changed :

B4X:
Sub Reference_onCancelled(errnum As Int,error As String)
    Log($"ref_onCancelled(${errnum},${error})"$)
End Sub

I think that library has been updated or i am using the wrong example application :
RealtimeDatabaseEx.zip

Does anyone have any idea what is causing this ?

Thanks& regards,
Serdar
 
Upvote 0

Serdar K.

Member
Licensed User
Longtime User
I figured out that i missed one message.
It was changed like :

B4X:
Sub Reference_onCancelled(errnum As Int,error As String, errObj As Object)
    Log($"ref_onCancelled(${errnum},${error})"$)
    Dim err As DatabaseError = errObj
 
End Sub

And we should update the example code as above.

Thanks & regards,
Serdar
 
Upvote 0
Top