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>
Read More:
- [Solved] Android9.0 App Install Android4.4 Error: InflateException-You must supply a layout_height attribute.
- [Solved] Android app development version update failed, Android – error: task execution failed ‘: app: com
- [Solved] Android-android studio apk Install Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
- JZVideo Error: Attempt to invoke virtual method ‘android.view.Window android.app.Activity.getWindow()’ on a null object reference
- [Solved] Android Project error: import android.support.v4 (V7). App.activitycompat
- [Solved] Appium Install Error: Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variab
- [Solved] Android Studio Start Error: Missing essential plugin: org.jetbrains.android Please reinstall Android
- Remember an android app startup error Error running: Default Activity not found
- [Solved] Android Error: Execution failed for task ‘:app:mergeReleaseNativeLibs‘.
- [Solved] Android Studio Compile Error: Execution failed for task ‘:APP_MIDI:lintVitalRelease‘.
- [Solved] Android12 Download Error: The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
- Android7.0+ Failed to Share Images: exposed beyond app through ClipData.Item.getUri()
- Android studio Error:Execution failed for task ‘: app:transformResourcesWithMergeJavaResForDebug ‘
- [Solved] :app:processDebugResources Android resource linking failed Android resource linking failed
- Download and save uniapp pictures to Android error reporting app
- [Solved] Android Error: import android.support.annotation.NonNull
- [Solved] Android Studio APK install Error: INSTALL_FAILED_CONFLICTING_PROVIDER
- [Solved] Android Studio Error: Error:Execution failed for task’:app:mergeDebugResources’
- Android Error: Android resource linking failed [How to Solve]