出现如下提示,错误: 找不到或无法加载主类 com.sun.tools.javac.MainMSB6006:

閿欒: 绋嬪簭鍖卆ndroid.support.v4.view.ViewPager涓嶅瓨鍦?

删掉bin,obj文件夹重新生成

还是没有效果的话参照这里http://blog.csdn.net/cctvcqupt/article/details/46636809


Your emulator is out of date, please update by launching Android Studio:
 - Start Android Studio
 - Select menu "Tools > Android > SDK Manager"
 - Click "SDK Tools" tab
 - Check "Android SDK Tools" checkbox
 - Click "OK"

这个问题的解决方案其实不需要我汇总。。。错误信息很明白了

打开 Visual Studio,工具>Android>SDK 管理器,更新 Android SDK Tools


开启 ProGuard 后无法编译

https://forums.xamarin.com/discussion/54656/proguard-with-api-23-wont-compile-on-release-with-google-play-services-27-0-0-0
https://forums.xamarin.com/discussion/45210/enable-proguard-error-c-program-files-access-is-denied
https://www.shisujie.com/blog/Enable-ProGuard-Cause-Java-Exit


运行时错误不显示错误详情

监听

AndroidEnvironment.UnhandledExceptionRaiser

事件


System.IO.IsolatedStorage 无法使用

Xamarin Android nuget上的 System.IO.IsolatedStorage 是假的,请换用 System.IO 读写


System.IO 操作无效

确保路径分隔符正确


HttpWebRequest 的 AllowReadStreamBuffering 无法设置为 true

mono 目前没有实现这个属性,无解


iOS 无法生成

确保项目里的所有PNG都是有效的,还不行试试关闭优化 png 的选项


android 模拟器测试卡在部署阶段

生成,取消生成,然后再试一次


iOS 的优化 PNG 选项无法开启

删掉 iOS 项目中的无效 PNG 文件


Cannot build iOS App (Can not resolve reference: C:/Windows/Microsoft.NET/Framework/v4.0.30319/语言代码/mscorlib.resources.dll)

https://bugzilla.xamarin.com/show_bug.cgi?id=56213#c12

Hi All,
I'm sorry you're facing this bug. There is a workaround for both the build and debug issues:
1- On Windows, open the Visual Studio 2017 installation folder. (Default: C:\Program Files (x86)\Microsoft Visual Studio\2017\<Edition>\)
2- Navigate to MSBuild\Xamarin.
3- Open the Xamarin.Apple.Sdk.targets file in an editor with Administrator privileges.
4- At the end of the file you'll find a PropertyGroup (line 100), between the PropertyGroup tags add the following line:
<FrameworkPathOverride>$(TargetFrameworkRootPath)$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)</FrameworkPathOverride> In case you're still able to reproduce this bug after applying the workaround, please let us know and attach a Detailed build output and the Xamarin Logs (Help -> Xamarin -> Zip Logs...) Thanks!

在位于100行的PropertyGroup元素中加入这一行<FrameworkPathOverride>$(TargetFrameworkRootPath)$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)</FrameworkPathOverride>


DisplayAlert或UIAlertView在iOS无法正常工作

换用iPhone SE模拟器


启动模拟器后没有启动调试

不关闭模拟器重新调试


Effect的Control为null

Xamarin的Control里面是不含子元素的View,所以Control为null时试试Container


Android 7.0上不显示 SearchBar

设置HeightRequest为48


Unhandled Exception:  System.TypeLoadException: Could not resolve type with token

重新生成项目


MSB3644 Xamarin.iOS,Version=v1.0 binding Microsoft.Common.CurrentVersion.targets

参考https://bugzilla.xamarin.com/show_bug.cgi?id=56213#c24


无法“存档”APK

But I found another strange workaround:
If I compile and Archive, the Archive will fail. Then I Archive once
more and it will also fail. But now it is possible to Distribute the
last failed Archive!
I have so far not found any problem at all with the distributed apk
file. It runs without any problem and Google Play accepts it.

参考 https://forums.xamarin.com/discussion/86557/xamarin-archive-manager-fails-with-the-specified-path-file-name-or-both-are-too-long


发布生成的 APK 莫名闪退

试试打开 Nuget 管理器,看是否提示需要重启,按提示操作


https://stackoverflow.com/questions/44122396/after-updating-xamarin-forms-nuget-package-the-task-could-not-be-loaded-fr


还有一些问题参见这里

https://releases.xamarin.com/common-issues-in-the-xamarin-15-2-2-release-being-tracked-by-the-xamarin-team/


提示没有调用 super.OnCreated

清理解决方案


调试卡在使用临时签名签名

取消并重新调试


Android新创建的模拟器启动后立刻闪退且ADB工具无法复制文件到模拟器中

更新各种android tools


如果这些还没有解决你的问题,试试

  • 清理项目
  • 重新生成项目
  • 手动删掉bin和obj
  • 重启visual studio
  • 重启电脑

本文持续更新

Xamarin 常见问题解决方案汇总的更多相关文章

  1. Android WebView常见问题解决方案汇总

    问题目录: 1.为WebView自定义错误显示界面: 2.WebView cookies清理 3.清理cache 和历史记录 4.判断WebView是否已经滚动到页面底端 5.URL拦截 6.处理We ...

  2. Android WebView常见问题及解决方案汇总

    Android WebView常见问题解决方案汇总: 就目前而言,如何应对版本的频繁更新呢,又如何灵活多变地展示我们的界面呢,这又涉及到了web app与native app之间孰优孰劣的争论. 于是 ...

  3. Android之Android WebView常见问题及解决方案汇总

    如有转载,请声明出处: 时之沙: http://blog.csdn.net/t12x3456 Android WebView常见问题解决方案汇总: 就目前而言,如何应对版本的频繁更新呢,又如何灵活多变 ...

  4. ASP.NET检测到有潜在危险的 Request.Form 值解决方案汇总

    ASP.NET检测到有潜在危险的 Request.Form 值解决方案汇总 当我们在网站中使用CKEditor等富文本编辑器时,大多都会遇到这样的到警告 这是因为ASP.NET默认开启对页面提交内容的 ...

  5. adb连接手机报错解决方案汇总(win7)

    >>adb devices常见错误:   >>解决方案汇总 检查端口是否占用:netstat -ano | findstr 5037 | findstr LISTENING 检 ...

  6. 使用jquery.qrcode生成二维码及常见问题解决方案

    转载文章  使用jquery.qrcode生成二维码及常见问题解决方案 一.jquery.qrcode.js介 jquery.qrcode.js 是一个纯浏览器 生成 QRcode 的 jQuery ...

  7. WordPress疑难问题以及解决方案汇总

    版权声明:本文为xing_star原创文章,转载请注明出处! 本文同步自http://javaexception.com/archives/101 WordPress疑难问题以及解决方案汇总: 最近这 ...

  8. JWT 身份认证优缺点分析以及常见问题解决方案

    本文转载自:JWT 身份认证优缺点分析以及常见问题解决方案 Token 认证的优势 相比于 Session 认证的方式来说,使用 token 进行身份认证主要有下面三个优势: 1.无状态 token ...

  9. 分布式事务解决方案汇总:2PC、3PC、消息中间件、TCC、状态机+重试+幂等(转)

    数据一致性问题非常多样,下面举一些常见例子.比如在更新数据的时候,先更新了数据库,后更新了缓存,一旦缓存更新失败,此时数据库和缓存数据会不一致.反过来,如果先更新缓存,再更新数据库,一旦缓存更新成功, ...

随机推荐

  1. 25.ProfileService实现(调试)

    上一节课拿到的AccessToken和IdToken 实现ProfileService类 在服务端 添加ProfileService类 需要继承IProfileServiuce 用到的画图工具 Ipr ...

  2. Working Experience - WPF 中 DataGrid 控件的应用

    问题: 添加控件后, 编辑单元格会出现异常 绑定 ItemsSource 属性后, 更新绑定对象的数据, UI 不刷新 如何显示控件中 ComboBox 类型 解决方法: 绑定 ItemsSource ...

  3. std::function"函数"对象包装器

    语义: 类模板std::function是可调用对象的包装器,可以包装除了类成员之外的所有可调用对象.包括,普通函数,函数指针,lambda,仿函数.通过指定的模板参数,它可以用统一的方式保存,并延迟 ...

  4. Netdata 是一款 Linux 性能实时监测工具

    具体的netdata介绍请参照GIT:https://github.com/firehol/netdata/wiki 以下只介绍centos下的netdata的安装与使用: 1.安装Netdata需要 ...

  5. js上传文件到后台时序列化数据

    let fd = new FormData() // 定义传递的序列化对象,for (let i = 0; i < addArr.length; i++) { // addArr是选中文件的输入 ...

  6. element ui 修改默认样式

    修改element ui默认的样式 如果要组件内全局修改 首先在浏览器里F12找到element默认的UI类名 找到要修改的默认类名以后 在文件中修改代码,重写属性 <style> .el ...

  7. IT兄弟连 Java语法教程 变量1

    什么是变量 在Java程序中,变量是基本的存储单元.是在程序运行中值可以改变的一块内存区域.变量是通过标识符(变量名).变量类型及可选的初始化器来定义的,此外,所有的变量都有作用域,作用域定义了变量的 ...

  8. 你必须学写 Python 装饰器的五个理由

    你必须学写Python装饰器的五个理由 ----装饰器能对你所写的代码产生极大的正面作用 作者:Aaron Maxwell,2016年5月5日 Python装饰器是很容易使用的.任何一个会写Pytho ...

  9. 引入clipboard.js

    引入clipboard.js var clipboardJS = new ClipboardJS('#accept-data'); // 括号内的是选择器

  10. 硬盘MBR和GPT区别

    似乎人人都可以张嘴就说"我懂电脑",但是总有一些看起来完全不懂但实际上非常基础的东西让"懂"与"不懂"清晰地划清界限.比如UEFI+GPT就 ...