Tag Archives: Version compatible

Android 9.0 APP Install Android 4.4 Error: classnotfoundexception

App on Android 9.0 can run, but the installation to version 4.4 program crashes, the error isClassNotFoundException,
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.xx.app/com.xx.view.splash.SplashActivity}: java.lang.ClassNotFoundException: Didn’t find class “com.xx.view.splash.SplashActivity” on path: DexPathList[[zip file “/data/app/com.xx.app-1.apk”],nativeLibraryDirectories=[/data/app-lib/com.xx.app-1, /vendor/lib, /system/lib]]
Stack.
E/AndroidRuntime( 9741):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
E/AndroidRuntime( 9741):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E/AndroidRuntime( 9741):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 9741):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 9741):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 9741):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 9741):     at android.app.ActivityThread.main(ActivityThread.java:5047)
E/AndroidRuntime( 9741):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 9741):     at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 9741):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
E/AndroidRuntime( 9741):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:658)
E/AndroidRuntime( 9741):     at dalvik.system.NativeStart.main(Native Method)

Solution:
Change the version of androidx.constraintlayout:constraintlayout from 2.0.4 to 2.1.1, the problem is solved

[Solved] Android9.0 App Install Android4.4 Error: InflateException-You must supply a layout_height attribute.

Problem description: Android 9.0 application installed to Android 4.4 reports an error InflateException, prompting you must provide a layout_height property.
Android9.0 application installed to Android4.4 reports an error InflateException, prompting you must provide a layout_height property.
Stack.

0-26 11:19:23.312 10710 10710 E AndroidRuntime: FATAL EXCEPTION: main
10-26 11:19:23.312 10710 10710 E AndroidRuntime: Process: com.XX.app, PID: 10710
10-26 11:19:23.312 10710 10710 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.XX.app/com.XX.view.player.VideoPlayActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.XX.widget.TvXXControlView
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.ActivityThread.access$800(ActivityThread.java:135)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:136)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5047)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:658)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
10-26 11:19:23.312 10710 10710 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.XX.widget.TvControlView
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:620)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at com.XX.view.player.BaseVideoPlayActivity.onCreate(BaseVideoPlayActivity.java:90)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:5294)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     ... 11 more
10-26 11:19:23.312 10710 10710 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at java.lang.reflect.Constructor.constructNative(Native Method)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:594)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     ... 22 more
10-26 11:19:23.312 10710 10710 E AndroidRuntime: Caused by: java.lang.RuntimeException: Binary XML file line #17: You must supply a layout_height attribute.
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5949)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6117)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1225)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:1062)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:82)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:757)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at android.view.View.inflate(View.java:17465)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at com.xx.widget.TvControlView.<init>(TvControlView.java:132)
10-26 11:19:23.312 10710 10710 E AndroidRuntime:     at com.xx.widget.TvXXControlView.<init>(TvXXControlView.java:64)

 

Solution:
This problem actually has nothing to do with the version, but with the screen allocation rate. The layout xml defines the layout_height referencing the constant defined in the values, but the definition is only defined in the directory of the specific resolution. So the solution Define the referenced value in the values directory

[Solved] Android 9.0 APP Install Android 4.4 Error: IllegalArgumentException

 

Problem Description.
App works on Android 9.0, but the installation to version 4.4 program crashes with the error:

IllegalArgumentException
10-25 17:07:12.475 14178 14178 E AndroidRuntime: FATAL EXCEPTION: main
10-25 17:07:12.475 14178 14178 E AndroidRuntime: Process: com.xx.app, PID: 14178
10-25 17:07:12.475 14178 14178 E AndroidRuntime: java.lang.RuntimeException: Unable to create service com.xx.service.XXService: java.lang.IllegalArgumentException:

 

Stack:

10-25 17:07:12.475 14178 14178 E AndroidRuntime: FATAL EXCEPTION: main
10-25 17:07:12.475 14178 14178 E AndroidRuntime: Process: com.xx.app, PID: 14178
10-25 17:07:12.475 14178 14178 E AndroidRuntime: java.lang.RuntimeException: Unable to create service com.xx.service.XXService: java.lang.IllegalArgumentException: MediaButtonReceiver component may not be null
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at android.app.ActivityThread.handleCreateService(ActivityThread.java:2582)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at android.app.ActivityThread.access$1800(ActivityThread.java:135)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:136)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5047)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:515)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
10-25 17:07:12.475 14178 14178 E AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:658)

 

Solution:
Register MediaButtonReceiver in Manifest

<receiver android:name="androidx.media.session.MediaButtonReceiver" >
    <intent-filter>
        <action android:name="android.intent.action.MEDIA_BUTTON" />
    </intent-filter>
</receiver>