talsec/Free-RASP-ReactNative

Could not find com.facebook.react:react-native

Closed this issue · 6 comments

Could not determine the dependencies of task ':freerasp-react-native:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':freerasp-react-native:debugCompileClasspath'.
Could not find com.facebook.react:react-native:.
Required by:
project :freerasp-react-native

To Reproduce

react-native "0.70.4

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

buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "21.4.7075529"
supportLibVersion = "27.0.0"
googlePlayServicesAuthVersion = "18.0.0" // Add this line
androidXCore = "1.7.0" // <-- Add this. Check versions here: https://developer.android.com/jetpack/androidx/releases/core
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"
}
RNNKotlinVersion = "1.70.10"
}
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
classpath 'com.google.gms:google-services:4.3.10'
//classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.14.0, 0.99.99]'
// Add the Crashlytics Gradle plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// Add the dependency for the Performance Monitoring plugin
classpath 'com.google.firebase:perf-plugin:1.4.1' // Performance Monitoring plugin

}

}
allprojects {
repositories {
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 "$rootDir/../node_modules/react-native-background-fetch/android/libs"
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
exclusiveContent {
// We get React Native's Android binaries exclusively through npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
maven { url 'https://www.jitpack.io' }
maven{url = uri("https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp")}
maven{url = uri("https://developer.huawei.com/repo/")}
maven{url = uri("https://jitpack.io")}
}
}
}

settings.gradle

rootProject.name = 'xxxx'
include ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android')
include ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android')
include ':react-native-background-fetch'
project(':react-native-background-fetch').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-background-fetch/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
include ':react-native-version-info'
project(':react-native-version-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-info/android')
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}

Hello @gansu18,

thanks for opening an issue. There seems to be a problem with your build.gradle.

Please place our dependencies directly under allprojects.repositores (instead of allprojects.repositories.exclusiveContent).

Additionally, your error seems to be caused byallprojects.repositories.exclusiveContent section. You may want to take a look at that - maybe try to remove the section altogether.

Let us know if that helps.

Tomas, Talsec developer

Hello @gansu18,

thanks for opening an issue. There seems to be a problem with your build.gradle.

Please place our dependencies directly under allprojects.repositores (instead of allprojects.repositories.exclusiveContent).

Additionally, your error seems to be caused byallprojects.repositories.exclusiveContent section. You may want to take a look at that - maybe try to remove the section altogether.

Let us know if that helps.

Tomas, Talsec developer
this fix does not work

What went wrong:
Could not determine the dependencies of task ':freerasp-react-native:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':freerasp-react-native:debugCompileClasspath'.
Could not find com.facebook.react:react-native:.
Required by:
project :freerasp-react-native

allprojects {
repositories {
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 "$rootDir/../node_modules/react-native-background-fetch/android/libs"
}
maven { url "https://maven.google.com" }
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
// exclusiveContent {
// // We get React Native's Android binaries exclusively through npm,
// // from a local Maven repo inside node_modules/react-native/.
// // (The use of exclusiveContent prevents looking elsewhere like Maven Central
// // and potentially getting a wrong version.)
// filter {
// includeGroup "com.facebook.react"
// }
// forRepository {
// maven {
// url "$rootDir/../node_modules/react-native/android"
// }
// }
// }
maven { url 'https://www.jitpack.io' }
maven{url = uri("https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp")}
maven{url = uri("https://developer.huawei.com/repo/")}
maven{url = uri("https://jitpack.io")}
}

@gansu18, try to clean-up the local Gradle cache.

If that doesn't help, could you share complete build.gradle file? I wasn't able to reproduce your problem anymore.

Thanks,

Tomas, Talsec developer

app/build.gradle

apply plugin: "com.android.application"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os

/**

  • The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  • and bundleReleaseJsAndAssets).
  • These basically call react-native bundle with the correct arguments during the Android build
  • cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
  • bundle directly from the development server. Below you can see all the possible configurations
  • and their defaults. If you decide to add a configuration block, make sure to add it before the
  • apply from: "../../node_modules/react-native/react.gradle" line.
  • project.ext.react = [
  • // the name of the generated asset file containing your JS bundle
  • bundleAssetName: "index.android.bundle",
  • // the entry file for bundle generation. If none specified and
  • // "index.android.js" exists, it will be used. Otherwise "index.js" is
  • // default. Can be overridden with ENTRY_FILE environment variable.
  • entryFile: "index.android.js",
  • // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
  • bundleCommand: "ram-bundle",
  • // whether to bundle JS and assets in debug mode
  • bundleInDebug: false,
  • // whether to bundle JS and assets in release mode
  • bundleInRelease: true,
  • // whether to bundle JS and assets in another build variant (if configured).
  • // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
  • // The configuration property can be in the following formats
  • // 'bundleIn${productFlavor}${buildType}'
  • // 'bundleIn${buildType}'
  • // bundleInFreeDebug: true,
  • // bundleInPaidRelease: true,
  • // bundleInBeta: true,
  • // whether to disable dev mode in custom build variants (by default only disabled in release)
  • // for example: to disable dev mode in the staging build type (if configured)
  • devDisabledInStaging: true,
  • // The configuration property can be in the following formats
  • // 'devDisabledIn${productFlavor}${buildType}'
  • // 'devDisabledIn${buildType}'
  • // the root of your project, i.e. where "package.json" lives
  • root: "../../",
  • // where to put the JS bundle asset in debug mode
  • jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
  • // where to put the JS bundle asset in release mode
  • jsBundleDirRelease: "$buildDir/intermediates/assets/release",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in debug mode
  • resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in release mode
  • resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
  • // by default the gradle tasks are skipped if none of the JS files or assets change; this means
  • // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
  • // date; if you have any other folders that you want to ignore for performance reasons (gradle
  • // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
  • // for example, you might want to remove it from here.
  • inputExcludes: ["android/", "ios/"],
  • // override which node gets called and with what additional arguments
  • nodeExecutableAndArgs: ["node"],
  • // supply additional arguments to the packager
  • extraPackagerArgs: []
  • ]
    */

project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]

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

/**

  • Set this to true to create two separate APKs instead of one:
    • An APK that only works on ARM devices
    • An APK that only works on x86 devices
  • The advantage is the size of the APK is reduced by about 4MB.
  • Upload all the APKs to the Play Store and people will download
  • the correct one based on the CPU architecture of their device.
    */
    def enableSeparateBuildPerCPUArchitecture = false

/**

  • Run Proguard to shrink the Java bytecode in release builds.
    */
    def enableProguardInReleaseBuilds = false

/**

  • The preferred build flavor of JavaScriptCore.
  • 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:+'

/**

  • Whether to enable the Hermes VM.
  • This should be set on project.ext.react and that value will be read here. If it is not set
  • on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
  • and the benefits of using Hermes will therefore be sharply reduced.
    */
    def enableHermes = project.ext.react.get("enableHermes", true);

/**

  • Architectures to build native code for.
    */
    def reactNativeArchitectures() {
    def value = project.getProperties().get("reactNativeArchitectures")
    return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
    }

android {
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
    applicationId "xxxxx"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 3
    versionName "1.0.0"
    multiDexEnabled true
    manifestPlaceholders = [appAuthRedirectScheme: 'xxxx']
    buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

    if (isNewArchitectureEnabled()) {
        // We configure the NDK build only if you decide to opt-in for the New Architecture.
        externalNativeBuild {
          cmake {
                arguments "-DPROJECT_BUILD_DIR=$buildDir",
                    "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
                    "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
                    "-DNODE_MODULES_DIR=$rootDir/../node_modules",
                    "-DANDROID_STL=c++_shared"
            }
        }
        if (!enableSeparateBuildPerCPUArchitecture) {
            ndk {
                abiFilters (*reactNativeArchitectures())
            }
        }
    }

}

    if (isNewArchitectureEnabled()) {
    // We configure the NDK build only if you decide to opt-in for the New Architecture.
    externalNativeBuild {
       cmake {
            path "$projectDir/src/main/jni/CMakeLists.txt"
        }
    }
    def reactAndroidProjectDir = project(':ReactAndroid').projectDir
    def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
        dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
        from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
        into("$buildDir/react-ndk/exported")
    }
    def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
        dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
        from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
        into("$buildDir/react-ndk/exported")
    }
    afterEvaluate {
        // If you wish to add a custom TurboModule or component locally,
        // you should uncomment this line.
        // preBuild.dependsOn("generateCodegenArtifactsFromSchema")
        preDebugBuild.dependsOn(packageReactNdkDebugLibs)
        preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)

        // Due to a bug inside AGP, we have to explicitly set a dependency
        // between configureCMakeDebug* tasks and the preBuild tasks.
        // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
       configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
       configureCMakeDebug.dependsOn(preDebugBuild)
        reactNativeArchitectures().each { architecture ->
            tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
                dependsOn("preDebugBuild")
            }
            tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
                dependsOn("preReleaseBuild")
            }
        }
    }
}

splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include (*reactNativeArchitectures())
    }
}
signingConfigs {
    debug {
        storeFile file('debug.keystore')
        storePassword 'plot2022_'
        keyAlias 'androiddebugkey'
        keyPassword 'plot2022_'
    }
    release {
        storeFile file(MYAPP_RELEASE_STORE_FILE)
        storePassword MYAPP_RELEASE_STORE_PASSWORD
        keyAlias MYAPP_RELEASE_KEY_ALIAS
        keyPassword MYAPP_RELEASE_KEY_PASSWORD
    }
}
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
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}


// 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
        // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
        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 =
                    defaultConfig.versionCode * 1000 + versionCodes.get(abi)
        }

    }
}

packagingOptions {
    pickFirst "lib/armeabi-v7a/libc++_shared.so"
    pickFirst "lib/arm64-v8a/libc++_shared.so"
    pickFirst "lib/x86/libc++_shared.so"
    pickFirst "lib/x86_64/libc++_shared.so"
}
buildToolsVersion buildToolsVersion

// 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 {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
implementation 'com.facebook.android:facebook-android-sdk:latest.release'
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:0.20.1' // From node_modules
implementation 'com.facebook.fresco:fresco:2.6.0'
implementation 'com.facebook.fresco:animated-gif:2.6.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
  exclude group:'com.facebook.fbjni'
}

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.flipper'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.flipper'
}

if (enableHermes) {
    //noinspection GradleDynamicVersion
    implementation("com.facebook.react:hermes-engine:+") { // From node_modules
        exclude group:'com.facebook.fbjni'
    }
} else {
    implementation jscFlavor
}

if (isNewArchitectureEnabled()) {
    // If new architecture is enabled, we let you build RN from source
    // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
    // This will be applied to all the imported transtitive dependency.
    configurations.all {
        resolutionStrategy.dependencySubstitution {
            substitute(module("com.facebook.react:react-native"))
                    .using(project(":ReactAndroid"))
                    .because("On New Architecture we're building React Native from source")
            substitute(module("com.facebook.react:hermes-engine"))
                    .using(project(":ReactAndroid:hermes-engine"))
                    .because("On New Architecture we're building Hermes from source")
        }
    }
}

implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation project(':react-native-version-info')
//flipper
debugImplementation('com.facebook.flipper:flipper:0.35.0') {
    exclude group:'com.facebook.fbjni'
}
debugImplementation('com.facebook.flipper:flipper-network-plugin:0.35.0') {
    exclude group:'com.facebook.flipper'
}
 implementation("com.google.android.gms:play-services-ads:21.3.0") { force = true; }
//implementation 'com.google.android.gms:play-services-ads:20.6.0'
implementation 'com.google.ads.mediation:facebook:6.10.0.0'
implementation 'com.unity3d.ads:unity-ads:4.3.0'
implementation 'com.google.ads.mediation:unity:4.3.0.0'
//implementation 'com.google.android.ads:mediation-test-suite:2.0.0'
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:30.3.0')

// Declare the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
// Declare the dependency for the Performance Monitoring library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-perf'
debugImplementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:6.0.0-dev"
releaseImplementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:6.0.0-release"

}

configurations.all {
exclude group: 'com.google.android.gms', module: 'play-services-safetynet'
}

// 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.implementation
into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set newArchEnabled to true inside the gradle.properties file
// - Invoke gradle with -newArchEnabled=true
// - Set an environment variable ORG_GRADLE_PROJECT_newArchEnabled=true
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}

apply plugin: 'com.google.gms.google-services'
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
// Apply the Performance Monitoring plugin
apply plugin: 'com.google.firebase.firebase-perf'

android/build.gradle

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

buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "21.4.7075529"
supportLibVersion = "27.0.0"
googlePlayServicesAuthVersion = "18.0.0" // Add this line
androidXCore = "1.7.0" // <-- Add this. Check versions here: https://developer.android.com/jetpack/androidx/releases/core
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"
}
RNNKotlinVersion = "1.70.10"
}
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
classpath 'com.google.gms:google-services:4.3.10'
//classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.14.0, 0.99.99]'
// Add the Crashlytics Gradle plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// Add the dependency for the Performance Monitoring plugin
classpath 'com.google.firebase:perf-plugin:1.4.1' // Performance Monitoring plugin

}

}
allprojects {
repositories {
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 "$rootDir/../node_modules/react-native-background-fetch/android/libs"
}
maven { url "https://maven.google.com" }
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
// exclusiveContent {
// // We get React Native's Android binaries exclusively through npm,
// // from a local Maven repo inside node_modules/react-native/.
// // (The use of exclusiveContent prevents looking elsewhere like Maven Central
// // and potentially getting a wrong version.)
// filter {
// includeGroup "com.facebook.react"
// }
// forRepository {
// maven {
// url "$rootDir/../node_modules/react-native/android"
// }
// }
// }
maven { url 'https://www.jitpack.io' }
maven{url = uri("https://nexus3-public.monetplus.cz/repository/ahead-talsec-free-rasp")}
maven{url = uri("https://developer.huawei.com/repo/")}
maven{url = uri("https://jitpack.io")}
}
}

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
#distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-7.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Package.json

{
"name": "PlotTwistLector",
"version": "1.4.0",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"-": "0.0.1",
"@ant-design/react-native": "^5.0.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
"@babel/plugin-transform-arrow-functions": "^7.16.0",
"@babel/plugin-transform-flow-strip-types": "^7.16.0",
"@babel/plugin-transform-shorthand-properties": "^7.16.0",
"@babel/plugin-transform-template-literals": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@elanf/recyclerlistview": "^3.0.14",
"@openspacelabs/react-native-zoomable-view": "^2.0.4",
"@react-native-async-storage/async-storage": "^1.17.7",
"@react-native-community/art": "^1.2.0",
"@react-native-community/cli": "^9.3.2",
"@react-native-community/cli-platform-android": "^9.3.1",
"@react-native-community/cli-platform-ios": "^9.3.0",
"@react-native-community/slider": "^4.3.3",
"@react-native-firebase/analytics": "^16.4.6",
"@react-native-firebase/app": "^16.4.6",
"@react-native-firebase/auth": "^16.4.6",
"@react-native-firebase/crashlytics": "^16.4.6",
"@react-native-firebase/perf": "^16.4.6",
"@react-native-google-signin/google-signin": "^8.2.1",
"@react-navigation/bottom-tabs": "^6.4.1",
"@react-navigation/material-top-tabs": "^6.3.1",
"@react-navigation/native": "^6.0.14",
"@react-navigation/stack": "^6.3.5",
"apisauce": "^2.1.6",
"deprecated-react-native-prop-types": "^2.2.0",
"formik": "^2.2.5",
"freerasp-react-native": "github:talsec/Free-RASP-ReactNative",
"hermes-engine": "^0.11.0",
"jwt-decode": "^3.1.2",
"link": "^0.1.5",
"merge": "^1.2.1",
"mobx": "^6.3.8",
"mobx-persist": "^0.4.1",
"mobx-persist-store": "^0.5.30",
"mobx-react": "^7.2.1",
"mobx-sync": "^3.0.0",
"moment": "^2.24.0",
"prop-types": "^15.7.2",
"react": "18.1.0",
"react-native": "0.70.4",
"react-native-animatable": "^1.3.3",
"react-native-app-auth": "^6.4.3",
"react-native-background-fetch": "4.1.5",
"react-native-code-push": "^7.0.5",
"react-native-collapsible": "^1.6.0",
"react-native-debugger": "^1.1.0",
"react-native-device-info": "^8.5.1",
"react-native-eject": "^0.1.2",
"react-native-elements": "^3.4.2",
"react-native-fast-image": "^8.6.3",
"react-native-fbsdk-next": "^11.1.0",
"react-native-flash-message": "^0.3.1",
"react-native-gesture-handler": "^2.8.0",
"react-native-google-mobile-ads": "^8.2.2",
"react-native-image-progress": "^1.2.0",
"react-native-onesignal": "^4.5.0",
"react-native-orientation-locker": "^1.5.0",
"react-native-pager-view": "^6.1.1",
"react-native-paper": "^4.12.5",
"react-native-pinch-zoom-view": "^0.2.0",
"react-native-progress": "^5.0.0",
"react-native-public-ip": "^1.0.2",
"react-native-ratings": "^8.1.0",
"react-native-reanimated": "^2.13.0",
"react-native-redash": "^18.0.0",
"react-native-rename": "^2.6.0",
"react-native-safe-area-context": "^4.4.1",
"react-native-screen-brightness": "^2.0.0-alpha",
"react-native-screens": "^3.18.1",
"react-native-sound": "^0.11.0",
"react-native-svg": "^13.6.0",
"react-native-system-navigation-bar": "^2.0.1",
"react-native-tab-view": "^2.16.0",
"react-native-textinput-effects": "^0.6.3",
"react-native-tracking-transparency": "^0.1.2",
"react-native-vector-icons": "9.2.0",
"react-native-version-info": "^1.1.0",
"react-native-video": "^5.2.1",
"react-native-webview": "^11.25.0",
"save": "^2.4.0",
"yup": "^0.28.1"
},
"devDependencies": {
"@babel/core": "7.12.",
"@babel/plugin-proposal-decorators": "^7.6.0",
"@babel/preset-env": "^7.10.4",
"@babel/runtime": "7.12.
",
"@react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.9.0",
"eslint": "^7.32.0",
"jest": "24.9.0",
"metro": "^0.66.2",
"metro-react-native-babel-preset": "^0.70.3",
"react-test-renderer": "18.0.0"
},
"rnpm": {
"assets": [
"./assets/fonts"
]
},
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-(native|universal|navigation)-(.)|@react-native-community/(.)|@react-navigation/(.*)|bs-platform)"
]
}
}

@gansu18 , In app/build.gradle, you are importing react.gradle which suggests that you are using an older version of the react-native project, which is unsupported by react-native version we are using in our project. Most likely, this is causing your issues with integration of the freeRASP.

Therefore I would suggest to migrate your app/build.gradle to a newer version. You can use the original template as a reference: https://github.com/facebook/react-native/blob/main/template/android/app/build.gradle. The newer version should resolve the missing react-native dependency for freeRASP. (Notice that in the new version, react-native is imported by apply plugin: "com.facebook.react" which is exactly the missing import freeRASP requires.)

Hope this helps,

Tomas, Talsec developer

Fix upgrade react-native 0.70.5
facebook/react-native#35210