Base solution for your next web application
Open Closed

Mobile.Droid Project : The "LinkAssemblies" task failed unexpectedly. #6025


User avatar
0
palco.ps created

Severity Code Description Project File Line Suppression State Error The "LinkAssemblies" task failed unexpectedly. Mono.Linker.MarkException: Error processing method: 'System.Void Abp.AutoMapper.AbpAutoMapperModule::CreateCoreMappings(AutoMapper.IMapperConfigurationExpression)' in assembly: 'Abp.AutoMapper.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void AutoMapper.IMappingExpression2<Abp.Localization.ILocalizableString,System.String>::ConvertUsing(System.Func2<!0,!1>) at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference) at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference) at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) at Mono.Linker.Steps.MarkStep.ProcessQueue() --- End of inner exception stack trace --- at Mono.Linker.Steps.MarkStep.ProcessQueue() at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() at Mono.Linker.Steps.MarkStep.Process() at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() ManageSysDemo.Mobile.Droid


16 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    try to

    • close Visual Studio and clear all BIN & OBJ folders
    • open Visual Studio and set to DEBUG mode
    • disable linker
    • Sometimes changing the Target Android Version and setting the Java Max Heap Size to 1024m in Android project settings solve the issue.
  • User Avatar
    0
    palco.ps created

    Thanks Alper,

    I tried the steps you mentioned, project build successfully, run on android machine, splash screen shown then app closed directly without continue to app main page. could you please help solving this issue?

    Thanks

  • User Avatar
    0
    alper created
    Support Team

    hi,

    need to see some logs! Get the logs from "Device Logs" window of your VS. And also you can put a breakpoint to ExceptionHandler class. The logs will give you some clue about what the real problem is.

    by the way read the Development-Guide-Xamarin if you have not done so far.

  • User Avatar
    0
    palco.ps created

    Hi Alper,

    I set Target Andriod version to 8.0 i gotten the error :

    error XA4212: Type Android.Support.V4.App.JobIntentService/JobServiceEngineImpl implements Android.Runtime.IJavaObject but does not inherit Java.Lang.Object or Java.Lang.Throwable. This is not supported. ManageSysDemo.Mobile.Droid

    When i change to any lower version < 7.1 i gotten the error:

    Severity Code Description Project File Line Suppression State Error In <declare-styleable> FontFamilyFont, unable to find attribute android:font ManageSysDemo.Mobile.Droid Error max res 25, skipping layout-v26 "max res 25, skipping layout-v26". ManageSysDemo.Mobile.Droid Error In <declare-styleable> AppBarLayout, unable to find attribute android:keyboardNavigationCluster ManageSysDemo.Mobile.Droid Error In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle ManageSysDemo.Mobile.Droid Error In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight ManageSysDemo.Mobile.Droid Error max res 25, skipping values-v26 "max res 25, skipping values-v26". ManageSysDemo.Mobile.Droid Error max res 25, skipping values-v26 "max res 25, skipping values-v26". ManageSysDemo.Mobile.Droid

    aslo this error occured after dispaly the message "no compatable code "

    Unhandled Exception:

    System.MissingMethodException: Method not found: void AutoMapper.IMappingExpression2.ConvertUsing(System.Func2<!0, !1>) occurred

    Could you please help solving this exception?

    Thanks

    Monther

  • User Avatar
    0
    alper created
    Support Team

    hi,

    see this issue https://github.com/aspnetzero/aspnet-zero-core/issues/1960 summary: downgrade your AutoMapper packages to v7.0.1

  • User Avatar
    0
    alper created
    Support Team

    by the way this is my working Android options screenshot

  • User Avatar
    0
    palco.ps created

    After apply all andriode properties changes , app working and hit this exception :

    Unhandled Exception:

    System.MissingMethodException: Method not found: void AutoMapper.IMappingExpression2.ConvertUsing(System.Func2<!0, !1>)

    exception hit when onResume event of spalch activity at the following line :

    ApplicationBootstrapper.InitializeIfNeeds<ManageSysDemoXamarinAndroidModule>();

  • User Avatar
    0
    alper created
    Support Team

    downgrade your AutoMapper packages to v7.0.1 https://github.com/aspnetzero/aspnet-zero-core/issues/1960

  • User Avatar
    0
    aaron created
    Support Team

    Related PR: https://github.com/aspnetboilerplate/aspnetboilerplate/pull/4034

  • User Avatar
    0
    palco.ps created

    Thanks All,

    it's working now , but i have this exception when navigating app:

    Unhandled Exception:

    System.ArgumentOutOfRangeException: Specified time is not supported in this calendar. It should be between 04/30/1900 00:00:00 (Gregorian date) and 11/16/2077 23:59:59 (Gregorian date), inclusive. Parameter name: time

    Could you please help solving this issue?

    Thanks

  • User Avatar
    0
    alper created
    Support Team

    what's the values for date and dateFormat and culture?

  • User Avatar
    0
    palco.ps created

  • User Avatar
    0
    aaron created
    Support Team

    03/25/1440 04:52:47 is not between 04/30/1900 00:00:00 (Gregorian date) and 11/16/2077 23:59:59 (Gregorian date).

  • User Avatar
    0
    palco.ps created

    Hi Aaron,

    03/25/1440 is Hijri date and the range is Gregorian , we need to change the culture setting , where we can change it?

    Is there configuration file to do it ? or we need to change it on mobile device settings ?

    Thanks

  • User Avatar
    0
    aaron created
    Support Team

    Try something like the answer to https://stackoverflow.com/questions/11189807/cannot-convert-from-hijri-date-to-gregorian-date-c.

  • User Avatar
    0
    alper created
    Support Team

    closing this issue as the root problem solved. if any further help is required create a new question.