Unity ML Agents Package Manager is not importing Actuator script - c#

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.

Related

Unable to find an entry point named 'sk_color_get_bit_shift' in DLL 'libSkiaSharp'. when using SkiaSharp 15.9.1

I am attempting to build and use the MicoCharts project available here: https://github.com/dotnet-ad/Microcharts which is dependant on this SkiaSharp project available here: https://github.com/mono/SkiaSharp
The specific version I am attempting to use is 15.9.1 (the version that the nuget package downloads) which utilizes skia m59.
I need to build them myself and cannot use Nuget due to business restrictions, just use the package isn't an option for me.
I have built skia m59, SkiaSharp and MicroCharts but when I attempt to create a SKBitmap object I get an error when it attempts to initialize SkiaSharp.SKImageInfo. The error is as follows:
Unable to find an entry point named 'sk_color_get_bit_shift' in DLL 'libSkiaSharp'.
I had to make a few changes to the base BUILD.gn to point to the correct file locations, for the windows SDK and the VC install. I enabled skia_use_gdi in the BUILD.gn and ran the following commands.
python2 tools/git-sync-deps
gn gen out/Release --args="is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_icu=false is_component_build=true"
ninja -C out/Release skia
This process outputs a DLL I assumed is the same as the libSkiaSharp that the SkiaSharp project relies on. I add all my references and run, the project runs successfully until I attempt to create the SkBitmap object then it fails.
Either this DLL is not the correct DLL and I am misunderstanding something here or something in my process is wrong. I would love any help I can get as I am completely new to building these sorts of projects, I am a C# developer by trade.
This is not the same thing. SkiaSharp has a few other bits that it adds to the core skia. The output that you would have got is a skia.dll, which only part. Not sure how you got a libSkiaSharp from the skia target...
If you can't use SkiaSharp from NuGet.org (which is the supported case) you can follow this to build your own: https://github.com/mono/SkiaSharp/wiki/Building-SkiaSharp
You can also check out the Azure DevOps yaml: https://github.com/mono/SkiaSharp/blob/master/scripts/azure-pipelines.yml
Just set up your own DevOps job to use that and all the work will be done for you.

Stores and C# assembly dll files not being loaded

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.

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

Can't add Google Play Services to Xamarin Android Project

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/

Building MacOS 10.8 source code on 10.6

I am trying to build SparkleShare on Mac.
I have Mac OS 10.6
SparkleShare claims to run on Snow Leopard (10.6) or later
SparkleShare contains calls to NSUserNotification, a class which is Available in OS X v10.8 and later
Monodevelop throws an error:
error CS0246: The type or namespace name `NSUserNotification' could not be found. Are you missing a using directive or an assembly reference?
In Monodevelop, when I begin typing MonoMac.Foundation.NSUser, the only suggested item is NSUserDefaults, NSUserNotification is not suggested.
Is this kind of cross-compilation possible?
I can't upgrade to 10.8 because I also want to check how the user experience is on 10.6.
Run:
git clone https://github.com/mono/monomac
git clone https://github.com/mono/maccore
cd monomac
make
It should generate MonoMac.dll. Copy it to wherever your MonoMac.dll is, restart Monodevelop, the project should now build fine.
I just had a look at MonoMac's source code, and NSUserNotification is a recent addition, it has been added three months ago: https://github.com/mono/monomac/commit/2c4a8c639254705e0dde1ce32f4e49cfcb72187e.
These are the generated files:
NSUserNotification.g.cs
NSUserNotificationCenter.g.cs
NSUserNotificationActivationType
NSUserNotificationCenterDelegate.g.cs
As a workaround for older MonoMac versions, you can simply copy these into your code.

Categories