简体   繁体   English

无法找到Android支持库和媒体路由器.jar文件

[英]Android Support Library and Media Router .jar files cannot be found

I am totally new to Xamarin. 我对Xamarin来说是全新的。 I want to add map to the default hello world in Xamarin.Android. 我想将地图添加到Xamarin.Android中的默认hello世界。 I have prepared my Manifest step by step from the guide. 我已经从指南中逐步准备好了Manifest。 Also downloaded the support library via sdk manager but I get errors asking me to install SL and SL media Router. 还通过sdk管理器下载了支持库但我收到错误,要求我安装SL和SL媒体路由器。

Here the manifest: 这里的清单:

<?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>

And some of the errors I get: 我得到的一些错误:

  /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)

I also downloaded the mentioned .zip file in the url but there is no such folder as /users/apple/.local ... to copy it in. 我还在网址中下载了提到的.zip文件,但没有像/users/apple/.local这样的文件夹来复制它。

Is it really this tricky to add map permissions to an app or I'm doing sth wrong? 将地图权限添加到应用程序或者我做错了,这真的很棘手吗?

I suggest you read this . 我建议你读这个 Xamarin has a guide in how to add and setup a map fragment. Xamarin有一个如何添加和设置地图片段的指南。

You also need to install the google play services component from the Xamarin component store, not from the Android SDK manager. 您还需要从Xamarin组件商店安装Google Play服务组件,而不是从Android SDK管理器安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM