我是 java 的新手,但出于某种原因,尝试创建一个应用程序,该应用程序在 android studio 中正确构建,但是,当尝试在模拟器中打开时,它崩溃了。 这是我的完整代码
是应用程序的压缩包,我猜,主要错误是
final View rootView = inflater.inflate(R.layout.fragment_sun, container, false);
日志:错误
2019-07-25 10:42:48.002 5383-5383/com.example.phocast E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.phocast, PID: 5383
android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.v7.widget.RecyclerView
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.RecyclerView
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.RecyclerView" on path: DexPathList[[zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/base.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_resources_apk.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.phocast-j1KYRRVBUGO2ddQzmNBB8w==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.phocast-
在代码的第 69 行SunFragment.java。
我不明白 XML 中出了什么问题。
对应的 XML 为:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android" />
有人可以检查吗?
UYOU
四季花海
慕盖茨4494581
相关分类