Unreal Engine plugin compilation error - missing game target - plugins

I’m trying to compile some plugins which require a runtime module, but I have to work with a custom build of Unreal Engine for “reasons”. This build was made using the Build Graph (as Installed Engine Build), it has the debug symbols stripped off and some templates removed to make the engine size more compact but it’s mostly a vanilla 5.0.3. When I try to compile the plugin using this build, I’m getting the following error:
BuildException: Game targets are not currently supported from this engine distribution.
at UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, Boolean bSkipRulesCompile, Boolean bForceRulesCompile, Boolean bUsePrecompiled)
at UnrealBuildTool.BuildMode.CreateMakefile(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet)
at UnrealBuildTool.BuildMode.Build(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, Boolean bSkipPreBuildTargets)
at UnrealBuildTool.BuildMode.Execute(CommandLineArguments Arguments)
at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray)
The UnrealEditor part compiles fine, but the UnrealGame target appears to be missing. Any clues on why the game target is missing?

Related

Unity Asset Bundles Google Play Asset Delivery - Proguard Minification

I am having problems configuring Proguard to prevent minification of java libraries in the Google Play Asset Bundles and Asset Delivery Plugins when building a .aab using the Google Android App Bundle Unity Editor tool, using the following configuration:
Build Settings:
Create Symbols.zip - Debugging
Compression Method - LZ4
Project Settings - Player - Other:
API minimum - 5
Target API - 33
Scripting Backend - IL2CPP (.NET Standard 2.1)
IL2CPP Generation - Fastest
ARMv7 & ARM64
Strip Engine Code - true
Publishing Settings:
Custom Proguard file
Minify:
R8 - false
Release - true
The custom Proguard file in Assets\Plugins\Android:
-keep public class com.google.play.core.**{
public *;
}
-keep public class com.google.play.common.**{
public *;
}
-keep public class com.google.play.appbundle.**{
public *;
}
-keep public class com.google.play.assetdelivery.**{
public *;
}
-keepattributes *Annotation*
-dontobfuscate
This is linked form the mainTemplate.gradle build file.
Building this with the Google Editor Plugin continues to strip out both Methods and Interfaces resulting in the app crashing on start-up. I have tested the above Proguard by introducing each element which corrects some issues, but is still removing Interfaces from play.core.
Note: I have not included Stack Traces as they are pointing to specific methods and Interfaces in the Plugin libraries which were incrementally fixed by adding each exception to the Proguard file above, but is still not preserving all functions.
I have followed multiple other threads stating the same issue which suggested - deleting the library folder, using custom .gradle, downgrading all of the Google Plugins (1.7.0 release). This had previously worked using R8, but I have not been able to produce a working build since the new updates.
I have also tried multiple combinations of builds but continue to get the same issue to varying degrees of what is and is not kept, all builds cause the app to crash.
Any help in the Proguard configuration or suggestions in build configuration would be greatly appreciated, as this seems to be a popular topic with no clear solution. I am trying not export the project and build in Android Studio as that would be a significant break from our current build process.
If there is any more information I can provide please let me know.
Thanks everyone.
UPDATE: The above issue is not to do with Proguard settings.
Copying in the Proguard settings from the google.play. plugins in to a proguard-user.txt file did not fix the issue as the files were not being correctly handled during gradle build.
R8 minification was not enabled and should have been. The underlying issue is conflicts in class dependencies in the google.play plugins. Specifically;
Assets/GooglePlayPlugins/com.google.play.assetdelivery 2.0.0
Assets/GooglePlayPlugins/com.google.play.core 1.10.3
This is a documented issue in play-unity-plugins for google;
https://github.com/google/play-unity-plugins/blob/master/README.md#play-core-conflicts
However, their fix in the link is proving difficult to implement as I am unfamiliar with gradle and using local maven repositories, and difficulties with EDM4U build patching.
I have started a new thread on the issue;
Unity google.play.core dependency conflict with EDM4U maven local repository build error

Vuforia AR core samples in Unity 2018.2.1 throws errors

I have Unity Editor version 2018.2.1 and Vuforia 7.2.23. If I download Vuforia core samples from assets store, I get the following error after importing the assets..
Here are the errors
Assets/Common/Scripts/CloudRecoEventHandler.cs(82,42): error CS1061: Type `Vuforia.ObjectTracker' does not contain a definition for `GetTargetFinder' and no extension method `GetTargetFinder' of type `Vuforia.ObjectTracker' could be found. Are you missing an assembly reference
and this one
Assets/SamplesResources/SceneAssets/CloudReco/Scripts/CloudTrackableEventHandler.cs(37,61): error CS1061: Type `Vuforia.ObjectTracker' does not contain a definition for `GetTargetFinder' and no extension method `GetTargetFinder' of type `Vuforia.ObjectTracker' could be found. Are you missing an assembly reference?
Here is the screenshotsshot
When i run even if a comment those lines, it requires an upgrade of Vuforia 7.5 in which i downloaded but keeps on failing to install
The core samples in asset store don't support vuforia 7.2
You have to update vuforia manually (7.3+) or install Unity 2017.3.0 or higher

Using ZXing with Hololens

I've been trying to use Zxing on the Hololens but as soon as the app starts on the device, I get a fileloadException when this line is called:
BarcodeReader barcodeReader = new BarcodeReader();
FileLoadException: Could not load file or assembly 'System.Core,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) at
ZXing.BarcodeReader..ctor() at Decoder.Start() at
Decoder.$Invoke1(Int64 instance, Int64 args) at
UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64
args, IntPtr method) (Filename: Line: 0).
I have the Unity 2018.1.0b5 beta version with Visual Studio 2017 on Windows 10.
The Building works perfectly so the library is found.
Here's how I import ZXing library :
I've read all the other topics I found on it but the solutions provided do not work. I also tried to use the Zxing.winmd but the dll can't be found then.
Did I miss a step ? A file to download maybe ?
Thanks for your help !
After many configurations tried, I finally managed to use Zxing on Hololens by switching the scripting Backend in Player Settings to Il2Cpp. I was using .net (for the scripting backend) which caused me most of the errors. Il2CPP
If you don't have the IlCPP proposition, you might need to relaunch the Unity installer, making sure that "Windows Store Il2CPP " is checked.installation
I also downgraded my version of unity to 2017 in order to use the Holotoolkit which wasn't working on my 2018 beta version.
This way I don't need any specific settings to import Zxing in the Assets. Also, I didn't use Zxing.winmd but Zxing.unity.
settings Zxing
Tips : don't forget to unable the webcam and to deploy it in Visual Studio with "Release", otherwise it's going to slow down your app.
If Visual Studio doesn't find your Zxing.unity file, right click on your project in the Solution's Explorer (of Visual Studio) : Add->Reference->Find your Zxing.unity.

TypeInitializationException accessing MonoGame GraphicsAdapter.Adapters, could not load type 'SharpDX.Rectangle'

Converting VB code from XNA 3.1 to MonoGame.
Any attempt to access class GraphicsAdapter throws the exception below. For example, trying to enumerate GraphicsAdapters. On this line:
For Each adapter As GraphicsAdapter In GraphicsAdapter.Adapters
Result is an exception:
System.TypeInitializationException occurred
HResult=-2146233036
Message=The type initializer for 'Microsoft.Xna.Framework.Graphics.GraphicsAdapter' threw an exception.
Source=MonoGame.Framework
TypeName=Microsoft.Xna.Framework.Graphics.GraphicsAdapter
StackTrace:
at Microsoft.Xna.Framework.Graphics.GraphicsAdapter.get_Adapters()
at ...my code...
InnerException:
HResult=-2146233054
Message=Could not load type 'SharpDX.Rectangle' from assembly 'SharpDX, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1'.
Source=MonoGame.Framework
TypeName=SharpDX.Rectangle
StackTrace:
at Microsoft.Xna.Framework.Graphics.GraphicsAdapter.CreateAdapter(Adapter1 device, Output monitor)
at Microsoft.Xna.Framework.Graphics.GraphicsAdapter.PlatformInitializeAdapters(ReadOnlyCollection`1& adapters)
at Microsoft.Xna.Framework.Graphics.GraphicsAdapter..cctor()
Note the inner exception:
Could not load type 'SharpDX.Rectangle' from assembly 'SharpDX, ...Version=4.0.1.0, ...
The project references these assemblies (among others):
MonoGame.Framework version=3.6.0.1625
from NuGet "MonoGame.Framework.WindowsDX", file
packages\MonoGame.Framework.WindowsDX.3.6.0.1625\lib\net40\MonoGame.Framework.dll
SharpDX version=4.0.1.0
SharpDX.Direct2D1 version=4.0.1.0
SharpDX.Direct3D9 version=4.0.1.0
SharpDX.DXGI version=4.0.1.0
SharpDX.Mathematics version=4.0.1.0
So I don't see why it would fail this way.
What could be wrong? Not compatible with this SharpDX version?
NOTE: These are all up-to-date packages from NuGet, in Visual Studio 2015. Targeting .Net 4.5.2.
UPDATE
To prove it isn't a problem with SharpDX, I put this line before that GraphicsAdapter line:
Dim testRect As SharpDX.Rectangle = New Rectangle()
This successfully created testRect. No Exception until attempt to access GraphicsAdapter. Also tried all the other Shared (static) properties of GraphicsAdapter, such as GraphicsAdapter.DefaultDevice. Any one fails with same exception.
I posted the same question to MonoGame forums:
http://community.monogame.net/t/solved-typeinitializationexception-accessing-graphicsadapter-adapters-could-not-load-type-sharpdx-rectangle/9803
Cause of problem:
Current release of MonoGame.Framework for WindowsDX (Windows OS + DirectX drivers), 3.6.0.1625 is built against SharpDX 2.6.3, and is not compatible with more recent SharpDX versions.
(Interim) Solution:
The developer branch of MonoGame does target the current SharpDX. Builds can be obtained from MonoGame's teamcity (free registration required).
Tested MonoGame.Framework build 3.7.0.994; it worked with SharpDX 4.0.1:
http://teamcity.monogame.net/viewLog.html?buildId=56483&tab=artifacts&buildTypeId=MonoGame_PackagingWindows
That build installs most SharpDX dlls to
C:\Program Files (x86)\MonoGame\v3.0\Assemblies\Windows
However, SharpDX.Mathematics.dll is currently missing,
so I still install SharpDX from NuGet, rather than using those.
Standard location for MonoGame releases:
(look for at least 3.7, which is not there yet, as I write this):
http://www.monogame.net/downloads/
(If instead of NuGet packages for MonoGame and SharpDX, I had downloaded MonoGame 3.6 installer and used its version of SharpDX dlls at C:\Program Files (x86)\MonoGame\v3.0\Assemblies\Windows, then I would not have had this incompatibility. However, that was not recent enough SharpDX for my purposes. This should be resolved by release of MonoGame 3.7)

Facebook plugin for unity3D WP8 and METRO

I try to use facebooksdk.net in my WP8 Unity3D Plugin. Facebook.dll and Facebook.Client.dll and their fakes in correct folders, but error occure. Is there any way to fix it?
Error building Player: Exception: Failed to run assembly preprocessor with command line "Temp/StagingArea/Data/Managed\Facebook.Client.dll" -injectCtor -assemblyPath "Temp/StagingArea" -pdb.[Temp/StagingArea/Data/Managed\Facebook.Client.dll]
No symbols for Temp/StagingArea/Data/Managed\Facebook.Client.dll
Injecting ctor
Error while in assembly preprocessor Temp/StagingArea/Data/Managed\Facebook.Client.dll
Object reference not set to an instance of an object.
at AssemblyPreprocessor.Utils.IsBaseType(TypeDefinition definition, String name)
at AssemblyPreprocessor.Utils.IsFromNamespace(TypeDefinition definition, String namezpace)
at AssemblyPreprocessor.ConstructorInjector.ShouldInject(TypeDefinition typeDefinition)
at AssemblyPreprocessor.ConstructorInjector.InjectConstructorsForTypesIn(ModuleDefinition moduleDefinition)
at AssemblyPreprocessor.Program.Main(String[] args)
Facebook.dll use .NET Framework 4.5 libraries, and Windows Phone use .NET API for windows phone (http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207211(v=vs.105).aspx). You cant export this dll to WP8