我用xamarin.form PCL创建了一个项目.
我已经添加了 .....
根据所有平台(Android,iOS,Window Phone)的要求添加了xamarin.forms.maps和其他库和NuGet Package.
我在所有平台上都给出了所有权限和配置.
我已成功在窗口电话中显示地图和运行程序,但我在android中有错误.
错误是
严重性代码说明项目文件行列错误java.lang.OutOfMemoryError.考虑增加$(JavaMaximumHeapSize)的值.执行'java.exe -jar C:\ Program Files(x86)\ Android\android-sdk\build-tools\23.0.2\lib\dx.jar" - no-strict - 时,Java内存不足dex --output = obj\Debug\android\bin obj\Debug\android\bin\classes"C:\ Program Files(x86)\ Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\mono.android.jar" D:\ Project\SimplyFood\SimplyFood\SimplyFood.Droid\obj\Debug__library_projects __\FormsViewGroup\library_project_imports\formsviewgroup.jar"C:\ Users\PB DEV\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3\embedded\libs\internal_impl-23.0.1.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\Android.Support.v7.AppCompat\23.0.1.3\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\Android.Support.v7.CardView\23.0.1.3\embedded\classes.jar""C:\ Users\PB DEV\AppData \当地\ Xamarin\Android.Support.v7.MediaRoute r\23.0.1.3\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\Android.Support.v7.MediaRouter\23.0.1.3\embedded\libs\internal_impl-23.0.1.jar ""C:\ Users\PB DEV\AppData\Local\Xamarin\Android.Support.v7.RecyclerView\23.0.1.3\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices .Ads\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Analytics\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.AppIndexing\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.AppInvite\26.0.0\embedded\classes.jar" "C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.AppState\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Base\26.0. 0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Cast\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Drive\26.0.0 \嵌入式\ CL asses.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Fitness\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.游戏\ 26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Gcm\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Identity\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Location\26.0.0\embedded\classes.jar"" C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Maps\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Nearby\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Panorama\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Plus\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.SafetyNet\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePl ayServices.Vision\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Wallet\26.0.0\embedded\classes.jar""C:\ Users\PB DEV\AppData\Local\Xamarin\GooglePlayServices.Wearable\26.0.0\embedded\classes.jar"'SimplyFood.Droid
更新后所有nuget包我得到以下错误...
解压缩失败.请下载 https://dl-ssl.google.com/android/repository/google_m2repository_r15.zip 并将其解压缩到D:\ Project\TestApp\packages\Xamarin.GooglePlayServices.22.0.0.0\lib\MonoAndroid41\22.0.0\content目录.TestApp.Droid
解压缩失败.请下载 https://dl-ssl.google.com/android/repository/google_m2repository_r15.zip 并将其解压缩到D:\ Project\TestApp\packages\Xamarin.GooglePlayServices.22.0.0.0\lib\MonoAndroid41\22.0.0\content目录.
错误原因:D:\ Project\TestApp\packages\Xamarin.GooglePlayServices.22.0.0.0\lib\MonoAndroid41\22.0.0\742021DEBBD30AFFB5B67FB39AB43D94.zip不是有效的zip文件TestApp.Droid
错误原因:D:\ Project\TestApp\packages\Xamarin.GooglePlayServices.22.0.0.0\lib\MonoAndroid41\22.0.0\742021DEBBD30AFFB5B67FB39AB43D94.zip不是有效的zip文件TestApp.Droid
错误请安装包:SDK安装程序中提供的"Google Play服务".Java库文件D:\ Project\TestApp\packages\Xamarin.GooglePlayServices.22.0.0.0\lib\MonoAndroid41\22.0.0\embedded\classes.jar不存在.TestApp.Droid
错误请安装包:SDK安装程序中提供的"Google Play服务".Android资源目录D:\ Project\TestApp\packages\Xamarin.GooglePlayServices.22.0.0.0\lib\MonoAndroid41\22.0.0\embedded./不存在.TestApp.Droid
有没有其他方法可以使用xamarin在android,iPhone和Window手机中轻松集成地图?
如果您使用的是Visual Studio;
右键单击Droid项目,转到Android Options
选项卡,单击Advanced
并设置Java Max Heap Size
为1G
如果您正在使用Xamarin Studio,它应该是类似的东西.
它与所有正在加载的Java绑定有关,它会加载大量内存.使用此设置可以增加可用的默认内存.
你可以在一段时间之前在Xamarin的相关错误中阅读更多关于它的内容.https://bugzilla.xamarin.com/show_bug.cgi?id=8137#c14