简体   繁体   English

错误:Android Studio中不允许使用字符串类型(在“主题”中值为“”)

[英]Error : String types not allowed (at 'theme' with value ") in android studio

When I run android studio, I keep getting this error: 当我运行android studio时,我不断收到此错误:

:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :app:checkDebugManifest :app:preDebugBuild UP-TO-DATE :app:preBuild UP-TO-DATE Information:BUILD FAILED :app:prepareComAndroidSupportDesign2321Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72321Library :app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72321Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2321Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:processDebugResources :app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE:app:preReleaseBuild UP-TO-DATE:app:checkDebugManifest:app:preDebugBuild UP-TO-DATE:app:preBuild UP-TO-DATE信息:BUILD FAILED:app:prepareComAndroidSupport UP-2321Library TO-DATE:app:prepareComAndroidSupportAppcompatV72321Library:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE:app:prepareComAndroidSupportRecyclerviewV72321Library UP-TO-DATE:app:prepareComAndroidSupportSupportVectorDrawable2321Library UP-TO-DATE:app-e:Appl:UP-TO-DATE compileDebugRenderscript UP-TO-DATE:app:generateDebugBuildConfig UP-TO-DATE:app:generateDebugAssets UP-TO-DATE:app:mergeDebugAssets UP-TO-DATE:app:generateDebugResValues UP-TO-DATE:app:generateDebugResValues UP-TO-DATE DATE:app:mergeDebugResources UP-TO-DATE:app:processDebugManifest UP-TO-DATE:app:processDebugResources

C : \\Users\\User\\Desktop\\UniTools\\app\\build\\intermediates\\exploded- aar\\com.android.support\\appcompat-v7\\23.2.1\\res\\values\\values.xml C:\\ Users \\ User \\ Desktop \\ UniTools \\ app \\ build \\ intermediates \\ explaed- aar \\ com.android.support \\ appcompat-v7 \\ 23.2.1 \\ res \\ values \\ values.xml

Error:(315, 5) String types not allowed (at 'theme' with value ''). 错误:(315,5)不允许使用字符串类型(在“主题”下的值为“”)。 Error:Execution failed for task ':app:processDebugResources'. 错误:任务':app:processDebugResources'的执行失败。 com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Users\\User\\AppData\\Local\\Android\\sdk\\build-tools\\23.0.2\\aapt.exe'' finished with non-zero exit value 1 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'command'C:\\ Users \\ User \\ AppData \\ Local \\ Android \\ sdk \\ build-tools \\ 23.0.2 \\ aapt .exe''以非零退出值1结束

 <style name="Base.TextAppearance.AppCompat.SearchResult" parent="">
    <item name="android:textStyle">normal</item>
    <item name="android:textColor">?android:textColorPrimary</item>
    <item name="android:textColorHint">?android:textColorHint</item>
</style>

Then Android Studio takes me this this code in the values.xml. 然后,Android Studio在values.xml中将此代码带给我。 Any ideas on what the problem is? 关于什么是问题的任何想法?

edit your 'values.xml' from the explorer: find values.xml->edit in notepad-> rebuild project. 在资源管理器中编辑“ values.xml”:在记事本中找到values.xml-> edit->重建项目。

you are trying to edit the generated file so parent="" appears again and again. 您正在尝试编辑生成的文件,因此parent =“”一次又一次出现。 because you cannot edit generated file 因为您无法编辑生成的文件

You assign empty value to 'theme' 您为“主题”分配空值

I think 'theme' in styles.xml or you can search for 'theme' in xml files under 'values' folder. 我认为styles.xml中的“主题”,或者您可以在“值”文件夹下的xml文件中搜索“主题”。

then check what value you assigned for 'theme' 然后检查您为“主题”分配了什么值

I had similar problems. 我有类似的问题。 To solve it just edit the values.xml file in notepad and save it, then you should be good-to-go. 要解决此问题,只需在记事本中编辑values.xml文件并将其保存,那么您就可以做好了。 Go to build/intermediates/ress/merged/debug/values . 转到build/intermediates/ress/merged/debug/values

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

相关问题 Android动画-不允许使用字符串类型 - Android Animation - String types not allowed 错误:(23,26)不允许使用字符串类型(在&#39;src&#39;中值为&#39;pen&#39;)。 - Error:(23, 26) String types not allowed (at 'src' with value 'pen').? Android Studio:错误:类型不兼容:double 无法转换为String - Android studio: error: incompatible types: double cannot be converted to String 错误:不允许使用字符串类型(在&#39;layout_height&#39;中,值为&#39;wrap content&#39;)。 activity_main.xml中 - Error: String types not allowed (at 'layout_height' with value 'wrap content'). activity_main.xml 错误:(453,69)不允许的字符串类型(在“ activity_horizo​​ntal_margin”处,值为“) - Error:(453, 69) String types not allowed (at 'activity_horizontal_margin' with value '') Android Studio:Android Theme.AppCompat错误 - Android Studio: Android Theme.AppCompat error Android Studio错误类型不兼容 - Incompatible types Android Studio error Android Studio:此处不允许注释错误 - Android Studio: Annotations are not allowed here error 自定义枚举属性提供错误不允许使用字符串类型 - Custom enum attribute gives error String types not allowed Android Studio错误:(386,38)错误:类型不兼容:字符串无法转换为上下文 - Android Studio Error:(386, 38) error: incompatible types: String cannot be converted to Context
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM