Firebase firestore,auth,storage Version error - firebase

I am using using firestore,auth and storage. I know all the versions of them should be same.
before:
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
this works fine
but now I have to use
documentReference2.update("test", FieldValue.arrayUnion(documentReference));
So I need to use the newer version of firestore. I tried changing it to 19.0.0,18.0.0,16 etc for all of them. I tried every possible way. But always gives the
error:Failed to resolve: com.google.firebase:firebase-auth:16.0.0
base:firebase-storage:16.0.0 Show in File Show in Project Structure
dialog
I'm unable to find a solution

Update the following:
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
into this:
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-firestore:19.0.0'
implementation 'com.google.firebase:firebase-storage:17.0.0'
Check the latest versions here:
https://firebase.google.com/support/release-notes/android#latest_sdk_versions

Related

Failed to resolve: 'com.squareup.retrofit2.converter-gson:2.3.0'

I am trying to include 'com.squareup.retrofit2.converter-gson:2.3.0' using Android Studio 3.2 Canary 5
See image below
as you can search in google, putting this worked, I hope it helps you too
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.4'
Solution
implementation 'com.squareup.retrofit2:converter-gson:<latest-version>'
The latest version can be found here.
Simply paste this instead :
implementation 'com.google.code.gson:gson:2.8.5'
implementation'com.squareup.retrofit2:retrofit:2.6.1'
Use (where is possible) the latest version, I had the same error but it looks like the retrofit 'com.squareup.retrofit2.converter-gson:2.3.0' version 2.3.0 is deprecated.
This works for me:
//Retrofit2
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
Source:
https://square.github.io/retrofit/
https://github.com/square/retrofit
it works perfectly well.
//retrofit
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
It gives/provides the latest repo you'll need.

RobolectricGradleTestRunner vs RobolectricTestRunner.class

In roboelectric when you write your test class you have declare the #RunWith annotation of which there is RobolectricGradleTestRunner and RobolectricTestRunner.class. What is the difference and which one should we use ? Why is there 2 in the first place. If I use RobolectricTestRunner then it does not work for me it says some weird error like :
"java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity."
However this seems to go away if I use RobolectricGradleTestRunner.
RobolectricTestRunner was first and is for maven based projects.
RobolectricGradleTestRunner was for gradle based projects because some paths have changed.
Since robolectric 3.1.1 this is not more necessary and is now deprecated.
For more details see also http://robolectric.org/getting-started/

How to add correctly use Meteor package in a angular2-meteor project?

I am writing an angular2-meteor program.
When I am using urigo:angular2-meteor package, I add reference path like this:
/// <reference path="../typings/angular2-meteor.d.ts" />
The question is: can I use other normal meteor packages in a angular2-meteor project? Or I can only use some packages written for angular2-meteor specifically.
For example, if I want to use yuukan:streamy, how can I use it correctly? Right now, I have one line code
Streamy.broadcast('hello', {data: 'world!'});
When I compile it, it shows: Cannot find name 'Streamy'.
Thanks!
you can use all the libraries from meteor.
you will have 2 choices.
find the streamy definition file (streamy.d.ts) if it exists. This will give you autocompletion and compile errors if you misuse streamy functions.
If you dont find a definition file than just add declare var Streamy at the top of the file you want to use it. The library is already there if you add it via atmosphere. But typescript does not know about it. By declaring the variable you tell typescript that this exists and it wont complain when compiling.

JDO + datanucleus API enhancement

I want to load dynamically XML meta-data files that are not in the classpath (the XML meta-data files will be generated after launching my app).
I thought I could call the method
MetaDataManager.registerFile(java.lang.String fileURLString, FileMetaData filemd, ClassLoaderResolver clr)
Then, I tried the API enhancement, so I added the following lines:
JDOEnhancer enhancer = JDOHelper.getEnhancer();
enhancer.setVerbose(true);
enhancer.addClasses(ClassToPersist.class.getName()).enhance();
getClass().getClassLoader().loadClass(ClassToPersist.class.getName());
The following jars are in the classpath: datanucleus-api-jdo.jar, datanucleus-connectionpool.jar, datanucleus-core.jar datanucleus-rdbms.jar, jdo-api.jar, asm.jar.
But when I launch my app, I get this exception:
Caused by: mypackage.MyException:
org.datanucleus.api.jdo.exceptions.ClassNotPersistenceCapableException: The class "mypackage.ClassToPersist" is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data/annotations for the class are not found.
Do you please have any idea how to fix this ?
PS: I also noticed that the method enhance returns 0 which indicates that the class has not been enhanced (we could exclude the other options)
Thanks
I think I found an easy way to fix this.
At runtime, I created a jar that contains the updated metadata file as META-INF/package.jdo. Then I added this jar to the classpath as described here
Using this hacks, I didn't need to re-enhace my class since it is enhanced after compilation.
(But for information, I had to call JDOEnhancer.addFiles() to enhance my class.)
So your call to loadClass has loaded the unenhanced class (since it would have been loaded in order to perform the enhancement presumably), and you didn't follow the tutorial that is provided at http://www.datanucleus.org/documentation/development/dynamic_class_metadata_enhance_runtime.html

Active Model Serializer not render my models

I am trying to integrate Active Model Serializer to render JSON elements with relations.
I follow the documentation on this address: http://rubydoc.info/gems/active_model_serializers
I am not sure if I am doing something wrong but it looks like serializers are not working. Do I need to make more steps?
I install the gem, generate the serializer and add relation.
Can you guide me, please??
My project is in this repo:
https://github.com/dwdsolutions/argo
Best Regards
You're using the 0.9.0 version. Try to change it to 0.8.0
Alex is right, I tried using v0.9.0 earlier and was unable to get it working per the existing documentation.
The main github repo does state to use v0.8.0 if you are familiar with the gem (https://github.com/rails-api/active_model_serializers/tree/master#maintenance-please-read). At any rate, once you get it working, you shouldn't need to manually specify your serializers since they're named properly compared to your models and controllers.
i.e. you can remove the trailing option of this line:
render json: #travel, serializer: TravelSerializer
And make it just:
render json: #travel

Resources