Failed to resolve Android.App.fragment with link SDK assemblies only enabled

余生长醉 提交于 2019-12-24 03:55:29

问题


I'm getting the following error after adding Google Play Services to my application. I have Link SDK Assms Only enabled and it is critical to keep it enabled.

Sample here: https://dl.dropboxusercontent.com/u/19503836/so_googlemaptest.droid.zip

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Mono.Cecil.ResolutionException: Failed to resolve Android.App.Fragment
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
   at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
   at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
   at Mono.Linker.Steps.MarkStep.Initialize()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() (MSB4018) (googlemaptest.droid)

How could I do to help linker to resolve Fragment?


回答1:


It is GooglePlayServicesFroyo issue and fix is available in the Xamarin Component store from Oct 19th. MapFragment type is no longer present! You can use GooglePlayServicesFroyo 12.0.1 component right from Xamarin component store and it works fine with SDK Only linker option.

I was able to submit version with linker enabled to Google Play.

Here is Xamarin forum discussion: http://forums.xamarin.com/discussion/8428/google-play-services-froyo-xamarin-component-doesn-t-work-in-release-mode/p2



来源:https://stackoverflow.com/questions/19083289/failed-to-resolve-android-app-fragment-with-link-sdk-assemblies-only-enabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!