Problemas ao vincular a biblioteca Objective-C ao C # com o Objective Sharpie
Estou tentando seguir este guia:
https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/walkthrough/
tentando criar ligações para este projeto do github:
https://github.com/lminhtm/LMGaugeView
Usando o Sharpie 3.4.
Estou enfrentando os seguintes problemas:
Não consigo gerar um binário Fat com as arquiteturasi386 armv7 x86_64 arm64
porque estou construindo contra o iOS11. Só posso gerar um binário Fat com arquiteturasx86_64
earm64
, tentar os outros me dá a mensagem de erroinvalid iOS deployment version, iOS 10 is the max deployment target for 32-bit targets
. Isso é esperado?
Quando uso o Sharpie, sou capaz de gerar os arquivos API e Struct, no entanto, cada um desses arquivos é enorme, com Structs terminando em linhas de 24K + e linhas de 54K + da API. Também segui um tutorial do youtube e a saída que ele obteve foi de cerca de 200 linhas, então o fato de as minhas serem tão grandes me faz pensar que algo está acontecendo. Seu tutorial não era para o meu mesmo projeto Objective-C, mas eu até tentei o mesmo que ele fez e acabei com o mesmo resultado.
O arquivo Struct acaba com mais de 7K erros, e vejo inúmeras linhas que se parecem com:
// extern long double tanhl (long double) __attribute__((const)) __attribute__((nothrow));
[DllImport ("__Internal")]
[Verify (PlatformInvoke)]
static extern [unsupported Builtin: long double] tanhl ([unsupported Builtin: long double]);
Onde estão faltando nomes de identificadores e tem este [não suportado Builtin: peça que eu não entendo.
Há também inúmeras referências a outras versões do iOS, e watchOS e TV, então parece que ele está tentando criar a API e o Structs para todos os SOs e versões existentes, o que faz sentido por que os arquivos seriam tão grandes. Aqui está um pequeno trecho do arquivo Struct:
// extern CGPathRef _Nullable CGPathCreateCopyByTransformingPath (CGPathRef _Nullable path, const CGAffineTransform * _Nullable transform) __attribute__((availability(ios, introduced=5.0))) __attribute__((cf_audited_transfer));
[iOS (5,0)]
[DllImport ("__Internal")]
[Verify (PlatformInvoke)]
[return: NullAllowed]
static extern unsafe CGPathRef* CGPathCreateCopyByTransformingPath ([NullAllowed] CGPathRef* path, [NullAllowed] CGAffineTransform* transform);
// extern CGMutablePathRef _Nullable CGPathCreateMutableCopy (CGPathRef _Nullable path) __attribute__((availability(ios, introduced=2.0))) __attribute__((cf_audited_transfer));
[iOS (2,0)]
[DllImport ("__Internal")]
[Verify (PlatformInvoke)]
[return: NullAllowed]
static extern unsafe CGMutablePathRef* CGPathCreateMutableCopy ([NullAllowed] CGPathRef* path);
// extern CGMutablePathRef _Nullable CGPathCreateMutableCopyByTransformingPath (CGPathRef _Nullable path, const CGAffineTransform * _Nullable transform) __attribute__((availability(ios, introduced=5.0))) __attribute__((cf_audited_transfer));
[iOS (5,0)]
[DllImport ("__Internal")]
[Verify (PlatformInvoke)]
[return: NullAllowed]
static extern unsafe CGMutablePathRef* CGPathCreateMutableCopyByTransformingPath ([NullAllowed] CGPathRef* path, [NullAllowed] CGAffineTransform* transform);
Eu sei que esses arquivos devem ser bem menores, principalmente porque o código Objective-C é um único arquivo de cabeçalho. O que eu poderia estar fazendo de errado aqui?
Posso fornecer mais detalhes, se necessário!