2016-03-14 2 views
1

Я хотел заменить библиотеку Google.Plus из существующего приложения библиотекой Xamarin.Google.iOS.SignIn, используя Google Sign-In для iOS (https://components.xamarin.com/view/googleiossignin).Добавление Xamarin.Google.iOS.SignIn приводит к ошибке встроенного связывания (MT5209)

Однако ... при добавлении его и заменить старый код с новым (немного другой код), что приводит к ошибке компиляции:

/projectdir/MTOUCH: Error MT5209: Native linking error: file not found: /projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libOpenInChrome.a (MT5209) (Immo.Vlan.Touch) 
/projectdir/MTOUCH: Error MT5202: Native linking failed. Please review the build log. (MT5202) (Immo.Vlan.Touch) 

Вот соответствующая часть из журнала сборки:

MTOUCH: warning MT1302: Could not extract the native library 'libOpenInChrome.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libOpenInChrome.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTMOAuth2_external.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTMOAuth2_external.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTMOAuth2_internal.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTMOAuth2_internal.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libSignIn.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libSignIn.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGIPNSURL+FIFE.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGIPNSURL+FIFE.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_AddressBook.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_AddressBook.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_core.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_core.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_DebugUtils.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_DebugUtils.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_GTMURLBuilder.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_GTMURLBuilder.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_iPhone.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_iPhone.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_KVO.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_KVO.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_NSData+zlib.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_NSData+zlib.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 
MTOUCH: warning MT1302: Could not extract the native library 'libGTM_NSDictionary+URLArguments.a' from '/projectdir/obj/iPhoneSimulator/Debug/mtouch-cache/libGTM_NSDictionary+URLArguments.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). 

Любые предложения о том, как справиться с этим?

Niels

+0

FWIW У меня такая же проблема, но я получил пакет от NuGet. Xamarin.Google.iOS.Core и SignIn. –

+0

У меня проблема с аналогичной проблемой с использованием обновленной версии Google Analytics. Я также получил его от NuGet. Любые обновления? Найти решение еще? – clarky

ответ

0

После дополнительных исследований я думаю, что проблема в том, что нативные библиотеки упоминаться не включены в DLL. Если я открою DLL для текущей версии Google.Core (v1.3.2.1), то нет записи Resources. Если я открою v1.1.0beta-3, я могу увидеть запись ресурсов, содержащую все упомянутые библиотеки.

Таким образом, решение заключается в том, чтобы их правильно перестроить.

Я не уверен на 100%, что это ответ. По какой-то причине мой проект будет компилироваться отлично на симуляторе, но не на устройстве. Но тот факт, что он ссылается на недостающие имена, я думаю, очень наводящий на размышления.

+0

Симулятор строит более прощающий, поскольку полный проход линкера не запускается. Это позволяет вам пропускать символы во время сборки. Но если вы попытаетесь вызвать эти символы во время выполнения, приложение будет генерировать исключение. – holmes

2

Эти библиотеки dll больше не имеют встроенных библиотек. Добавление собственных библиотек теперь обрабатывается в дополнительной задаче сборки, которая добавляется в проект приложения, когда NuGet добавляется в проект приложения.

Обязательно добавьте NuGet или компонент в проект приложения.

Некоторые из них столкнулись с проблемой, когда Microsoft.Bcl.Build NuGet также добавлен в проект. В ближайшее время мы намерены выпустить патч для этой проблемы. Посмотрите версию 0.2.1 из Xamarin.Build.Download NuGet.

Чтобы обойти эту проблему вам нужно отредактировать файл цели packages/Xamarin.Build.Download.0.2.0/build/Xamarin.Build.Download.targets

Добавьте атрибут AfterTargets="AssignProjectConfiguration" к _XamarinBuildDownload цели.

<Target 
    Name="_XamarinBuildDownload" 
    DependsOnTargets="_XamarinBuildDownloadCore;_XamarinBuildAddDownloadedItems" 
    AfterTargets="AssignProjectConfiguration" 
    Condition="'@(XamarinBuildDownload)'!=''" 
    /> 
+0

Я вижу ту же ошибку с iOS Google Analytics. Вы знаете, если это аналогичная проблема? Я уже добавил компонент NuGet. MTOUCH: warning MT1302: Не удалось извлечь собственную библиотеку libGoogleAnalytics.a из '/Debug/mtouch-cache/libGoogleAnalytics.a'.Убедитесь, что собственная библиотека была правильно встроена в управляемую сборку (если сборка была построена с использованием проекта привязки, в проект должна быть включена собственная библиотека, а ее действие сборки должно быть «ObjcBindingNativeLibrary»). – clarky

+0

Я считаю, что это связано. Вы уверены, что вы добавили NuGet в проект приложения, а не только проект библиотеки, который ссылается на проект приложения? – holmes

+0

Я пошел в Project> Добавить пакеты NuGet ... и добавил библиотеку iOS Google Analytics iOS – clarky

0

Я решил такую ​​же проблему с помощью Google Analytics на Xamarin IOS установки Xamarin.Build.Download 0.2.2-beta1

Я надеюсь, что это будет как можно скорее стабильной версии.

Смежные вопросы