gpt4 book ai didi

c# - 找不到 Android 支持库和媒体路由器 .jar 文件

转载 作者:太空狗 更新时间:2023-10-29 13:21:31 31 4
gpt4 key购买 nike

我对 Xamarin 完全陌生。我想将 map 添加到 Xamarin.Android 中的默认 hello world。我已经按照指南一步步准备了我的 list 。还通过 sdk 管理器下载了支持库,但出现错误,要求我安装 SL 和 SL 媒体路由器。

这里是 list :

<?xml version="1.0" encoding="utf-8"?>

<!-- We need to be able to download map tiles and access Google Play Services-->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Allow the application to access Google web-based services. -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<!-- Google Maps for Android v2 will cache map tiles on external storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!-- Google Maps for Android v2 needs this permission so that it may check the connection state as it must download data -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Permission to receive remote notifications from Google Play Services -->
<!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
<uses-permission android:name="com.MyAppName.MyAppName.permission.MAPS_RECEIVE" />
<permission android:name="com.MyAppName.permission.MAPS_RECEIVE" android:protectionLevel="signature" />

<!-- These are optional, but recommended. They will allow Maps to use the My Location provider. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />


<application android:label="@string/app_name">

<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyCV3Xs4ah1VkL8dI2JWmP2UiTlH4HZuQfQ" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
</application>

我得到的一些错误:

  /Users/apple/Projects/MyAppNameAndroid/MyAppNameAndroid: Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file /Users/apple/.local/share/Xamarin/Android.Support.v7.AppCompat/21.0.3/embedded/classes.jar doesn't exist. (XA5207) (MyAppNameAndroid)

/Users/apple/Projects/MyAppNameAndroid/MyAppNameAndroid: Error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip and extract it to the /Users/apple/.local/share/Xamarin/Android.Support.v7.AppCompat/21.0.3/content directory. (XA5209) (MyAppNameAndroid)

/Users/apple/Projects/MyAppNameAndroid/MyAppNameAndroid: Error XA5209: Reason: /Users/apple/.local/share/Xamarin/Android.Support.v7.AppCompat/21.0.3/android_m2repository_r10.zip is not a valid zip file (XA5209) (MyAppNameAndroid)


/Users/apple/Projects/MyAppNameAndroid/MyAppNameAndroid: Error XA5206: Please install package: 'Android Support Library' available in SDK installer. Android resource directory /Users/apple/.local/share/Xamarin/Android.Support.v7.AppCompat/21.0.3/embedded/. doesn't exist. (XA5206) (MyAppNameAndroid)

/Users/apple/Projects/MyAppNameAndroid/MyAppNameAndroid: Error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip and extract it to the /Users/apple/.local/share/Xamarin/Android.Support.v7.MediaRouter/21.0.3/content directory. (XA5209) (MyAppNameAndroid)

我还在 url 中下载了提到的 .zip 文件,但是没有像 /users/apple/.local 这样的文件夹……可以将其复制进去。

向应用程序添加 map 权限真的这么棘手还是我做错了什么?

最佳答案

我建议你阅读 this . Xamarin 提供了有关如何添加和设置 map fragment 的指南。

您还需要从 Xamarin 组件商店而不是 Android SDK 管理器安装 google play 服务组件。

关于c# - 找不到 Android 支持库和媒体路由器 .jar 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28008604/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com