I have been trying to add Xamarin Google Play Services Binding to my project so that I can add admob ads to my app.
I went and installed the Nuget package, "Xamarin Google Play Services Binding"
But then when I try to run (even if I make no other changes) I get 100+ errors about packages not existing:
For example:
Error 31 package android.support.v4.app does not exist
private native void n_onTabReselected (android.support.v7.app.ActionBar.Tab p0, android.support.v4.app.FragmentTransaction p1);
and:
Error 77 package com.google.ads.mediation does not exist
private native void n_onReceivedAd (com.google.ads.mediation.MediationInterstitialAdapter p0);
When I then go to the file I find at the top the package name is the one that claims doesn't exist, but with 'mono' attached to the front. So for example on this last error it claims that package "com.google.ads.mediation" does not exist, at the top the package itself says "package mono.com.google.ads.mediation;"
I am very new to using Xamarin and I am pulling my hair out trying to get this fixed so I would desperately appreciate any help or advice.
Try installing Google Play Services as a components instead of a Nuget Reference
http://developer.xamarin.com/guides/cross-platform/application_fundamentals/components_walkthrough/
Related
Very silly one. I'm trying to integrate Google's In-app Reviews feature into my Unity application and after deploying build I'm getting the following runtime error message on logcat console.
I followed guide from Google and it looks like there are DLLs or scripts missing or I'm doing something terribly wrong. After executing code:
private ReviewManager _reviewManager;
void Start{
_reviewManager = new ReviewManager();
}
I receive:
AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.play.core.review.ReviewManagerFactory
java.lang.ClassNotFoundException: com.google.android.play.core.review.ReviewManagerFactory
Unity 2019.2.21f. Tried Resolving for Android, tried reinstalling Google Play Core, Common and InApp Reviews (1.2.0) components.
Thanks for answers.
Are you using Proguard? You can check it in Player Settings -> Publishing Settings -> Minify. If yes, proguard can remove this part of code. Locate proguard file (Assets/Plugins/Android/proguard-user.txt) and add this line -keep class com.google.android.play.core.review.** { *;}
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.
I use the FirebasePushNotificationsPlugin in my Xamarin Forms project (4.7) to have the push notifications in my project.
I updated to the latest version (3.3.10) but now I get this error on Android (working on iOS):
**Java.Lang.IllegalStateException:** 'Default FirebaseApp is not initialized
in this process com.companyname.firebasetest.
Make sure to call FirebaseApp.initializeApp(Context) first.'
I found some solutions that does not work for me:
My google-services.json has the GoogleServicesJson build action
My firebase android app package name is the same package name on my Android project.
I tried to update android's tools
Also tried to add this line:
FirebaseApp app = FirebaseApp.InitializeApp(Android.App.Application.Context);
PS:
I created a new project (and new firebase project) but I get the same error
I pulled the sample of the FirebasePushNotification Plugin, and still getting the error
Notifications was working with version 2.3.x
What can I do ? I need help
Thx guys
I have recently tried adding In App Purchase into my Unity project. Unfortunately, it didn't show in the Components drop down menu. I could use the option to create IAP Button and perform code-less IAP configuration but it wasn't there in the menu. So I decided to configure IAP through script. But the script too throws some errors. The error goes like this:
"Assembly 'Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll' will not be loaded due to errors: Reference has errors 'Stores'."
Four errors just like the above one shows up for Assembly-CSharp.dll, Editor.dll and Assembly-CSharp-firstpass.dll
And then this one:
"Assembly 'Assets/Plugins/UnityPurchasing/Bin/Stores.dll' will not be loaded due to errors:
Unable to resolve reference 'UnityEngine.UI'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector."
I have tried re-installing In App Purchase package.
I have tried changing the API from .NET Standard 2.0 to .NET 4.x (and did the vice versa and still did not work)
Downgrading unity project isn't really a good idea but anyways I gave it a try but it just added to the already existing errors.
Upgrading to newer Unity version (alpha version) didn't help.
The error occurs whenever I initialize the ConfigurationBuilder referring StandardPurchasingModule.
public void InitializePurchasing()
{
// If we have already connected to Purchasing ...
if (IsInitialized())
{
// ... we are done here.
return;
}
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct(TWO_BOLTS, ProductType.Consumable);
builder.AddProduct(FIVE_BOLTS, ProductType.NonConsumable);
UnityPurchasing.Initialize(this, builder);
}
The worst part is that I am unable to use my scripts after writing the ConfigurationBuilder initialization code. Unity asks me to fix any compiler errors and assign a valid script. I have searched for the answer for so long. I am really stuck in here. Please help.
Your issue seems to be related to verison of Unity you using. You can follow progress of this issue on official Unity issue tracker.
If this issue is showstopper for you than cosider downgrading as you using beta verions of Unity and as official site states:
As with any beta program, you’ll have early access to new features and
will be able to assist in the final steps of their development. That
means you’re likely to experience Unity as less stable than a final
version.
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