I'm trying to build an, only iOS, app but I get two errors:
linker command failed with exit code 1 (use -v to see invocation)
Native linking failed for '/Users/{name}/Desktop/{application name}/{application name}/obj/iPhone/Debug/device-builds/iphone8.1-11.1.2/mtouch-cache/arm64/libSomething.dll.dylib'. Please file a bug report at http://bugzilla.xamarin.com
I get these errors with a dll generated from a binding of a (native obj-c) static library with XCode 9.2
I'm using Visual Studio 7.2 with Xamarin.iOS 11.6.1.2
I fixed it.
The error was in the Static Library, was missing two classes.
I've added these two in XCode and then works.
Related
When trying to build my Xamarin project in Visual Studio 2022 I am receiving this error:
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Debug\120\lp\100\jl\bin\classes.jar : com/google/android/gms/measurement/internal/zzai.class
My build log shows this:
Error in obj\Debug\120\lp\100\jl\bin\classes.jar:com/google/android/gms/measurement/internal/zzai.class:
Type com.google.android.gms.measurement.internal.zzai is defined multiple times: obj\Debug\120\lp\100\jl\bin\classes.jar:com/google/android/gms/measurement/internal/zzai.class, obj\Debug\120\lp\101\jl\bin\classes.jar:com/google/android/gms/measurement/internal/zzai.class
I have used 7zip to extract the specified zzai.class file however I don't know what to do from here. Trying to edit the file in notepad++ just shows noninterpretable code.
I fixed the issue by uninstalling unnecessary NuGet packages for Xamarin.GooglePlayServices.Measurement, only keeping the dependent packages required for Xamarin.Firebase.Analytics:
Xamarin.GooglePlayServices.Measurement
Xamarin.GooglePlayServices.Measurement.Api
Xamarin.GooglePlayServices.Measurement.Sdk
I am trying run a Xamarin iOS app on a device with Visual Studio. However I get the following error:
Error MT4116: Could not register the assembly 'Xamarin.Auth.iOS':
error MT4118: Cannot register two managed types
('Xamarin.Controls.ProgressLabel, Xamarin.Auth.iOS' and
'Xamarin.Controls.ProgressLabel, Xamarin.Auth') with the same native
name ('Xamarin_Controls_ProgressLabel'). (MT4116)
The ProgressLabel class seems to be defined in Xamarin.Auth.iOS and Xamarin.Auth twice.
Does anyone have an idea how to solve this?
Just installed MonoDevelop and I tried to compile a simple "Hello World".
Code I used:
using System;
public class HelloWorld
{
static public void Main ()
{
Console.WriteLine ("Hello Mono World");
}
}
The error that I get is :
EmptyCSharpFile.csproj(1,1): Error: Unknown MSBuild failure. Please try building the project again (EmptyCSharpFile)
My system info:
Ubuntu 16.04 LTS , updated
The MonoDevelop and mono are freshly installed.
Mono JIT compiler version 5.0.1.1
MonoDevelop Version 5.10
I can use mcs and run it but can't use monodevelop to run it.
I did read these similar topics but no response yet:
MonoDevelop Failure "Unknown MSBuild Failure" on Linux ;
C# compile Unknown MSBuild error MonoDevelop Linux ; https://askubuntu.com/questions/73630/could-not-obtain-c-compiler-error-when-using-monodevelop
I too had the same problem when I first installed it , I assume you went straight to file -> new-> file-> general -> emptyc# file.
Instead of that, go to file->new-> solution from there choose Console C# project or simply press ctrl + shift + N choose next ,and give project name, by default the new project has a simple hello world program run it, this time it will work.(it worked for me)
I have an UWP app written in C# which builds (VS 14.0.25425.01 Update 3 on Windows 10.0.14393, target version of the project is build 14393) and runs in Debug mode, but fails to build in Release mode with the following error:
Microsoft.NetNative.targets(640,5): error : MCG0004:InternalAssert Assert Failed: field not found during [UNKNOWN]
There are no further details, except for two warnings before, which I am not sure whether they are related to the problem:
Resources.System.Linq.Expressions.rd.xml(35): warning : ILTransform : warning ILT0027: Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found.
Resources.System.Linq.Expressions.rd.xml(91): warning : ILTransform : warning ILT0027: Method 'ParameterIsAssignable' within 'System.Linq.Expressions.Expression' could not be found.
Any suggestions what the issue could be related to?
This error will occur if you're using the Beta package for .NET UWP tools with VS 2015. The Beta package is only supported on 2017 as there are changes to how deployment/debugging work that we rely on. You should be able to avoid the issue by downgrading from "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.0-beta2" to "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
edit: 5.3.0 has been published and works with VS2017 RC3+. More information here: https://blogs.msdn.microsoft.com/dotnet/2017/01/30/announcing-net-core-net-native-and-nuget-updates-in-vs-2017-rc/
Disclaimer: I work on the .NET Native compiler+runtime team.
I just installed Xamarin 3.9.289 (newest version). When using both Visual Studio 2013 or Xamarin Studio, I get the following error:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error MSB4018: The "GetAdditionalResourcesFromAssemblies" task failed unexpectedly.
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
at System.String.Substring(Int32 startIndex, Int32 length)
at Xamarin.Android.Tasks.GetAdditionalResourcesFromAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() (MSB4018) (Xamarin.Droid)
What is the reason for this and how could I fix it?
Further info:
Android SDK Tools: 24.0.2
Android SDK Platform Tools: 21
Android SDK Build Tools: 21.1.2
The problem was that my sample project was called "Xamarin" - looking at the disassembled code of the build dll shows that it is searching for that string internally and sadly starts from the left, not the right.
The fix is easy: Rename the project.
Xamarin.Android applications use a linker in order to reduce the size of the application.The default value is SdkOnly
None: No linking will be attempted.
SdkOnly: Linking will be
performed on the base class libraries only, not user's assemblies.
Full: Linking will be performed on base class libraries and user
assemblies.
For more details refer here..
Note: if you are facing an issue with linking such as
LinkAssemblies" task failed unexpectedly. or
"GetAdditionalResourcesFromAssemblies" task failed unexpectedly.
System.IO.FileNotFoundException: . Perhaps it doesn't exist in the Mono for Android profile?
then recheck your xamarin.Android project settings and set the below tag,
<TargetFrameworkVersion>v4.4</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
Hope it will be helpful.