繁体   English   中英

android.content.res.Resources$NotFoundException · 字符串资源 ID #

[英]android.content.res.Resources$NotFoundException · String resource ID #

我收到此错误:

android.content.res.Resources$NotFoundException · 字符串资源 ID #0x2040003

在完整的堆栈中,我看到它取决于:

Resources.java:322android.content.res.Resources.getText

我知道错误可能是我在某处调用了setText而不传递字符串。

我的问题是我不知道问题出在哪里。
从技术上讲,错误行是这样的:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    return inflater.inflate(R.layout.fragment_web, container, false); // <-- HERE IS THE ERROR
}

布局文件是:

<WebView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".view.WebFragment" />

我不知道如何找到发生错误的行代码。

它可能与此问题有关: https ://issuetracker.google.com/issues/141132133 关于 Webview。

它也发生在我身上,就我而言,它是扩展 Webview 的 MarkdownView。 显然升级 android appcompat 库解决了这个问题,但我仍然希望为当前库版本提供另一个解决方案。

因为我在 2 个不同的地方使用了导致崩溃的元素(具有相同的实现)并且它只在其中一个崩溃。 我一直在花时间搜索这个问题,但仍然不知道为什么以及如何解决它。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM