Monotouch - Missing Method on DLL - iphone

I'm trying to create a project in .Net for IPhone using Monotouch. My problem is:
I have a DLL generated by Visual Studio 2010. This DLL just have an Interface and two other classes. I can use with no problems in my project in Visual Studio, but when I try to use the same one in Monotouch, i've got this error:
Building: HelloWorld (Debug|iPhoneSimulator)
Building Solution HelloWorld
Building: HelloWorld (Debug|iPhoneSimulator)
Performing main compilation...
Updating CodeBehind files
Updated MainWindow.xib.designer.cs
/Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/claudio/Documents/Development/DotNet/HelloWorld/HelloWorld/bin/iPhoneSimulator/Debug/HelloWorld.exe" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Runtime.Serialization.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.ServiceModel.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.ServiceModel.Web.dll" "/r:/Users/claudio/Documents/Development/DotNet/HelloWorld/HelloWorld/bin/Abcom.EmailService.ContractsCS.dll" /nologo /warn:4 /debug:+ /debug:full /optimize- /codepage:utf8 "/define:DEBUG" /t:exe "/Users/claudio/Documents/Development/DotNet/HelloWorld/HelloWorld/MainWindow.xib.designer.cs"
"/Users/claudio/Documents/Development/DotNet/HelloWorld/HelloWorld/Main.cs" "/Users/claudio/Documents/Development/DotNet/HelloWorld/HelloWorld/Class1.cs"
Missing method .ctor in assembly /Users/claudio/Documents/Development/DotNet/HelloWorld/HelloWorld/bin/Abcom.EmailService.ContractsCS.dll, type System.Runtime.Versioning.TargetFrameworkAttributeThe class System.Runtime.Versioning.TargetFrameworkAttribute could not be loaded, used in Abcom.EmailService.ContractsCSCan't find custom attr constructor image: /Users/claudio/Documents/Development/DotNet/HelloWorld/HelloWorld/bin/Abcom.EmailService.ContractsCS.dll mtoken: 0x0a000001
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'Abcom.EmailService.ContractsCS'.
at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetType (System.Reflection.Module,string,bool,bool)
at System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError, Boolean ignoreCase) [0x00000] in :0
at System.Reflection.Assembly.GetType (System.String name) [0x00000] in :0
at Mono.CSharp.RootNamespace.GetTypeInAssembly (System.Reflection.Assembly assembly, System.String name) [0x00000] in :0
at Mono.CSharp.RootNamespace.LookupTypeReflection (Mono.CSharp.CompilerContext ctx, System.String name, Location loc, Boolean must_be_unique) [0x00000] in :0
at Mono.CSharp.GlobalRootNamespace.LookupTypeReflection (Mono.CSharp.CompilerContext ctx, System.String name, Location loc, Boolean must_be_unique) [0x00000] in :0
at Mono.CSharp.Namespace.LookupType (Mono.CSharp.CompilerContext ctx, System.String name, Location loc) [0x00000] in :0
at Mono.CSharp.Namespace.Lookup (Mono.CSharp.CompilerContext ctx, System.String name, Location loc) [0x00000] in :0
at Mono.CSharp.TypeManager.CoreLookupType (Mono.CSharp.CompilerContext ctx, System.String ns_name, System.String name, Kind type_kind, Boolean required) [0x00000] in :0
at Mono.CSharp.TypeManager.InitCoreTypes (Mono.CSharp.CompilerContext ctx) [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0
Build complete -- 1 error, 0 warnings
---------------------- Done ----------------------
Build: 1 error, 0 warnings
Somebody knows what's going on here?
Regards,
Claudio

Kevin is correct.
.NET has several "profiles" and the profiles are governed by their anchoring "mscorlib.dll". From the anchoring mscorlib.dll, all the rest of the assemblies flow. You will notice that you should not really mix an assembly compiled with a 2.0 mscorlib on a 4.0 system, or the other way around (they might work, but they are not guaranteed to work).
So in general, you need to compile your code using the same family of assemblies. When using the 4.0 mscorlib, you use the 4.0 family of assemblies; When using the 2.0, 3.5 and 3.5sp1, you use the 2.0 mscorlib; When you use Silverlight, you use the Silverlight 2.1 mscorlib set of APIs.
MonoTouch introduces its own anchoring mscorlib, versioned as 2.1.0.0 (the same one as Silverlight) and from this assembly, our API flows.
That is why you need to rebuild your libraries using Mono's assemblies for the 2.1.0.0 profile.

You can't link against DLLs compiled with Visual Studio. You have to recompile the DLL with Monotouch in order to use it.

Related

I'm getting IL2CPP build error for some reason

For some reason, I'm getting build errors. I was be able to build my project clearly with mono. I'm trying to build the project with IL2CPP now and getting some errors.
I tried:
Changing Windows language to English. In fact, I reinstalled Windows 11.
And reinstall Unity, Visual Studio and sdk, ndk etc.
Btw, the error is about file path of compile.rsp file. I manually checked that file path and the file. it is exist in the right file location.
Here is the errors and console messages.
Error 1:
Internal build system error. BuildProgram exited with code -2147024893.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Program Files\Unity\Hub\Editor\2021.2.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Release\StaticLibs\armeabi-v7a\compile.rsp'.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks)
at System.IO.File.InternalReadAllText(String path, Encoding encoding)
at System.IO.File.ReadAllText(String path)
at NiceIO.NPath.SystemIOFileSystem.File_ReadAllText(NPath path)
at NiceIO.NPath.WindowsFileSystem.File_ReadAllText(NPath path)
at Bee.Core.Stevedore.VirtualFileSystem.File_ReadAllText(NPath path)
at NiceIO.NPath.RelayingFileSystem.File_ReadAllText(NPath path)
at Bee.Core.BuildProgramFileSystem.File_ReadAllText(NPath path)
at NiceIO.NPath.ReadAllText()
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.SetupCompile(AndroidSharedLibraryConfiguration config, String name, AndroidTargetDeviceType deviceType, NPath sourceFilePath)
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.SetupLibUnityLibrary()+MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
at AndroidPlayerBuildProgram.AndroidPlayerBuildProgram.SetupPlayerBuild()
at PlayerBuildProgramLibrary.PlayerBuildProgramBase.RunBuildProgram()
at PlayerBuildProgramTypeWrapper.Run(String[] args)
at Program.Main(String[] args)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Error 2:
BuildFailedException: Incremental Player build failed!
UnityEditor.Modules.BeeBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <374d68101b9e4829844c8329406f32cc>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
I finally solved my problem.
2 things you must be sure
Set your Windows Display Language to English
Change your Unity version from 2021.2 to 2020.3
These 2 thing most probably solve your problem like mine
In case the answer presented doesn't help, I've found a different possible cause of the error: large arrays of values (over 10k elements) can't be handled by IL2CPP specifically. No clue why-how, it just was mentioned on a thread in Unity forum, and it did solve the problem for me - I just dropped all the values in the text file and parsed it on startup.

How to fin Win32Exception Error when adding Facebook SDK to Unity?

After adding the Facebook SDK into Unity I am getting this error and the Android Build Facebook Settings arent showing a dropdown.
Win32Exception: ApplicationName='cmd', CommandLine='/Cecho "xxx" | openssl base64', CurrentDirectory='', Native error= The system cannot find the file specified.
System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <3845a180c26b4889bc2d47593a665814>:0)
System.Diagnostics.Process.Start () (at <3845a180c26b4889bc2d47593a665814>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
Facebook.Unity.Editor.FacebookAndroidUtil.DoesCommandExist (System.String command) (at <1e648b4081db4625b06f95d668cd2dd4>:0)
Facebook.Unity.Editor.FacebookAndroidUtil.get_DebugKeyHash () (at <1e648b4081db4625b06f95d668cd2dd4>:0)
Facebook.Unity.Editor.FacebookAndroidUtil.get_SetupProperly () (at <1e648b4081db4625b06f95d668cd2dd4>:0)
Facebook.Unity.Editor.FacebookSettingsEditor.AndroidUtilGUI () (at <1e648b4081db4625b06f95d668cd2dd4>:0)
Facebook.Unity.Editor.FacebookSettingsEditor.OnInspectorGUI () (at <1e648b4081db4625b06f95d668cd2dd4>:0)
UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
install openSSL https://www.openssl.org/
I Solved Adding in Enviroment variable "C:\Windows\System32" example:
Path = C:\Windows\System32;C:\Program Files\Java\jdk1.7.0_51\bin;C:\OpenSSL\bin
be sure to add them in the exact order
ref : "Facebook SDK "Edit Settings" errors in Unity for Android"

Facebook SDK for Unity - error after import to nonempty project

Since yesterday I'm trying to resolve issues with Facebook SDK for Unity.
I tried it out on completely empty Unity project and everything works fine. I can build it and run on Android device without any problems.
So, I thought I can import package to my game in the same way, but I couldn't be more wrong.
Immediately after import I got this 2 errors:
ArgumentNullException: Argument cannot be null.
Parameter name: path
System.String.StartsWith (System.String value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:1549)
GooglePlayServices.PlayServicesResolver.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:27)
ArgumentNullException: Argument cannot be null.
Parameter name: path
System.IO.Directory.CreateDirectory (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:75)
GooglePlayServices.PlayServicesResolver.ResolveUnsafe (System.Action`1 resolutionComplete, Boolean forceResolution)
GooglePlayServices.PlayServicesResolver+<Resolve>c__AnonStorey11.<>m__19 ()
GooglePlayServices.PlayServicesResolver.ExecuteNextResolveJob ()
GooglePlayServices.PlayServicesResolver.Resolve (System.Action resolutionComplete, Boolean forceResolution, System.Action`1 resolutionCompleteWithResult)
GooglePlayServices.PlayServicesResolver.AutoResolve ()
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:183)
When I try to run project despite of this errors, I got new ones:
Gradle failed to fetch dependencies.
Failed to run 'C:\GameDev\AbstractRhythm\Temp\PlayServicesResolverGradle\gradlew.bat -b "C:\GameDev\AbstractRhythm\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" --no-daemon "-PANDROID_HOME=C:\Users\adrso\AppData\Local\Android\Sdk" "-PTARGET_DIR=C:\GameDev\AbstractRhythm\Assets\Plugins\Android" "-PMAVEN_REPOS=" "-PPACKAGES_TO_COPY=com.android.support:support-v4:25.3.1;com.android.support:appcompat-v7:25.3.1;com.android.support:cardview-v7:25.3.1;com.android.support:customtabs:25.3.1"'
stdout:
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files (x86)\Java\jdk1.7.0_55
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
stderr:
exit code: 1
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.<GradleResolution>c__AnonStorey14:<>m__20(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey15:<>m__29()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
NullReferenceException: Object reference not set to an instance of an object
GooglePlayServices.AndroidSdkManager+<Create>c__AnonStoreyA.<>m__C (GooglePlayServices.AndroidSdkPackageCollection packages)
GooglePlayServices.SdkManager+<QueryPackages>c__AnonStorey9.<>m__B (GooglePlayServices.Result result)
GooglePlayServices.SdkManagerUtil+<QueryPackages>c__AnonStorey4.<>m__4 (GooglePlayServices.Result result)
GooglePlayServices.CommandLineDialog+ProgressReporter.Update (GooglePlayServices.CommandLineDialog window)
GooglePlayServices.CommandLineDialog.Update ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:291)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:284)
UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:363)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:183)
I use: Facebook SDK for Unity version 7.13.0, Unity version 2018.1.0f2, Android API 28, Android SDK Build-Tools 28, Android SDK Platform-Tools 25.0.3, Android SDK Tools 25.2.4, Google Play services 49
Do you have any idea what's going on?
It required few steps to solve this problem:
Compare Assets/Plugins/Android/AndroidManifest.xml of unworking project with empty project that only have Facebook SDK.
Use Assets -> Play Services Resolver -> Android Resolver -> Force Resolve.
Check "Environment variables" in Windows, it turned out I had path to new JDK as well as old - remove old entry.
Make sure you don't have any app using same Facebook app ID on your device, you can only have one at a time.
I hope someone will save time thanks to this :)

Failed to repack resources After adding google play game service

I have added ConsoliAds plugin to my project and i can build android properly. But when I add Google Play Game plugin, during the build process I got Failed to re-package resources
There is an image before adding google play games
There is an image after adding google play game
During the build process I got Failed to re-package resources and these logs appear in the console.
I'm using the latest version of ConsoliAds and Google Play Game
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\ANDROID\AndroidSDK\build-tools\23.0.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/ANDROID/AndroidSDK\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.chartboost.sdk.unity:com.google.unity:com.heyzap:com.google.example.games.mainlibproj:com.google.android.gms.auth.api:com.google.android.gms.auth:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.nearby:com.Company.ProductName:android.support.compat:android.support.coreui:android.support.coreutils:android.support.fragment:android.support.mediacompat:android.support.v4:com.papata.btb:com.unity3d.ads -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-base-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-drive-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-games-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-nearby-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-compat-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-core-ui-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-core-utils-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-fragment-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-media-compat-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-v4-23.0.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\unity-android-resources\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\UnityAds\res"
stderr[
E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml:9: error: Error: No resource found that matches the given name (at 'src' with value '#drawable/googleg_standard_color_18').
E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml:16: error: Error: No resource found that matches the given name (at 'src' with value '#drawable/googleg_disabled_color_18').
E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_light_normal.xml:9: error: Error: No resource found that matches the given name (at 'src' with value '#drawable/googleg_standard_color_18').
]
stdout[
Configurations:
(default)
Files:
AndroidManifest.xml
Src: () AndroidManifest.xml
Resource Dirs:
Including resources from package: D:\ANDROID\AndroidSDK\platforms\android-23\android.jar
applyFileOverlay for drawable
trying overlaySet Key=common_google_signin_btn_text_dark_normal.xml
trying overlaySet Key=common_google_signin_btn_text_disabled.xml
trying overlaySet Key=common_google_signin_btn_text_light_normal.xml
trying overlaySet Key=app_banner.png
trying overlaySet Key=app_icon.png
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
applyFileOverlay for mipmap
Processing image: res\drawable-xhdpi\app_banner.png
Processing image: res\drawable\app_icon.png
(processed image res\drawable\app_icon.png: 99% size of source)
Processing image: res\drawable-ldpi\app_icon.png
Processing image: res\drawable-hdpi\app_icon.png
(processed image res\drawable-ldpi\app_icon.png: 98% size of source)
Processing image: res\drawable-xhdpi\app_icon.png
(processed image res\drawable-hdpi\app_icon.png: 99% size of source)
Processing image: res\drawable-xxhdpi\app_icon.png
(processed image res\drawable-xhdpi\app_icon.png: 99% size of source)
Processing image: res\drawable-xxxhdpi\app_icon.png
(processed image res\drawable-xhdpi\app_banner.png: 93% size of source)
(processed image res\drawable-xxhdpi\app_icon.png: 99% size of source)
(processed image res\drawable-xxxhdpi\app_icon.png: 99% size of source)
(new resource id app_banner from xhdpi-v4\drawable\app_banner.png #generated)
(new resource id app_icon from drawable\app_icon.png #generated)
(new resource id app_icon from ldpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from hdpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from xhdpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from xxhdpi-v4\drawable\app_icon.png #generated)
(new resource id app_icon from xxxhdpi-v4\drawable\app_icon.png #generated)
(new resource id common_google_signin_btn_text_dark_normal from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml)
(new resource id common_google_signin_btn_text_disabled from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml)
(new resource id common_google_signin_btn_text_light_normal from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_light_normal.xml)
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()
Updated: My Problem solved and I explained that here.
I tried everything in the internet nothing worked for me.
Here is what that I did to fix this issue.
Not much but don't get mad at me
Step 1: Export all asstets, resources ane everything except google services file. (If you are using multiple Google packages like me eg. Play service, ad seevice, IAP package don't export then). Export as unity package.
Step 2: create a new unity project
Step 3: First import all Google Play packages, don't import your package
Step 4: build and check that the is no error with the empty scene in your new project
Step 5: import your exported package from previous step
Step 6: fix errors in script file due to dependency in Google package
Step 7: build your project
Note: don't move your project to new location it may cause repacking issue again. I don't know why but this occurred to me

Running nunit-console on a solution file leads to System.IO.FileLoadException

When I try to use nunit-console.exe to run all the tests in a solution file as such:
nunit-console.exe MyProject.sln
I get the following exception (shown below). However when run the console runner on ANY of the projects in my folder structure, the runner works just fine and never gives me the following exception. I also am pretty certain that the version of the nunit library that I am linking to is the same as the runner that I am using. Also, my solution doesn't reference any projects that are outside the directory structure containing my .sln file.
Does anyone have any clue what I can do!? :(
Thanks!
Phil
NUnit version 2.5.10.11092
Copyright (C) 2002-2009 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Version: 4.0.30319.1 ( Net 4.0 )
ProcessModel: Default DomainUsage: Default
Execution Runtime: net-4.0
Unhandled Exception:
System.IO.FileLoadException: Could not load file or assembly 'nunit.framework, Version=2.5.10.11092, Culture=neutral, Pu
blicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The located assembly's manifest definition does not match the
assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77'
Server stack trace:
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount,
IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInsta
ntiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHa
ndle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethod
Arguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope
, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilte
rType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMeth
odInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken,
Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecorate
dTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at NUnit.Core.CoreExtensions.InstallAdhocExtensions(Assembly assembly)
at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server,
Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExec
uteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at NUnit.Core.TestRunner.Load(TestPackage package)
at NUnit.Util.TestDomain.Load(TestPackage package)
at NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
at NUnit.ConsoleRunner.Runner.Main(String[] args)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Try using the Fusion Log Viewer to see what assembly is failing to load. It should tell you not only what file it is failing on, but where it tried looking for that file.
In my case nunit-console.exe did not respect the assembly redirection from web|app.config. unless you provide /domain=multiple
My Problem:
EntityFrameworkTesting.Moq -> requests Moq, Version=4.2.1409.1722
I had already a newer assembly referenced.
The solution for me was to add /domain=multiple parameter. see the NUnit docs
So I run:
D:\tools\NUnit-2.6.4\bin\nunit-console.exe %SOLUTION_PATH%\Project.sln /config:Release /framework:net-4.0 /domain=multiple /xml=nunit-result.xml