Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android App is crashing:java.lang.ClassCastException: org.slf4j.helpers.SubstituteLogger cannot be cast to ch.qos.logback.classic.Logger #2232

Open
Arockiaraj19 opened this issue Dec 18, 2024 · 3 comments

Comments

@Arockiaraj19
Copy link

Your Environment

  • Plugin version:^4.15.2
  • Platform: Android
  • OS version:
  • Device manufacturer / model:Pixel
  • React Native version (react-native -v): "0.73.2"
  • java version:18.0.2.1
    android/build.gradle
buildscript {
    ext {
     
        buildToolsVersion = "34.0.0"
        minSdkVersion = 21
        compileSdkVersion = 35
        targetSdkVersion = 35
        ndkVersion = "25.1.8937393"
        kotlinVersion = "1.8.0"
        appCompatVersion 	= "1.4.2"      
        googlePlayServicesLocationVersion = "21.0.1" 
        RNMapboxMapsVersion = '10.18.2'
       

    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
        classpath 'com.google.gms:google-services:4.4.2'
    }
    allprojects {   
     
        repositories {
         
            maven { url("${project(':react-native-background-geolocation').projectDir}/libs") }
            maven { url 'https://developer.huawei.com/repo/' }
            maven { url("${project(':react-native-background-fetch').projectDir}/libs") }
             maven {
            url 'https://api.mapbox.com/downloads/v2/releases/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                // Do not change the username below.
                // This should always be `mapbox` (not your username).
                username = 'mapbox'
                // Use the secret token you stored in gradle.properties as the password
                password = "sk.eyJ1Ijoidm9vbXJpZGUiLCJhIjoiY20xZmU0enA5MWowMDJxc2I4amVtanBxaCJ9.Mu9FLmBp9drHINduEYRAKQ"
            }
        }
        }
    }
}

apply plugin: "com.facebook.react.rootproject"

android/app/build.gradle

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"  
/**
 * This is the configuration block to customize your React Native Android app.
 * By default you don't need to apply any configuration, just uncomment the lines you need.
 */
react {
    /* Folders */
    //   The root of your project, i.e. where "package.json" lives. Default is '..'
    // root = file("../")
    //   The folder where the react-native NPM package is. Default is ../node_modules/react-native
    // reactNativeDir = file("../node_modules/react-native")
    //   The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
    // codegenDir = file("../node_modules/@react-native/codegen")
    //   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
    // cliFile = file("../node_modules/react-native/cli.js")

    /* Variants */
    //   The list of variants to that are debuggable. For those we're going to
    //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
    //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
    // debuggableVariants = ["liteDebug", "prodDebug"]

    /* Bundling */
    //   A list containing the node command and its flags. Default is just 'node'.
    // nodeExecutableAndArgs = ["node"]
    //
    //   The command to run when bundling. By default is 'bundle'
    // bundleCommand = "ram-bundle"
    //
    //   The path to the CLI configuration file. Default is empty.
    // bundleConfig = file(../rn-cli.config.js)
    //
    //   The name of the generated asset file containing your JS bundle
    // bundleAssetName = "MyApplication.android.bundle"
    //
    //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
    // entryFile = file("../js/MyApplication.android.js")
    //
    //   A list of extra flags to pass to the 'bundle' commands.
    //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
    // extraPackagerArgs = []

    /* Hermes Commands */
    //   The hermes compiler command to run. By default it is 'hermesc'
    // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
    //
    //   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
    // hermesFlags = ["-O", "-output-source-map"]
}

/**
 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
 */
def enableProguardInReleaseBuilds = false

/**
 * The preferred build flavor of JavaScriptCore (JSC)
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The international variant includes ICU i18n library and necessary data
 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
 * give correct results when using with locales other than en-US. Note that
 * this variant is about 6MiB larger per architecture than default.
 */
def jscFlavor = 'org.webkit:android-jsc:+'

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
    ndkVersion rootProject.ext.ndkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
    compileSdk rootProject.ext.compileSdkVersion

    namespace "com.heroesridemobile"
    defaultConfig {
        applicationId "com.heroesridemobile"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0.0"
        missingDimensionStrategy 'react-native-camera', 'general'
    }
    signingConfigs {
         release {
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            bundle {
                abi {
                    enableSplit = true
                }
            }
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
}

dependencies {
    

    implementation("com.facebook.react:react-android")
    implementation("com.facebook.react:flipper-integration")
    implementation project(':react-native-camera')
    implementation platform('com.google.firebase:firebase-bom:33.1.2')
    implementation project(':react-native-twilio-video-webrtc')
    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android")
    } else {
        implementation jscFlavor
    }
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

Project background_geolocation = project(':react-native-background-geolocation')
apply from: "${background_geolocation.projectDir}/app.gradle"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

Actual Behavior

The app crashes during the initial run.

Logs
 GoogleInputMethodService.onStartInput():1986 onStartInput(EditorInfo{EditorInfo{packageName=com.heroesridemobile, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=0, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
2024-12-12 21:30:28.963  6238-9026  PackageConfigPersister  system_server                        W  App-specific configuration not found for packageName: com.heroesridemobile and userId: 0
2024-12-12 21:30:28.965 12073-12131 nativeloader            pid-12073                            D  Load /data/app/~~V0dLBpOd6cmImfxQEhtbuQ==/com.heroesridemobile-B2XfzVSFjuAwvEeOd1KdIA==/base.apk!/lib/arm64-v8a/libreactnativejni.so using ns clns-7 from class loader (caller=/data/app/~~V0dLBpOd6cmImfxQEhtbuQ==/com.heroesridemobile-B2XfzVSFjuAwvEeOd1KdIA==/base.apk!classes20.dex): ok
2024-12-12 21:30:31.152 12073-12157 nativeloader            pid-12073                            D  Load /data/app/~~V0dLBpOd6cmImfxQEhtbuQ==/com.heroesridemobile-B2XfzVSFjuAwvEeOd1KdIA==/base.apk!/lib/arm64-v8a/libtslocationmanager.so using ns clns-7 from class loader (caller=/data/app/~~V0dLBpOd6cmImfxQEhtbuQ==/com.heroesridemobile-B2XfzVSFjuAwvEeOd1KdIA==/base.apk!classes21.dex): ok
2024-12-12 21:30:31.168 12073-12159 AndroidRuntime          pid-12073                            E  FATAL EXCEPTION: pool-13-thread-1
                                                                                                    Process: com.heroesridemobile, PID: 12073
                                                                                                    java.lang.ClassCastException: org.slf4j.helpers.NOPLogger cannot be cast to ch.qos.logback.classic.Logger
                                                                                                    	at com.transistorsoft.locationmanager.logger.TSLog.a(SourceFile:2)
                                                                                                    	at com.transistorsoft.locationmanager.logger.TSLog.a(SourceFile:3)
                                                                                                    	at com.transistorsoft.locationmanager.logger.TSLog.$r8$lambda$3YB4RZFGV-hL2r0EClp1u86FGKM(Unknown Source:0)
                                                                                                    	at com.transistorsoft.locationmanager.logger.TSLog$$ExternalSyntheticLambda1.run(Unknown Source:4)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2024-12-12 21:30:31.209  6238-9026  ActivityTaskManager     system_server                        W    Force finishing activity com.heroesridemobile/.MainActivity
2024-12-12 21:30:31.292  6238-6704  WindowManager           system_server                        I  WIN DEATH: Window{5386cdd u0 com.heroesridemobile/com.heroesridemobile.MainActivity}
2024-12-12 21:30:31.304  6238-6704  InputManager-JNI        system_server                        W  Input channel object '5386cdd com.heroesridemobile/com.heroesridemobile.MainActivity (client)' was disposed without first being removed with the input manager!
2024-12-12 21:30:31.305  6238-6949  ImeTracker              system_server                        I  com.heroesridemobile:a48fbe45: onRequestHide at ORIGIN_SERVER reason HIDE_REMOVE_CLIENT fromUser false
@Arockiaraj19
Copy link
Author

OS version:35

@christocracy
Copy link
Member

show me the result of the following command (it's a lot of output so save it to a .txt file and attach here).

$ cd android
$ ./gradlew app:dependencies

@christocracy
Copy link
Member

This is a duplicate of #1699

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants