gpt4 book ai didi

android - 可以在 Android Studio 的 drawable 文件夹中创建子文件夹吗?

转载 作者:搜寻专家 更新时间:2023-11-01 08:48:35 25 4
gpt4 key购买 nike

<分区>

是否可以在主 res 文件夹中创建子文件夹结构,尤其是使用 Gradle 在 drawable 文件夹中?

到目前为止我已经尝试过了

sourceSets {

main {
res.srcDirs = [
"/src/main/res/drawable-xhdpi/actionbar_items",
"/src/main/res/drawable-xhdpi/intro",
"/src/main/res/drawable-xhdpi/loading_screen",
"/src/main/res/drawable-xhdpi",
"/src/main/res",
]
}
}

但是,当我重建项目时,我收到类似这样的 Gradle 构建错误消息:

Error:(39, 23) No resource found that matches the given name (at 'icon' with value     '@drawable/app_icon').
Error:(40, 24) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(42, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
Error:(45, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(50, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(55, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(73, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').

Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Users/adrian/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W/aapt package -f --no-crunch -I /Users/adrian/adt-bundle-mac-x86_64-20140702/sdk/platforms/android-19/android.jar -M /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml -S /Users/adrian/Development/alstom_framework/app/build/intermediates/res/debug -A /Users/adrian/Development/alstom_framework/app/build/intermediates/assets/debug -m -J /Users/adrian/Development/alstom_framework/app/build/generated/source/r/debug -F /Users/adrian/Development/alstom_framework/app/build/intermediates/libs/app-debug.ap_ --debug-mode --custom-package com.hiddenltd.framework -0 apk --output-text-symbols /Users/adrian/Development/alstom_framework/app/build/intermediates/symbols/debug Error Code: 1 Output: /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/app_icon'). /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'theme' with value '@style/AppTheme'). /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml:43: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml:48: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml:52: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). /Users/adrian/Development/alstom_framework/app/build/intermediates/manifests/debug/AndroidManifest.xml:70: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').

这对我来说意味着 gradle 只能看到我在 app.gradle 文件中指定的 res 文件夹?因此我将它的其余部分添加到 app.gradle 并发生同样的错误......任何人都可以帮忙....

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