Java. Lang. RuntimeException: Unable to start the activity ComponentInfo {com. BTKS. NJQ/com. BTKS. NJQ. UI. MainActivity} : Java. Lang. UnsupportedOperationException: Can 't the convert the value at the index 7 to dimension: type=0 x1
. An android app. ActivityThread. PerformLaunchActivity (ActivityThread. Java: 3364)
. An android app. ActivityThread. HandleLaunchActivity (ActivityThread. Java: 3548)
An android. App. Servertransaction. LaunchActivityItem. Execute (LaunchActivityItem. Java: 86)
An android. App. Servertransaction. TransactionExecutor. ExecuteCallbacks (TransactionExecutor. Java: 108)
An android. App. Servertransaction. TransactionExecutor. Execute (TransactionExecutor. Java: 68)
An android. App. ActivityThread $H.h andleMessage (ActivityThread. Java: 2155)
An android. OS. Handler. DispatchMessage (Handler. Java: 109)
. An android OS. Stars. Loop (207). Which Java:
. An android app. ActivityThread. Main (7539) ActivityThread. Java:
The at Java. Lang. Reflect. Method. Invoke (Native Method)
At com. Android. Internal. OS. RuntimeInit $MethodAndArgsCaller. Run (524) RuntimeInit. Java:
At com. Android. Internal. OS. ZygoteInit. Main (ZygoteInit. Java: 958)
Under Caused by: Java. Lang. UnsupportedOperationException: Can 't the convert the value at the index 7 to dimension: type=0 x1
An android. Content. Res. TypedArray. GetDimensionPixelOffset (TypedArray. Java: 727)
An android. Support. V7. Widget. TintTypedArray. GetDimensionPixelOffset (TintTypedArray. Java: 189)
An android. Support. V7. Widget. ToolbarWidgetWrapper. & lt; init> (ToolbarWidgetWrapper. Java: 150)
An android. Support. V7. Widget. ToolbarWidgetWrapper. & lt; init> (ToolbarWidgetWrapper. Java: 96)
An android. Support. V7. Widget. The Toolbar. GetWrapper (2112) of the Toolbar. Java:
An android. Support. V7. Widget. ActionBarOverlayLayout. GetDecorToolbar (ActionBarOverlayLayout. Java: 547)
An android. Support. V7. Widget. ActionBarOverlayLayout. PullChildren (ActionBarOverlayLayout. Java: 539)
An android. Support. V7. Widget. ActionBarOverlayLayout. SetWindowCallback (ActionBarOverlayLayout. Java: 615)
An android. Support. V7. App. AppCompatDelegateImpl. CreateSubDecor (AppCompatDelegateImpl. Java: 611)
An android. Support. V7. App. AppCompatDelegateImpl. EnsureSubDecor (AppCompatDelegateImpl. Java: 518)
An android. Support. V7. App. AppCompatDelegateImpl. InitWindowDecorActionBar (AppCompatDelegateImpl. Java: 319)
An android. Support. V7. App. AppCompatDelegateImpl. GetSupportActionBar (AppCompatDelegateImpl. Java: 306)
An android. Support. V7. App. AppCompatActivity. GetSupportActionBar (AppCompatActivity. Java: 110)
At com. BTKS. NJQ. UI. MainActivity. OnCreate (MainActivity. Java: 171)
. An android app. Activity. PerformCreate (7455) Activity. Java:
. An android app. Activity. PerformCreate (7445) Activity. Java:
. An android app. Instrumentation. CallActivityOnCreate (1286) Instrumentation. Java:
. An android app. ActivityThread. PerformLaunchActivity (ActivityThread. Java: 3343)
. An android app. ActivityThread. HandleLaunchActivity (ActivityThread. Java: 3548)
An android. App. Servertransaction. LaunchActivityItem. Execute (LaunchActivityItem. Java: 86)
An android. App. Servertransaction. TransactionExecutor. ExecuteCallbacks (TransactionExecutor. Java: 108)
An android. App. Servertransaction. TransactionExecutor. Execute (TransactionExecutor. Java: 68)
An android. App. ActivityThread $H.h andleMessage (ActivityThread. Java: 2155)
An android. OS. Handler. DispatchMessage (Handler. Java: 109)
. An android OS. Stars. Loop (207). Which Java:
. An android app. ActivityThread. Main (7539) ActivityThread. Java:
The at Java. Lang. Reflect. Method. Invoke (Native Method)
At com. Android. Internal. OS. RuntimeInit $MethodAndArgsCaller. Run (524) RuntimeInit. Java:
At com. Android. Internal. OS. ZygoteInit. Main (ZygoteInit. Java: 958)
Today suddenly all project, including the new some phones are reported this error again, tried a tablet don't quote this, don't know what the reason, please answer,
CodePudding user response:
Look at your XML layout, it should be a certain size attributes without unit, layout_width="1", for example, should be correct layout_width="1 dp"