zoho / SalesIQ-Mobilisten-ReactNative

Your mobile app's ideal live chat partner. Power up your mobile App with the SalesIQ Mobilisten SDK for React-Native.
https://mobilisten.io/
9 stars 11 forks source link

Application is not run after i have added required things..please resolve #91

Closed Anilfeker21 closed 2 months ago

Anilfeker21 commented 3 months ago

Execution failed for task ':app:mergeEnvQaDebugResources'.

Could not resolve all files for configuration ':app:envQaDebugRuntimeClasspath'. Failed to transform activity-1.8.2.aar (androidx.activity:activity:1.8.2) to match attributes {artifactType=android-res, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. Execution failed for JetifyTransform: /Users/bharathkumar/.gradle/caches/modules-2/files-2.1/androidx.activity/activity/1.8.2/bce54c84024b17c34f9d4cdeaf1ce39d3e750c9e/activity-1.8.2.aar. Failed to transform '/Users/bharathkumar/.gradle/caches/modules-2/files-2.1/androidx.activity/activity/1.8.2/bce54c84024b17c34f9d4cdeaf1ce39d3e750c9e/activity-1.8.2.aar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 61. (Run with --stacktrace for more details.) Suggestions:

  • Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
  • If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible). Failed to transform annotation-experimental-1.4.0.aar (androidx.annotation:annotation-experimental:1.4.0) to match attributes {artifactType=android-res, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}. Execution failed for JetifyTransform: /Users/bharathkumar/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-experimental/1.4.0/c7a2038d831d0cfbfb9a440890b287c2e839ecf/annotation-experimental-1.4.0.aar. Failed to transform '/Users/bharathkumar/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation-experimental/1.4.0/c7a2038d831d0cfbfb9a440890b287c2e839ecf/annotation-experimental-1.4.0.aar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 61. (Run with --stacktrace for more details.) Suggestions:
  • Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
  • If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

BUILD FAILED in 5s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew app:installEnvQaDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

BUILD FAILED in 5s

at makeError (/Users/bharathkumar/Downloads/ANIL/DriverMobileApp/src_tinting/node_modules/execa/index.js:174:9)
at /Users/bharathkumar/Downloads/ANIL/DriverMobileApp/src_tinting/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/bharathkumar/Downloads/ANIL/DriverMobileApp/src_tinting/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
at async Command.handleAction (/Users/bharathkumar/Downloads/ANIL/DriverMobileApp/src_tinting/node_modules/@react-native-community/cli/build/index.js:186:9)

info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Anilfeker21 commented 3 months ago

i have added both files for your reference

Android build gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

// apply plugin: 'com.google.gms.google-services' // apply plugin: 'com.android.application'

buildscript {

ext {
   googlePlayServicesLocationVersion = "17.0.0"  // Or higher.

    buildToolsVersion = "30.0.2"
    minSdkVersion = 23
    compileSdkVersion = 30
    targetSdkVersion = 33
    supportLibVersion = "30.0.0"
    googlePlayServicesAuthVersion = "16.0.1"
    googlePlayServicesVersion = "17.0.0" // default: "+"
    gradle3EXPERIMENTAL="yes"
    kotlin_version = '1.4.10'
    // gradle_version = '4.1.0'
    appCompatVersion = "1.1.0"
      // Or higher.  Required for new AndroidX compatibility.
       if (System.properties['os.arch'] == "aarch64") {
                        // For M1 Users we need to use the NDK 24 which added support for aarch64
                        ndkVersion = "24.0.8215888"
        } else {
                        // Otherwise we default to the side-by-side NDK version from AGP.
                        ndkVersion = "21.4.7075529"
       }
}
repositories {
    google()
    jcenter()

    mavenCentral()
    maven { url "https://dl.bintray.com/android/android-tools" }
}
dependencies {
    classpath('com.android.tools.build:gradle:4.0.1')
    classpath 'com.google.gms:google-services:4.3.4'
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
    classpath 'com.google.android.gms:play-services-auth:16.0.1'
    // classpath 'com.android.tools.build:gradle:3.0.1'
    // classpath 'com.google.gms:google-services:4.1.0'
    // classpath 'com.google.gms:google-services:16.1.0'
    // classpath("com.google.gms:google-services:+")
    // classpath("com.google.android.gms:google-services-auth:16.1.0")

    // classpath 'com.google.gms:google-services:4.3.4'

    // classpath 'com.google.gms:google-services:4.1.0'
    // classpath 'com.android.tools.build:gradle:3.1.2' // <--- use this version or newer
    // classpath 'com.google.gms:google-services:4.3.4'
    // classpath 'com.google.gms:google-services:4.3.2'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects { repositories { google() mavenLocal() jcenter() mavenCentral()

    // maven { url "https://maven.google.com" }
    maven { url 'https://maven.zohodl.com' }

    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url("$rootDir/../node_modules/react-native/android")
    }
    maven {
        // Android JSC is installed from npm
        url("$rootDir/../node_modules/jsc-android/dist")
    }
    // maven {
    //     url 'https://maven.google.com'
    // }

    maven { url "https://www.jitpack.io" }

    maven {
       // Required for react-native-background-geolocation
       url("${project(':react-native-background-geolocation').projectDir}/libs")
   }

    maven {
       // react-native-background-fetch
       url("${project(':react-native-background-fetch').projectDir}/libs")
  }

     maven {url 'https://developer.huawei.com/repo/'}

//   maven { url 'https://maven.google.com' }
    // google()
    // maven { url 'https://jitpack.io' }
}

configurations.all {
    resolutionStrategy {
        // Remove this override in 0.65+, as a proper fix is included in react-native itself.
        force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        force 'androidx.core:core-ktx:1.6.0'
        force 'androidx.core:core:1.6.0'
    }
}

}

app build gradle

apply plugin: "com.android.application" apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

project.ext.envConfigFiles = [ envQa: ".env.qa", envProd: ".env.prod", ]

apply from: project(":react-native-config").projectDir.getPath() + "/dotenv.gradle"

import com.android.build.OutputFile

/**

project.ext.react = [ entryFile: "index.js", enableHermes: false, // clean and rebuild if changing ]

// apply from: "../../node_modules/react-native/react.gradle"

/**

/**

/**

/**

android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion lintOptions { checkReleaseBuilds false } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }

defaultConfig {
    applicationId "com.tinting"
    // missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    vectorDrawables.useSupportLibrary = true
    versionCode 56
    versionName "4.2.0"
    multiDexEnabled true
}
splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
    }
}
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://facebook.github.io/react-native/docs/signed-apk-android.
        signingConfig signingConfigs.release
        // signingConfig signingConfigs.debug
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

 flavorDimensions "default"
     productFlavors {
            envProd {
                 resValue "string", "build_config_package", "com.tinting"
             }
             envQa {
                 resValue "string", "build_config_package", "com.tinting"
             }
         }
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
    variant.outputs.each { output ->
        // For each separate APK per architecture, set a unique version code as described here:
        // https://developer.android.com/studio/build/configure-apk-splits.html
        def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
        def abi = output.getFilter(OutputFile.ABI)
        if (abi != null) {  // null for the universal-debug, universal-release variants
            output.versionCodeOverride =
                    versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
        }

    }
}

} dependencies { // compile 'com.google.android.gms:play-services:16.0.1' // compile project(':reactnativenotifications') // compile project(':react-native-otp-verify') // compile project(':react-native-otp-verify') implementation fileTree(dir: "libs", include: [".jar"]) // implementation project(':@mauron85_react-native-background-geolocation') implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' implementation project(':react-native-permissions') implementation project(':react-native-localize') implementation "com.facebook.react:react-native:+" implementation "com.google.android.gms:play-services-auth:16.0.1" // implementation 'com.google.android.gms:play-services-base:10.0.1' implementation "com.google.android.gms:play-services-base:+" implementation ("androidx.appcompat:appcompat:1.3.1") { version { strictly '1.3.1' } } // implementation 'com.google.android.gms:play-services-base:10.0.1' // implementation project(':reactnativenotifications'); // implementation 'com.google.firebase:firebase-analytics' // implementation fileTree(dir: "libs", include: [".jar"]) // implementation 'com.google.android.gms:play-services-auth:+' // implementation 'com.google.firebase:firebase-core:16.0.7'; // implementation "com.google.android.gms:play-services-gcm:+" // implementation platform('com.google.firebase:firebase-bom:26.0.0') // implementation 'com.google.android.gms:play-services-base:16.0.1' // compile ("com.google.android.gms:play-services-auth:16.1.0") { // force = true; // } // implementation(project(":react-native-google-signin")) // compile 'com.android.support:multidex:1.0.1' // Import the BoM for the Firebase platform // Declare the dependencies for the Firebase Cloud Messaging and Analytics libraries // When using the BoM, you don't specify versions in Firebase library dependencies

if (enableHermes) {
    def hermesPath = "../../node_modules/hermes-engine/android/";
    debugImplementation files(hermesPath + "hermes-debug.aar")
    releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
    implementation jscFlavor
}

}

// Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' }

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

apply plugin: 'com.google.gms.google-services' apply plugin: "kotlin-android" apply plugin: "kotlin-android-extensions" Project background_geolocation = project(':react-native-background-geolocation') apply from: "${background_geolocation.projectDir}/app.gradle"

bhahirathan-mb-11956 commented 3 months ago

Hi @Anilfeker21 ,

It appears that your Gradle or Java version is old. Can you please try updating the Gradle version to a higher one, like the one below, in your android/gradle/wrapper/gradle-wrapper.properties?

distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

Also, please ensure your project's Java version is 11 or above.

Thanks, Bhahirathan M.