简体   繁体   English

布局xml中的资源,但编译器错误,显示“未找到”

[英]Resource in layout xml but compiler error with “not found”

I have had some success with trying to get a sound synthesizer app to work. 我在尝试使声音合成器应用程序运行方面取得了一些成功。 It worked fine on simulator, but always crash on the 8th time on my mobile phone ( OS 7.0 , simulator OS 6.0 , API level 21 , or OS 5.0 ). 它在模拟器上工作正常,但总是在我的手机( OS 7.0 ,模拟器OS 6.0API级别21OS 5.0 )上第八次崩溃。 The error message was convoluted. 错误消息被弄乱了。 I only remember the red-highlighted lines with "AudioFlinger" , and an error code with "AudioTrack" and "-20" . 我只记得带有"AudioFlinger"的红色突出显示行,以及带有"AudioTrack""-20"的错误代码。

I saw some advices here about changing the API level of the app to 21, but Android Studio only did 22, so that was what I changed. 在这里,我看到了一些有关将应用程序的API级别更改为21的建议,但是Android Studio仅将22更改了,这就是我所做的更改。 And that corrupted the whole thing. 这破坏了整个事情。 I am getting AAPT error on compile. 我在编译时遇到AAPT错误。 The thing will not even start the emulator for try-run. 事情甚至不会启动模拟器进行试运行。

So I scrapped the whole thing, copy out the source codes (and layouts and other resources) and started a new project fresh, and copied back these files. 因此,我废弃了整个内容,复制了源代码(以及布局和其他资源),并重新启动了一个新项目,然后将这些文件复制回去。

Now again, there is a compile error. 现在再次出现编译错误。 There are multiple objects on XML that the Java source code reference to. Java源代码引用XML上有多个对象。 All those lines with R.id.textview . 所有这些行都带有R.id.textview All the "R" are now red with error, with the error message, 现在,所有"R"都为红色,并带有错误消息和错误消息,

error: resource style/Base.V26.Widget.AppCompat.Toolbar not found. 错误: 找不到资源样式/Base.V26.Widget.AppCompat.Toolbar。

This seems to be something completely "background" issue that I have no idea how to resolve, nor can I find solutions here. 这似乎是完全“背景”的问题,我不知道如何解决,也无法在这里找到解决方案。 Any help is greatly appreciated. 任何帮助是极大的赞赏。

This can cause trouble when there is a need to make new files, so clearing 'caches will clear the oldcache` and make Android Studio faster. 当需要制作新文件时,这可能会引起麻烦,因此清除“缓存将清除oldcache”,并使Android Studio更快。 Going to Build > Clean Project 进行构建>清理项目

清理您的项目或重建并重新启动android studio

暂无
暂无

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

相关问题 Android viewpagerindicator XML错误:找不到属性“ footerIndicatorStyle”的资源标识符 - Android viewpagerindicator XML error: No resource identifier found for attribute 'footerIndicatorStyle' 错误“未找到映射(RESOURCE):HibernateExposed / Person.hbm.xml” - Error “Mapping (RESOURCE) not found : HibernateExposed/Person.hbm.xml” 错误:错误:找不到与给定名称匹配的资源(在'resource'处,值为'@ xml / device_filter') - error: Error: No resource found that matches the given name (at 'resource' with value '@xml/device_filter') 在包“ android”中没有找到属性“ layout_alignParentEnd”的资源标识符activity_post.xml / DispatchActivity / res / layout第23行 - No resource identifier found for attribute 'layout_alignParentEnd' in package 'android' activity_post.xml /DispatchActivity/res/layout line 23 找不到资源错误404 - Resource not found error 404 编译器错误和找不到类 - Compiler error and classes cannot be found list_layout.xml中的“ ArrayAdapter:您必须为TextView提供资源ID”中的错误 - Error in “ArrayAdapter: You must supply a resource ID for a TextView”, list_layout.xml RuntimeException 找不到布局 XML 资源 - RuntimeException can't find layout XML resource 在布局 xml 和 Java 中使用字符串资源 - Use String Resource in layout xml along with Java Android Studio Android 资源链接失败错误.. AAPT:错误:资源 android:未找到属性/lStar。 在值.xml 105 - Android Studio Android resource linking failed error .. AAPT: error: resource android:attr/lStar not found. at values.xml 105
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM