表单:跳过Android链接器上的Azure程序集
我们已经在xamarin表单中构建了一个应用程序。当链接器设置为“无”时,它在调试模式下运行良好 如果我们现在将应用程序设置为release mode with linker为NONE,它会立即崩溃 如果我们将应用程序设置为调试模式,并将链接器设置为SDK,则仅在应用程序启动时崩溃:表单:跳过Android链接器上的Azure程序集,android,azure,xamarin.forms,Android,Azure,Xamarin.forms,我们已经在xamarin表单中构建了一个应用程序。当链接器设置为“无”时,它在调试模式下运行良好 如果我们现在将应用程序设置为release mode with linker为NONE,它会立即崩溃 如果我们将应用程序设置为调试模式,并将链接器设置为SDK,则仅在应用程序启动时崩溃: XALNK7000: Mono.Linker.MarkException: Error processing method: 'Newtonsoft.Json.Linq.JObject Microsoft.Wind
XALNK7000: Mono.Linker.MarkException: Error processing method: 'Newtonsoft.Json.Linq.JObject Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore::ReadRow(Microsoft.WindowsAzure.MobileServices.SQLiteStore.TableDefinition,SQLitePCL.sqlite3_stmt)' in assembly: 'Microsoft.Azure.Mobile.Client.SQLiteStore.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.String SQLitePCL.raw::sqlite3_column_name(SQLitePCL.sqlite3_stmt,System.Int32)
bei Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
bei Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
bei Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
bei Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
bei Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
bei Mono.Linker.Steps.MarkStep.ProcessQueue()
--- Ende der internen Ausnahmestapelüberwachung ---
bei Mono.Linker.Steps.MarkStep.ProcessQueue()
bei Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
bei Mono.Linker.Steps.MarkStep.Process()
bei Mono.Linker.Steps.MarkStep.Process(LinkContext context)
bei MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
bei Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
bei Mono.Linker.Pipeline.Process(LinkContext context)
bei MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
bei Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
bei Xamarin.Android.Tasks.LinkAssemblies.RunTask()
bei Xamarin.Android.Tasks.AndroidTask.Execute() 0
应用程序在调试模式下启动良好,链接器设置为无
如果我们想在发行版中部署应用程序,并将链接器设置为除链接SDK和程序集之外的任何其他对象,则应用程序将启动,但会出现错误
1.)启动,但应用程序中的某些文本完全丢失。
2.)在某些azure调用时,应用程序崩溃
现在,我们将应用程序设置为调试模式,并将链接器设置为link SDK和ASSEMBLYS,应用程序将按照前面提到的方式启动:
缺少某些文本(与以前相同)
如果我点击我收到的第一个azure呼叫:
private TableManager()
{
this.client = new MobileServiceClient(Q2go.View.Constants.ApplicationURL);
this.eventItem = client.GetTable<Event>();
this.partnerItem = client.GetTable<Partner>();
this.partnerInfoItem = client.GetTable<PartnerInfo>();
this.scanItem = client.GetTable<Scan>();
this.packageItem = client.GetTable<Package>();
}
综上所述:
如果设置为“调试”且链接器设置为“无”,则该应用程序可以正常工作
当链接器同时设置为SDK和Assembly时,应用程序将仅在发布模式下启动。
但即使在启动时,它也存在重大错误:例如缺少文本和无法使用azure方法
我认为解决方案是跳过azure调用,如:
<PropertyGroup>
<AndroidLinkSkip>Microsoft.Azure.Mobile.Client;Microsoft.Azure.Mobile.Client.SQLiteStore</AndroidLinkSkip>
</PropertyGroup>
Microsoft.Azure.Mobile.Client;Microsoft.Azure.Mobile.Client.SQLiteStore
但这根本没有效果。也许我的语法错了
不管怎样,我们这里需要很大的帮助。
目前,在发布模式下启动应用程序时,如果没有重大错误或根本不启动,就无法实现
我们会错过什么
编辑::
我还刚刚意识到,如果我们将应用程序设置为“发布模式”,并将链接设置为“无”,然后将其应用到手机上:你无法卸载该应用程序。点击图标将立即显示应用程序的崩溃消息,因此我们甚至无法进入菜单卸载应用程序
<PropertyGroup>
<AndroidLinkSkip>Microsoft.Azure.Mobile.Client;Microsoft.Azure.Mobile.Client.SQLiteStore</AndroidLinkSkip>
</PropertyGroup>