我刚刚更新了 Android Studio 1.2.1.1,现在 gradle 在我的资源文件夹中遇到了 svg 问题.我一直在毫无问题地使用 SVG,我希望它们将来会被允许".
I just updated Android Studio 1.2.1.1 and now gradle got problems with svg in my resources folder. I was always using SVGs with no problem and I hope they will be "allowed" in the future.
:app:mergeDebugResources
:app:mergeDebugResources FAILED
/home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg
Error:Error: The file name must end with .xml or .png
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg: Error: The file name must end with .xml or .png
Information:BUILD FAILED
任何想法如何解决这个问题?
Any ideas how to solve that ?
drawable资源目录下的webp文件同样的问题.
Same problem with webp files in the drawable resource directory.
最新的 gradle 插件 (v1.2.3) 无法识别一些以前可以使用的图像格式.切换回 v1.2.2 时没有问题
The latest gradle plugin (v1.2.3) is not recognizing some of the image formats that used to work before. I don't have the issue when I switch back to v1.2.2
更新:鉴于此功能已修复,您应该升级到最新的 gradle 插件版本,而不是恢复原状.
UPDATE: Given that this feature was fixed, you should upgrade to the latest gradle plugin release instead of reverting back.
您可以通过设置更改 build.gradle 中的版本:
You can change the version in your build.gradle by setting:
buildscript {
repositories {
jcenter()
mavenCentral()
// mavenLocal() // Only if you want to use your local maven repo
}
dependencies {
// classpath 'com.android.tools.build:gradle:+'
classpath 'com.android.tools.build:gradle:1.2.2'
}
}
这篇关于Android:在 res 中使用 SVG 会导致错误:“文件名必须以 .xml 或 .png 结尾"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompIncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 Incompatible
如何在 gradle 中获取当前风味How to get current flavor in gradle(如何在 gradle 中获取当前风味)
如何修复“意外元素<查询>在“清单How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误
基于 Android Gradle 中多风味库的多风味应用Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android 依赖在编译和运行时有不同的版本Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
本地 aar 库的传递依赖Transitive dependencies for local aar library(本地 aar 库的传递依赖)