Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何修复在xamarin中为monodroid使用google play服务时出现的警告/错误?_C#_Google Maps_Xamarin.android_Google Play Services - Fatal编程技术网

C# 如何修复在xamarin中为monodroid使用google play服务时出现的警告/错误?

C# 如何修复在xamarin中为monodroid使用google play服务时出现的警告/错误?,c#,google-maps,xamarin.android,google-play-services,C#,Google Maps,Xamarin.android,Google Play Services,我正在使用谷歌地图开发一个android应用程序,我注意到在其中6个应用程序中出现了“iCCP:无法识别已编辑的已知sRGB配置文件e_pack_holo_dark.9.png”等警告。 谷歌地图无法处理以下警告: “'Android.GoogleMaps.MapActivity'已过时” 首先,我遇到了一个错误,没有找到COMPILETODALVIK,我通过进入project option->Android Build->Advanced->Java heap size来修复它,并在我看到的字

我正在使用谷歌地图开发一个android应用程序,我注意到在其中6个应用程序中出现了“iCCP:无法识别已编辑的已知sRGB配置文件e_pack_holo_dark.9.png”等警告。 谷歌地图无法处理以下警告: “'Android.GoogleMaps.MapActivity'已过时”

首先,我遇到了一个错误,没有找到COMPILETODALVIK,我通过进入project option->Android Build->Advanced->Java heap size来修复它,并在我看到的字段中添加了1G来修复它。它确实修复了错误,但所有警告仍然存在

我修正了这个问题,所以它只使用“最低Android版本”和“目标Android版本”来“覆盖Android 5.0(API级别21)” 因为这帮助了一些人

我正在使用谷歌地图API v2,从一开始就有。 为了做到这一点,我遵循了谷歌自己的指南和使用C#with monodroid的指南

我已经从SDK管理器下载了API级别22

我已经添加了我可以工作/被推荐的所有权限:

我的android清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="TrailMapplication.TrailMapplication">
    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />
    <application android:label="TrailMapplication">
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
        <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="MY_API_KEY" />
    </application>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-feature android:glEsVersion="0x00020000" android:required="true" />
</manifest>
我在布局中添加了所需的api等:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="My_API" />
</RelativeLayout>

我在一个新的应用程序中重新创建了这个问题,当我将google play服务添加到xamarin android的任何版本时,都会出现这个问题

找到了sRGB问题的问题,我的解决方案在向项目中添加google play services nuget包时出于某种原因清除了value.xml和Mapp.axml。进入文件夹并将其重新添加到项目中。但正如MappActivity所发生的一样,当我重新添加时,它返回了“Android.GoogleMaps.MapActivity已过时”错误

这些警告的其他可能原因是什么? 还有没有其他可能的解决方案,我可以尝试,或者我遗漏了什么


发现问题所在:xamarin studio不断删除项目的某些部分,通常是活动、布局和AndroidManifest等文件。我不确定这是否与使用模拟器启动有关,但事实似乎如此。

您是否使用Android SDK管理器下载了最新的Google play服务?在extras download Google Play Services V22的底部是的,我应该把它添加到我所做的事情中。你清理并重建了解决方案吗?是的,当我现在重新做时,收到了另外4条警告:“iCCP:无法识别已编辑的已知sRGB配置文件”。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="My_API" />
</RelativeLayout>