Problem Description
Floating box style is abnormal
Caused by: android.view.InflateException: Binary XML file line #10 in com.example.administrator.myapplication:layout/activity_event_simple: Binary XML file line #10 in com.example.administrator.myapplication:layout/activity_event_simple: Error inflating class android.support.design.widget.FloatingActionButton
Caused by: android.view.InflateException: Binary XML file line #10 in com.example.administrator.myapplication:layout/activity_event_simple: Error inflating class android.support.design.widget.FloatingActionButton
Caused by: java.lang.ClassNotFoundException: android.support.design.widget.FloatingActionButton
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at android.view.LayoutInflater.createView(LayoutInflater.java:813)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.administrator.myapplication.event.EventSimpleActivity.onCreate(EventSimpleActivity.java:16)
at android.app.Activity.performCreate(Activity.java:8000)
at android.app.Activity.performCreate(Activity.java:7984)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.FloatingActionButton" on path: DexPathList[[zip file "/data/app/~~ifhZZYKrV3-7IC9EpRYwtQ==/com.example.administrator.myapplication-dVeo5FiMTqcAMDRaRAmCew==/base.apk"],nativeLibraryDirectories=[/data/app/~~ifhZZYKrV3-7IC9EpRYwtQ==/com.example.administrator.myapplication-dVeo5FiMTqcAMDRaRAmCew==/lib/x86, /system/lib, /system_ext/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 28 more
Solutions
Check whether to add the corresponding dependency
Specific code
Add
implementation’com.android.support: design:28.0.0 ‘ in build.gradle
dependencies {
implementation 'com.android.support:design:28.0.0'
}
Read More:
- [Solved] error: package android.support.design.widget does not exist
- How to Solve Android Error: Error inflating class
- [Solved] ViewBinding Error: java.lang.ClassCastException: android.widget.RelativeLayout cannot be
- [Solved] Android9.0 App Install Android4.4 Error: InflateException-You must supply a layout_height attribute.
- How to Solve Error: Android java.lang.IllegalStateException: Could not execute method of the activity
- [Solved] Unreal Engine Error: Widget Blueprint could not be loaded because it derives from an invalid class
- [Solved] Android Project error: import android.support.v4 (V7). App.activitycompat
- [Solved] Android Error: import android.support.annotation.NonNull
- How to Solve Error: You need to use a Theme.AppCompat theme (or descendant) with this activity.
- How to Solve Android Error: gps requires ACCESS_FINE_LOCATION
- Android 10: How to Solve Systemui Error
- [Solved] Android DataBinding Error: java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 fragment Changes to Fragm
- Android: How to Solve libuv Compile Error
- How to Solve Android Arouter Frame Autowired Error
- How to Solve Android jetpack Room Schema export Error
- How to Solve Error “Could not find com.android.tools.build:gradle:3.0.1”
- Android Studio: How to Solve APK error in mobile phone installation
- How to Solve Android Studio run main() Method Error
- How to Solve Android wechat payment Error: error_code = -1
- JZVideo Error: Attempt to invoke virtual method ‘android.view.Window android.app.Activity.getWindow()’ on a null object reference