Unity ads install error from package manager
When you are trying to install or updating your unity ads sdk from package manager after installing it will showing you two of them error
let me talk about the first error if you are showing error in console and saying
"Feature `expression bodied members' cannot be used because it is not part of the C# 4.0 language specification"
G:/games/Unity Games/sample/Library/PackageCacheemail@example.com/Runtime/Advertisement/Advertisement.cs(25,42): error CS1644: Feature `expression bodied members' cannot be used because it is not part of the C# 4.0 language specification
This error is showing to use because you are using Scripting Runtime Version from .NET 3.5 equivalent which is now deprecated so change it to .NET 4.x Equivalent.
Steps to change it are as follows
1. Open build setting by navigating file and click on build setting as shown in the picture
3. Now player setting is opened in player navigate to other setting and in other setting you will find configuration section and here you will find scripting runtime version which is currently ".NET 3.5 "
and then unity editor will restart and after that there will be no error in unity ads sdk and console will not going to show you any error
or you can watch video of it
Come to the second type if error
When You try to upgrade or install unity ads from package manager
showing you an error like this
Package firstname.lastname@example.org has invalid dependencies:
com.unity.ugui: Package [email@example.com] cannot be found
In package manager and in console it is
Assembly has reference to non-existent assembly 'UnityEngine.UI' (Packages/com.unity.ads/Runtime/Advertisement/UnityEngine.Advertisements.asmdef)
Assembly has reference to non-existent assembly 'UnityEngine.UI' (Packages/com.unity.ads/Tests/Runtime/Advertisement/UnityEngine.Advertisements.Tests.asmdef)
These errors occur because you are using old unity version which have different configuration for UnityEngine.UI an you are trying to install newer Unity ads version
So just remove this version and use other old version of unity ads version by navigating windows -> package manager -> Advertisement and click on all version and select lower or equal version of version 3.4.2
remember which version you should choose depend on your unity editor version so lower versions.
Can watch a video