Google Firestore error getting database instance - c#

I am trying to add information to my firebase project using Xamarin android app but all of a sudden I got this message:
Error Message
Java.Lang.NoClassDefFoundError
Message=Failed resolution of: Lcom/google/common/base/Preconditions;
My GetDatabase method:
Imgur Link
NuGet Packages Installed:
Xamarin.Android.Support.Core.Utils (ver 28.0.0.3)
Xamarin.Android.Support.CustomTabs (ver 28.0.0.3)
Xamarin.Android.Support.Design (ver 28.0.0.3)
Xamarin.Android.Support.Media.Compat (ver 28.0.0.3)
Xamarin.AndroidX.MultiDex (ver 2.0.1.4)
Xamarin.Essentials (ver 1.5.3.2)
Xamarin.Firebase.Auth (ver 71.1605.4)
Xamarin.Firebase.Firestore (ver 71.1705.4)
Xamarin.Google.Guava (ver 28.2.0)
Xamarin.GooglePlayServices.Auth (ver 71.1600.4)
XamarinLibrary.Xamarin.Android.Support.Multidex (ver 1.0.3)
Debug Log
https://paste.ubuntu.com/p/TDNGwSTDTG/
I tried to paste it here as text but it didn't like it :( ^^
I have tried to rebuild the project on multiple occasions after each change
As I saw in this site in a similar question I tried to downgrade Guava to 27.1.0.0 as well as 27.1.0.4
Double checked the connection to google. I can confidently say so since I have implemented a firebase auth Google sign in option and it works as intented.
I am quite new to Xamarin and Firebase so please don't stone me xD

There is a well known conflict beetween Guava, Xamarin.Firebase and AndroidX.
In my case I implemented AndroidX at the end as a new update, so I already had all the logistic configured with Firebase so the fastest, easiest and (for me) the best solution was to stop using AndroidX and start uninstalling all AndroidX package. (Let me tell you, it was a lot.)
It wasn't easy because even some of the last updates from Guava or Xamarin.Firebase if I recall correctly, depends on AndroidX so I recommend to check that before you update your Nuget packages.
So, long story short, my solution was to stop using AndroidX Nuget package.
At least until this issue got fix.

Related

Unity ML Agents Package Manager is not importing Actuator script

I want to test the Unity ML example "3D Ball". So, I set up environment:
Imported the ML Agents Package by Unity Package Manager.
Copied the ML Agent example Assets from Unity's official GitHub to My Project File.
Then, I opened the example scene and played that scene. But every code which contains "using Unity.MLAgents.Actuators" fails with the following error:
Assets\test.cs(5,22): error CS0234: The type or namespace name 'Actuators' does not exist in the namespace 'Unity.MLAgents' (are you missing an assembly reference?)
So, I've tried to find MLAgents.Actuator module's source code. But I didn't find anything yet.
Someone said Actuator Module is applied after ML Agent 1.0.3, but I imported the lasted version (v. 1.0.4).
How can I import the ML Agents package properly? Every YouTube tutorial does not show the problem I've encountered.
Here is my environment:
Unity version: Unity 2020.1.0f
ML Agents version: version 1.0.4
ML Agents example: version Release 7
Update the package to a 1.4.0-preview or later (depending on your Unity version, you may need to change some package manager settings to be able to see preview packages).
Get the examples from a tag that corresponds to the 1.0.x package, for example com.unity.ml-agents_1.0.6
You have to manually install it from the repository you cloned.
I added the project from "Unity Hub" rather than inserting asset folder to a new project.
And then everything works fine. Even the preview packages like
[com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions]
added automatically to the project from my project directory!
If you need to use the 1.0.x pacakage, make sure you're getting the examples from a compatible version (not the master branch). For example, here's the 1.0.2 tag: github.com/Unity-Technologies/ml-agents/tree/…. Looks like 1.03 and 1.0.4 tags are missing but I'll update them tomorrow. – celion Sep 27 '20 at 20:27
Celion had the right answer
I have the same problem, I am very new to Unity. I figured out it is something with the versioning. You need to use the proper version of the package. By installing from the Unity Registry, I was not able to install the last version.
I just install the package from the Disk. Here follow the Install the com.unity.ml-agents Unity package. It fixed my problem.
Unity.MLAgents.Actuators this package is in preview till this date, if you want to use this package you need to update your MLAgents package from package manager.

Brew package won't build due to a missing license

I could not find anything similar to this, troubleshooting doesn't seem to have similar issues of a missing license.
How to get this license file and where to add it, as it may be the issue which fails the whole build ?
Any insight is much appreciated.
alex31#Air3:~$ `brew install scriptcs`
==> Installing dependencies for scriptcs: mono
==> Installing scriptcs dependency: mono
==> Downloading https://download.mono-project.com/sources/mono/mono-6.4.0.198.ta
Already downloaded: /home/alex31/.cache/Homebrew/downloads/0f5bd5d4725f08bae7e853625da4da3ccdbb326dfa62820ffd3410b49ea6d64b--mono-6.4.0.198.tar.xz
==> ./configure --prefix=/home/linuxbrew/.linuxbrew/Cellar/mono/6.4.0.198 --disa
==> make
==> make install
==> Cloning https://github.com/mono/msbuild.git
Updating /home/alex31/.cache/Homebrew/mono--msbuild--git
=> Checking out revision ad9c9926a76e3db0d2b878a24d44446d73640d19
HEAD is now at ad9c9926 Merge pull request #109 from radical/roslyn-bump-2019-02
HEAD is now at ad9c9926 Merge pull request #109 from radical/roslyn-bump-2019-02
==> ./eng/cibuild_bootstrapped_msbuild.sh --host_type mono --configuration Relea
Last 15 lines from /home/alex31/.cache/Homebrew/Logs/mono/04.cibuild_bootstrapped_msbuild.sh:
/tmp/mono--msbuild-20191101-2457-1g9gbaz/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19207.1
/tools/RepositoryValidation.proj(29,5): error : No license file found in '/tmp/mono--msbuild-20191101-2457-1g9gbaz/'.
Xunit.NetCore.Extensions -> /tmp/mono--msbuild-20191101-2457-1g9gbaz/artifacts /bin/Xunit.NetCore.Extensions/Release-MONO/net472/Xunit.NetCore.Extensions.dll
Dependency -> /tmp/mono--msbuild-20191101-2457-1g9gbaz/artifacts/bin/Samples/Dependency/Release-MONO/net472/Dependency.dll
PortableTask -> /tmp/mono--msbuild-20191101-2457-1g9gbaz/artifacts/bin/Samples/PortableTask /Release-MONO/netstandard1.3/PortableTask.dll
TaskUsageLogger -> /tmp/mono--msbuild-20191101-2457-1g9gbaz/artifacts/bin/Samples/TaskUsageLogger/Release-MONO/net472/TaskUsageLogger.dll
XmlFileLogger -> /tmp/mono--msbuild-20191101-2457-1g9gbaz/artifacts/bin/Samples/XmlFileLogger/Release-MONO/net472/XmlFileLogger.dll
Build FAILED.
/tmp/mono--msbuild-20191101-2457-1g9gbaz/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19207.1
/tools/RepositoryValidation.proj(29,5): error : No license file found in '/tmp/mono- -msbuiild20191101-2457-1g9gbaz/'.
0 Warning(s)
1 Error(s)
Time Elapsed 00:11:11.71
Build failed (exit code '1').
READ THIS: https://docs.brew.sh/Troubleshooting
There have been issues with Linuxbrew's mono installation, so I wouldn't get my hopes up for getting it to work anytime soon. This is what the Linuxbrew maintainer said a month ago:
Yes, I gave up on mono a few weeks ago. Let's close this, we can work on this later if needed. We can not fix everything at once.
Source
Also, it seems like the actual problem is with the msbuild part within the mono formula.
I'm not that experienced with Linuxbrew but maybe you could try to install mono separately and then install scriptcs with the --ignore-dependencies flag? It's possible that it won't work but it might be worth the try. I would also check whether msbuild is installed with mono and if not, install it with .NET Core.
Another option you have is to follow the official guideline on the scriptcs GitHub repository. They instruct you to install the Scriptcs Version Manager (SVM) and then use it to install the latest version of Scriptcs. By doing that, you can bypass the whole Linuxbrew stuff. You can find the instructions here.

Vue.js template in dotnet core: discontinued?

Some weeks ago, I followed this tutorial to get started with dotnet core + vue.js.
The steps to install the template were:
Install the SPA (Single Page Application) templates provided by Microsoft:
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
To get started and create a new Vue project, simply run the following commands on the console:
mkdir new-project
cd new-project
dotnet new vue
It worked perfectly (I repeat: that was some weeks ago).
Now I've repeated the same steps in the same machine and it says "There are no templates that match the name of the input template: vue" =>
Have the vue.js template been discontinued during the last weeks? Or am I doing something wrong?
After other comments saying it was working for them, and knowing that it worked for me some weeks ago, I've finally figured out what is going on:
On my "Available package sources" (NuGet config) in VS2017, I had the nuget nuget repository from work [work-repo]. I have to connect via VPN to be able to access it (and I wasn't during my tests). I didn't have it connected some weeks ago when the whole process worked perfectly.
Now, when I was executing dotnet new --install Microsoft.AspNetCore.SpaTemplates::*, the first lines were informing me that "I am not able to connect o [work-repo]". But then it seemed to continue as if nothing happened, and I ignored it because I didn't see it as something that would have anything to do with "not seeing vue".
Once I removed [work-repo] from the sources list, I have been able to see the "vue" template again. I have installed it via dotnet new vue and it works perfectly.
tl;dr: If you have "Nuget package sources" that are not accessible at the moment, the process "Install the SPA templates provided by Microsoft" doesn't work.
I had the same issue. In my case, the issue occured after installing Visual Studio 2019. After struggling for a while I found out that
the NuGet V2 package source was completely missing.
After going to Tools -> Options -> NuGet Package Manager -> Package Sources, adding https://www.nuget.org/api/v2/, the vue-template appreared after running that command:
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
I similarly found this wasn't working, and the problem was also having a private repository (that needed authentication rather than being completely inaccessible). The simplest solution for me was to list the nuget packages using 'nuget sources', check the name of the private repository, use 'nuget sources Disable -Name [privatereponame]' to temporarily disable the repo, then run 'dotnet new --install Microsoft.AspNetCore.SpaTemplates::*' to install the new templates, and finally 'nuget sources Enable -Name [privatereponame]' to re-enable the private repo that was causing the problem.
I had the same problem and it was Telerik source/package causing the issue. Once I removed iy from the "Available package sources" (just like Xavier suggests), the SpaTemplates install completed without error
Its so simple: just run
dotnet new search vue
then follow the instruction
and then select a template, enjoy

Xamarin App not compiling after Xamarin Update

We have a Xamarin app running smoothly, but after latest update to Xamarin and Android Packages, we started receiving this error, the update changed Android Support version from 25.1.0 to 25.1.1:
Error: package android.support.v7.media.RemotePlaybackClient does not exist
check detail of error :
/Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.Droid/obj/Debug/android/src/mono/android/support/v7/media/RemotePlaybackClient_OnMessageReceivedListenerImplementor.java(48,48): Error: error: package android.support.v7.media.RemotePlaybackClient does not exist
android.support.v7.media.RemotePlaybackClient.OnMessageReceivedListener
warning: unknown enum constant Scope.LIBRARY_GROUP
reason: class file for android.support.annotation.RestrictTo$Scope not found
Adding Xamarin.Android.Support.v7.MediaRouter and Xamarin.Android.Support.Media.Compat didn't solve the problem.
For these sort of errors the safest option is to do the following:-
1) Gather a list of all the installed packages with their versions.
2) Remove all packages. Some packages will require removing other packages first.
3) Install all packages again.
check dependencies for both packages.packageandroid.support.v7.media.RemotePlaybackClient,Xamarin.Android.Support.v7.MediaRouter because most of time dependecies should be updated.
go to the nuget package manager and select all the package and push the Update butron in top of the page
Point: There are two update button

ServiceStack 3.9.* to 4.*

I am trying to change ServiceStack in my service from 3.9.43 to 4.0.9.
I had to change several things in my code and mostly followed the release notes for this.
There were a couple of weird things for me, like not finding anything to replace ServiceStack.WebHost.Endpoints or AppHostHttpListenerLongRunningBase but I could check those things after and was able to make my code to compile.
The problem is that when I run my code I get this exception in the very begining and it just kills the service:
Method 'ExecuteMessage' in type 'ServiceStack.Host.ServiceController' from assembly 'ServiceStack, Version=4.0.9.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
I get this when hitting the base:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServiceStack;
using ServiceStack.Text;
//using ServiceStack.WebHost.Endpoints;
using ServiceStack.Web;
namespace ThisService {
public class AppHost : AppHostHttpListenerPoolBase { //AppHostHttpListenerLongRunningBase {
public AppHost(int wthreadMax)
: base("This Service " + VcsInfo.ChangesetId, wthreadMax, typeof(ThisService).Assembly) {
}
...
I am referencing in my project:
ServiceStack (4.0.9.0);
ServiceStack.Client;
ServiceStack.Common;
ServiceStack.Interfaces;
ServiceStack.Text
I am sure I am doing something wrong changing to version 4.* and am lost with what is trying to call the Execute Message since I think removed everything from the previous version. Any suggestion to where I should be looking to?
By the way, this a simple service: get json -> math + stuff -> return json.
I want to find out if a bug I found the version 3.9.43 still happens in version 4.0.9 (can't find anything specific about that bug but I believe one fix there is related) to see if I should actually re-factor my code for this version.
Update in v4.10
This should now be resolved in ServiceStack v4.10 where now all NuGet packages specify a minimum version for all dependencies matching the current version. This will force NuGet to pull down the latest packages instead of the oldest matching ones.
NuGet seems to have the weird behavior that it will pull in the lowest dependencies when you install a package, so if you install the latest version of ServiceStack, e.g:
PM> Install-Package ServiceStack -Version 4.0.9
It will pull in the lowest matching dependenices, e.g:
<package id="ServiceStack.Client" version="4.0.3" targetFramework="net45" />
<package id="ServiceStack.Common" version="4.0.3" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="4.0.3" targetFramework="net45" />
<package id="ServiceStack.Text" version="4.0.3" targetFramework="net45" />
Which is an unexpected surprise. Unfortunately ServiceStack assumes that it's always working with the latest dependencies with the same version it was built with.
So after installing ServiceStack you will need to update all your packages which will bring them in-line with the latest versions, which you can easily do in the Updates tab in the NuGet UI, or in the NuGet Package Console Manager with:
PM> Update-Package
Manually remove any assembly redirects
Installing the previous v4.02 of ServiceStack (now removed) created new assembly redirects for ServiceStack.Interfaces in the Web.config which you should also manually remove if they exist. These now shouldn't be created for new projects.
I had the same problem as well. Therefore I tried installing an older v4 version from Nuget and managed to make it work.
Using Scott's example I can get this to work correctly if I install 4.0.4:
install-package servicestack -Version 4.0.4
If I use version 4.0.5 then it runs but the example web page reports
Method not found: 'Void ServiceStack.Web.IResponse.set_Dto(System.Object)
If I use version 4.0.6 or above then I get the error reported by RGPT.
So, for now it may be a case of using the 4.0.4 version until someone with more knowledge than me replies with a better answer. I've only just starting using ServiceStack today so I don't know much yet ;)
Update: I don't have high enough ServiceStack reputation to post a comment so felt best to edit my original post. The answer below by mythz had the key bit of information. Immediately update your nuget packages after installing and then check the web/config / app.config to see if any dependentAssembly bindingRedirects are hanging around - if so then remove them and away you go :)
I've had a similar problem as well. I followed the upgrade path, first via the Beta channel before upgrading to the offical channel. What I soon realised was that the Beta libraries had version numbers greater than the official channel.
NuGet will check for a more up-to-date version locally first, before pulling in the libraries remotely. Of course, it will pull in ServiceStack v4.0.x from the official channel, but all the dependencies will come from the already downloaded Beta (i.e. locally).
What I did to resolve it:
Uninstall all ServiceStack dependencies from the Solution via NuGet
Deleted the Solution's Nuget '/packages' folder, and to re-import it using NuGet package restore
Re-added the ServiceStack references via NuGet, and checked the 'packages.config' for correct versions

Categories