我刚刚升级了Visual Studio for mac以支持Android 8/ api 26。我将AppCompat库更新为26.1,以使用我的Android项目的Resources目录中的新字体文件夹。现在,当我尝试编译时,我得到路径"obj/Debug/res/font“APT0000的”无效资源目录名“。



发布于 2017-11-24 00:56:48
首先,请务必查看有关新特性的最新xamarin文档。https://developer.xamarin.com/guides/android/platform
我很快创建了一个新的xamarin android项目,并添加了两个不同字体的文本视图:

我的解决方案如下所示:

我通常尽量避免在资源名称中使用大写字母,因为android工作室对此颇有微词。
主布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:text="Pacifico example text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/pacifico" />
<TextView
android:text="Roboto light example text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto_light" />
</LinearLayout>我认为你没有使用最新的平台来构建。检查您是否使用最新的平台(Oreo)来构建应用程序。
发布于 2017-11-24 18:10:24
对我来说,解决方案是从SDK管理器中删除所有旧的Android SDK构建工具。现在我只安装了适用于api level 26和27的api,它可以正常工作。

发布于 2018-03-28 00:17:51
我对这个问题的解决方案是在项目文件的根目录中添加以下行
<PropertyGroup><AndroidSdkBuildToolsVersion>27.0.3</AndroidSdkBuildToolsVersion></PropertyGroup>https://stackoverflow.com/questions/47436465
复制相似问题