Build fails on *npm run android* at 95, MAC 2017 intel chip

Task :app:compileDebugKotlin
‘compileDebugJavaWithJavac’ task (current target is 11) and ‘compileDebugKotlin’ task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: Configure a Gradle project | Kotlin Documentation

w: file:///Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/SplitViewModule.kt:66:21 Parameter ‘eventName’ is never used

Task :app:compileDebugJavaWithJavac

Task :app:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See Command-Line Interface
805 actionable tasks: 789 executed, 16 up-to-date

info :bulb: Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: cli/packages/cli-doctor/README.md at main · react-native-community/cli · GitHub

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@mattermost/react-native-turbo-log/android/src/main/java/com/mattermostreactnativeturbolog/ReactNativeTurboLogModuleImpl.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-background-timer/android/src/main/java/com/ocetnik/timer/BackgroundTimerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@react-native-camera-roll/camera-roll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@react-native-camera-roll/camera-roll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollPackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@react-native-clipboard/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@react-native-cookies/cookies/android/src/main/java/com/reactnativecommunity/cookies/CookieManagerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-document-picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: [2] Wrote GeneratedAppGlideModule with: [com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule, com.dylanvann.fastimage.FastImageOkHttpProgressGlideModule]
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-hw-keyboard-event/android/src/main/java/com/github/emilioicai/hwkeyboardevent/HWKeyboardEventModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/Utils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-incall-manager/android/src/main/java/com/zxcpoiu/incallmanager/InCallManagerModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-localize/android/src/main/java/com/zoontek/rnlocalize/RNLocalizeModuleImpl.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-math-view/android/src/main/java/io/autodidact/rnmathview/RNMathViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-math-view/android/src/main/java/io/autodidact/rnmathview/RNMathViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-permissions/android/src/main/java/com/zoontek/rnpermissions/RNPermissionsPackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/VirtualView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-vector-icons/android/src/oldarch/java/com/oblador/vectoricons/VectorIconsModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/react-native-webrtc/android/src/main/java/com/oney/WebRTCModule/StringUtils.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@sentry/react-native/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@stream-io/flat-list-mvcp/android/src/main/java/com/mvcpscrollviewmanager/MvcpScrollViewManagerModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Volumes/Update/CompanyWork/mattermost-mobile/node_modules/@voximplant/react-native-foreground-service/android/src/main/java/com/voximplant/foregroundservice/NotificationHelper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java:69: error: cannot assign a value to final variable mNotificationProps
mNotificationProps = createProps(current);
^
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java:109: error: cannot assign a value to final variable mNotificationProps
mNotificationProps = createProps(notificationBundle);
^
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java:144: error: getNotificationBuilder(PendingIntent) in CustomPushNotification cannot override getNotificationBuilder(PendingIntent) in PushNotification
protected NotificationCompat.Builder getNotificationBuilder(PendingIntent intent) {
^
return type androidx.core.app.NotificationCompat.Builder is not compatible with android.app.Notification.Builder
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java:143: error: method does not override or implement a method from a supertype
@Override
^
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java:171: error: cannot assign a value to final variable mNotificationProps
mNotificationProps = createProps(bundle);
^
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java:23: error: method does not override or implement a method from a supertype
@Override
^
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java:33: error: method does not override or implement a method from a supertype
@Override
^
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java:36: error: incompatible types: MainActivity cannot be converted to ReactActivity
this,
^
/Volumes/Update/CompanyWork/mattermost-mobile/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java:76: error: cannot find symbol
getReactGateway().onWindowFocusChanged(hasFocus);
^
symbol: method onWindowFocusChanged(boolean)
location: class ReactGateway
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
9 errors

FAILURE: Build failed with an exception.

Hello Muhammad,

I appreciate your patience with this matter. It looks like you’re encountering a build failure and numerous deprecation warnings in your work with the Mattermost mobile project.

As a first step, please ensure that your Java version for both ‘compileDebugJavaWithJavac’ and ‘compileDebugKotlin’ tasks are set to the same. Follow the guidance given in the Kotlin Documentation you referenced: Configure a Gradle project | Kotlin Documentation to adjust JVM toolchain settings.

Remember to run ‘react-native doctor’ as you’ve mentioned yourself, this can provide additional insights about your development environment and might help to find missing configurations.

For the deprecated APIs - Each Android API level introduces some changes to the SDK which can deprecate older APIs, so keep that in mind when selecting the SDK levels. You can suppress these warnings if they are not affecting the app functionality now but it’s strongly recommended to resolve these because they might cause issues in future Android versions. In some case, it could also be an indicator that it’s time to update some of your dependencies.

One of the frequent errors in your build seems to be due to trying to assign values to a final variable ‘mNotificationProps’. Take a look at the files indicated in the error messages and revise the code to respect the final attribute of the variable.

Other errors also seem to stem from possible override errors between sub-classes and super-classes and type compatibility issues. Please review the methods involved, especially around the MainActivity and CustomPushNotification classes to look for any obvious mismatches or errors.

I hope this helps guide you to a direction for resolution. If you have further queries, feel free to ask. We value your contribution to the Mattermost Community.

Best Regards,
~Mattermost AI Assistant :robot:

[Disclaimer: This was an AI assisted response powered by Mattermost AI. Were any of the above suggestions inaccurate? Let us know by replying to this comment!]