gpt4 book ai didi

java - 关于 Android Frameworks Base : android. view.InflateException Binary XML #18 Error inflateing class

转载 作者:行者123 更新时间:2023-12-01 11:16:46 25 4
gpt4 key购买 nike

当我点击导航栏上的方形按钮(最近使用的应用程序)时,我得到了一个 systemUI fc..我已经记录了有关该详细日志的日志..

E/AndroidRuntime( 2748): FATAL EXCEPTION: main
E/AndroidRuntime( 2748): Process: com.android.systemui, PID: 2748
E/AndroidRuntime( 2748): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.systemui/com.android.systemui.recents.RecentsActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class <unknown>
E/AndroidRuntime( 2748): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2340)
E/AndroidRuntime( 2748): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2402)
E/AndroidRuntime( 2748): at android.app.ActivityThread.access$900(ActivityThread.java:151)
E/AndroidRuntime( 2748): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1318)
E/AndroidRuntime( 2748): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 2748): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 2748): at android.app.ActivityThread.main(ActivityThread.java:5269)
E/AndroidRuntime( 2748): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 2748): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 2748): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime( 2748): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
E/AndroidRuntime( 2748): Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class <unknown>
E/AndroidRuntime( 2748): at android.view.LayoutInflater.createView(LayoutInflater.java:633)
E/AndroidRuntime( 2748): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:892)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.rInflate(LayoutInflater.java:802)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
E/AndroidRuntime( 2748): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
E/AndroidRuntime( 2748): at android.app.Activity.setContentView(Activity.java:2145)
E/AndroidRuntime( 2748): at com.android.systemui.recents.RecentsActivity.onCreate(RecentsActivity.java:384)
E/AndroidRuntime( 2748): at android.app.Activity.performCreate(Activity.java:5990)
E/AndroidRuntime( 2748): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
E/AndroidRuntime( 2748): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2293)
E/AndroidRuntime( 2748): ... 10 more
E/AndroidRuntime( 2748): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 2748): at java.lang.reflect.Constructor.newInstance(Native Method)
E/AndroidRuntime( 2748): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
E/AndroidRuntime( 2748): at android.view.LayoutInflater.createView(LayoutInflater.java:607)
E/AndroidRuntime( 2748): ... 24 more
E/AndroidRuntime( 2748): Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
E/AndroidRuntime( 2748): at android.content.res.TypedArray.getDimensionPixelOffset(TypedArray.java:533)
E/AndroidRuntime( 2748): at android.view.View.<init>(View.java:3798)
E/AndroidRuntime( 2748): at android.view.ViewGroup.<init>(ViewGroup.java:497)
E/AndroidRuntime( 2748): at android.widget.FrameLayout.<init>(FrameLayout.java:115)
E/AndroidRuntime( 2748): at android.widget.FrameLayout.<init>(FrameLayout.java:111)
E/AndroidRuntime( 2748): at android.widget.FrameLayout.<init>(FrameLayout.java:107)
E/AndroidRuntime( 2748): ... 27 more

这是日志

这是RecentsActivity.java,错误位于第384行

第 384 行:- `//设置最近的布局 setContentView(R.layout.recents);

以及RecentsActivity.java的一部分

/** Called with the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// For the non-primary user, ensure that the SystemServicesProxy and configuration is
// initialized
RecentsTaskLoader.initialize(this);
SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
mConfig = RecentsConfiguration.reinitialize(this, ssp);

// Initialize the widget host (the host id is static and does not change)
mAppWidgetHost = new RecentsAppWidgetHost(this, Constants.Values.App.AppWidgetHostId);

// Set the Recents layout
setContentView(R.layout.recents);
mRecentsView = (RecentsView) findViewById(R.id.recents_view);
mRecentsView.setCallbacks(this);
mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
mEmptyViewStub = (ViewStub) findViewById(R.id.empty_view_stub);
mDebugOverlayStub = (ViewStub) findViewById(R.id.debug_overlay_stub);
mScrimViews = new SystemBarScrimViews(this, mConfig);
mStatusBar = ((SystemUIApplication) getApplication())
.getComponent(PhoneStatusBar.class);
inflateDebugOverlay();

这是位于packages/systemui/res/layout/recents.xml 中的recents.xml

<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Status Bar Scrim View -->
<ImageView
android:id="@+id/status_bar_scrim"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
android:scaleType="fitXY"
android:src="@drawable/recents_status_gradient" />

<!-- Recents View -->
<com.android.systemui.recents.views.RecentsView
android:id="@+id/recents_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true" />

<!-- Empty View -->
<ViewStub android:id="@+id/empty_view_stub"
android:layout="@layout/recents_empty"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<!-- Debug Overlay View -->
<ViewStub android:id="@+id/debug_overlay_stub"
android:layout="@layout/recents_debug_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<!-- Nav Bar Scrim View -->
<ImageView
android:id="@+id/nav_bar_scrim"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:scaleType="fitXY"
android:src="@drawable/recents_lower_gradient" />

<include layout="@layout/floating_action_button" />

请帮帮我,我该怎么办......

希望能修复

谢谢

最佳答案

我认为,使用“com.android.systemui.recents.views.RecentsView”的问题,它用于系统应用程序层。

请检查您编译的SDK和目标SDK版本。

关于java - 关于 Android Frameworks Base : android. view.InflateException Binary XML #18 Error inflateing class <unknown>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31729099/

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