Skip to content

Could not determine the dependencies of task ':app:compileDevelopmentDebugJavaWithJavac'. #36198

Description

@xeroxoid

New Version

0.71.3

Old Version

0.70.6

Build Target(s)

Android in all favors

Output of react-native info

System:
    OS: macOS 13.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 30.74 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.13.0 - ~/Library/Caches/fnm_multishells/39370_1676644845725/bin/node
    Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/39370_1676644845725/bin/yarn
    npm: 9.4.0 - ~/Library/Caches/fnm_multishells/39370_1676644845725/bin/npm
    Watchman: 2022.11.14.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/milt/.rvm/gems/ruby-2.7.6/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 30, 31, 33
      Build Tools: 30.0.3, 31.0.0, 33.0.0
      System Images: android-31 | Google APIs Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.17 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.3 => 0.71.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Issue and Reproduction Steps

After updating to react-native 0.71 using the upgrade helper the android build fails.

This is the output:

$ npx react-native run-android --variant=developmentDebug --appIdSuffix 'development'
info Starting JS server...
warn "variant" flag is deprecated and will be removed in future release. Please switch to "mode" flag.
info Installing the app...

> Configure project :app
Reading env from: .env.development

> Configure project :lottie-react-native
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

> Configure project :react-native-auth0
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at ...path-to-app/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using default value: 30.1.0
:react-native-firebase_app:play.play-services-auth using default value: 20.2.0
:react-native-firebase_app package.json found at ...path-to-app/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 14.11.1 (14,11,1 - 14011001)
:react-native-firebase_app:android.compileSdk using custom value: 33
:react-native-firebase_app:android.targetSdk using custom value: 33
:react-native-firebase_app:android.minSdk using custom value: 21
:react-native-firebase_app:reactNativeAndroidDir ...path-to-app/node_modules/react-native/android

> Configure project :react-native-firebase_dynamic-links
:react-native-firebase_dynamic-links package.json found at ...path-to-app/node_modules/@react-native-firebase/dynamic-links/package.json
:react-native-firebase_app package.json found at ...path-to-app/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_dynamic-links:firebase.bom using default value: 30.1.0
:react-native-firebase_dynamic-links package.json found at ...path-to-app/node_modules/@react-native-firebase/dynamic-links/package.json
:react-native-firebase_dynamic-links:version set from package.json: 14.11.1 (14,11,1 - 14011001)
:react-native-firebase_dynamic-links:android.compileSdk using custom value: 33
:react-native-firebase_dynamic-links:android.targetSdk using custom value: 33
:react-native-firebase_dynamic-links:android.minSdk using custom value: 21
:react-native-firebase_dynamic-links:reactNativeAndroidDir ...path-to-app/node_modules/react-native/android

> Configure project :react-native-reanimated
AAR for react-native-reanimated has been found
...path-to-app/node_modules/react-native-reanimated/android/react-native-reanimated-71-hermes.aar

> Configure project :react-native-vision-camera
VisionCamera: node_modules/ found at: ...path-to-app/node_modules
VisionCamera: Building with Hermes...
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
VisionCamera: Frame Processors are enabled! Building C++ part...
WARNING:DSL element 'dexOptions' is obsolete and should be removed.
It will be removed in version 8.0 of the Android Gradle plugin.
Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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 https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 6 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDevelopmentDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:developmentDebugCompileClasspath'.
   > Cannot resolve external dependency com.facebook.flipper:flipper:0.125.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.flipper:flipper-network-plugin:0.125.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.flipper:flipper-fresco-plugin:0.125.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.react:react-android because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.react:hermes-android because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.bugsnag:bugsnag-android:5.28.3 because no repositories are defined.
     Required by:
         project :app > project :bugsnag_react-native
   > Cannot resolve external dependency com.bugsnag:bugsnag-plugin-react-native:5.28.3 because no repositories are defined.
     Required by:
         project :app > project :bugsnag_react-native
   > Cannot resolve external dependency com.facebook.react:react-native:+ because no repositories are defined.
     Required by:
         project :app > project :react-native-community_art
         project :app > project :react-native-community_cameraroll
         project :app > project :react-native-firebase_app
         project :app > project :react-native-firebase_dynamic-links
         project :app > project :react-native-picker_picker
   > Cannot resolve external dependency com.onesignal:OneSignal:4.8.2 because no repositories are defined.
     Required by:
         project :app > project :react-native-onesignal
   > Cannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 because no repositories are defined.
     Required by:
         project :app > project :react-native-screens

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

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:installDevelopmentDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDevelopmentDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:developmentDebugCompileClasspath'.
   > Cannot resolve external dependency com.facebook.flipper:flipper:0.125.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.flipper:flipper-network-plugin:0.125.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.flipper:flipper-fresco-plugin:0.125.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.react:react-android because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency androidx.swiperefreshlayout:swiperefreshlayout:1.0.0 because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.facebook.react:hermes-android because no repositories are defined.
     Required by:
         project :app
   > Cannot resolve external dependency com.bugsnag:bugsnag-android:5.28.3 because no repositories are defined.
     Required by:
         project :app > project :bugsnag_react-native
   > Cannot resolve external dependency com.bugsnag:bugsnag-plugin-react-native:5.28.3 because no repositories are defined.
     Required by:
         project :app > project :bugsnag_react-native
   > Cannot resolve external dependency com.facebook.react:react-native:+ because no repositories are defined.
     Required by:
         project :app > project :react-native-community_art
         project :app > project :react-native-community_cameraroll
         project :app > project :react-native-firebase_app
         project :app > project :react-native-firebase_dynamic-links
         project :app > project :react-native-picker_picker
   > Cannot resolve external dependency com.onesignal:OneSignal:4.8.2 because no repositories are defined.
     Required by:
         project :app > project :react-native-onesignal
   > Cannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 because no repositories are defined.
     Required by:
         project :app > project :react-native-screens

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

    at makeError (...path-to-app/node_modules/execa/index.js:174:9)
    at ...path-to-app/node_modules/execa/index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (...path-to-app/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:82:7)
    at async Command.handleAction (...path-to-app/node_modules/@react-native-community/cli/build/index.js:108:9)

Also here is the adapted 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

        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
        googlePlayServicesVersion = "16.0.0"
        googlePlayServicesVisionVersion = "17.0.2"
        kotlinVersion = "1.6.20"  // fix for vision-camera gradle plugin version
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.3.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("com.google.gms:google-services:4.3.10")
        classpath("com.bugsnag:bugsnag-android-gradle-plugin:7.+")
    }
}

allprojects {
    // START - for react-native-reanimated v1 and rn 0.70.x
    subprojects { subproject ->
        if(project['name'] == 'react-native-reanimated'){
            project.configurations { compile { } }
        }
    }
    // END - for react-native-reanimated v1 and rn 0.70.x
}

and here is the app/build.gradle:

project.ext.envConfigFiles = [
    development: ".env.development",
    staging: ".env.staging",
    production: ".env.production",
]

apply plugin: "com.android.application"
apply plugin: "com.facebook.react"

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

import com.android.build.OutputFile

/**
 * 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 = ["developmentDebug", "stagingDebug", "productionDebug"]

    /* 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 create four separate APKs instead of one,
 * one for each native architecture. This is useful if you don't
 * use App Bundles (https://developer.android.com/guide/app-bundle/)
 * and want to have separate APKs to upload to the Play Store.
 */
def enableSeparateBuildPerCPUArchitecture = true

/**
 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
 */
def enableProguardInReleaseBuilds = false // Warning: enabling this seems to break the release variant

/**
 * 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:+'

/**
 * Private function to get the list of Native Architectures you want to build.
 * This reads the value from reactNativeArchitectures in your gradle.properties
 * file and works together with the --active-arch-only flag of react-native run-android.
 */
def reactNativeArchitectures() {
    def value = project.getProperties().get("reactNativeArchitectures")
    return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def storeFileProp = properties.getProperty('MYAPP_RELEASE_STORE_FILE')
def storePasswordProp = properties.getProperty('MYAPP_RELEASE_STORE_PASSWORD')
def keyAliasProp = properties.getProperty('MYAPP_RELEASE_KEY_ALIAS')
def keyPasswordProp = properties.getProperty('MYAPP_RELEASE_KEY_PASSWORD')

android {
    ndkVersion rootProject.ext.ndkVersion
    compileSdkVersion rootProject.ext.compileSdkVersion
    namespace project.env.get("ANDROID_APP_ID")
    defaultConfig {
        applicationId project.env.get("ANDROID_APP_ID")
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 46
        versionName "1.7.6"
        resValue "string", "build_config_package", "com.package.name" // for react-native-config
        resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis()) // for react-native-codepush
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk true  // If true, also generate a universal APK
            include (*reactNativeArchitectures())
        }
    }
    flavorDimensions "environment"
    productFlavors {
        development {
            applicationIdSuffix ".development"
            manifestPlaceholders = [
                bugsnagApiKey: project.env.get("BUGSNAG_API_KEY"),
                auth0Domain: project.env.get("AUTH0_DOMAIN"),
                auth0Scheme: project.env.get("ANDROID_APP_ID") + "${applicationIdSuffix}"
            ]
        }
        staging {
            applicationIdSuffix ".staging"
            manifestPlaceholders = [
                bugsnagApiKey: project.env.get("BUGSNAG_API_KEY"),
                auth0Domain: project.env.get("AUTH0_DOMAIN"),
                auth0Scheme: project.env.get("ANDROID_APP_ID") + "${applicationIdSuffix}"
            ]
        }
        production {
            applicationIdSuffix ""
            manifestPlaceholders = [
                bugsnagApiKey: project.env.get("BUGSNAG_API_KEY"),
                auth0Domain: project.env.get("AUTH0_DOMAIN"),
                auth0Scheme: project.env.get("ANDROID_APP_ID") + "${applicationIdSuffix}"
            ]
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
        release {
            storeFile file(storeFileProp)
            storePassword storePasswordProp
            keyAlias keyAliasProp
            keyPassword keyPasswordProp
        }
    }
    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.
            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)
            }

        }
    }
}

dependencies {
    implementation project(':lottie-react-native')

     // The version of react-native is set by the React Native Gradle Plugin
    implementation("com.facebook.react:react-android")

    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
    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)

Activity

  1. cortinico commented on Feb 17, 2023

    @cortinico
    Contributor

    Your setup looks correct at a first sight. Can you share your package.json and yarn.lock file?

  2. xeroxoid commented on Feb 19, 2023

    @xeroxoid
    Author

    Sure, thanks @cortinico, here you go:

    package-yarn.zip

    Both files are attached in the .zip above, but here is also a preview of package.json

    package.json preview:

    {
      "name": "NameOfApp",
      "version": "1.7.6",
      "codeBundleId": "0",
      "private": true,
      "scripts": {
        "start": "npx react-native start",
        "start:clean": "npx react-native start --reset-cache",
        "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
        "test": "jest",
        "clean:custom": "./scripts/development/clean-all.sh",
        "clean": "react-native-clean-project",
        "clean:all": "npx react-native clean-project-auto",
        "clean:ios": "react-native-clean-project --remove-iOS-build --remove-iOS-pods",
        "clean:ios:purgederiveddata": "rm -rf ~/Library/Developer/Xcode/DerivedData/*",
        "clean:android": "react-native-clean-project --remove-android-build",
        "xcode": "open ios/NameOfApp.xcworkspace",
        "pod:install": "cd ios && pod install && cd ../",
        "pod:update": "cd ios && pod update && cd ../",
        "ios:development": "npx react-native run-ios --scheme \"NameOfApp-Development\" --configuration Debug.Development",
        "ios:development:release": "npx react-native run-ios --scheme \"NameOfApp-Development\" --configuration Release.Development",
        "ios:staging": "npx react-native run-ios --scheme \"NameOfApp-Staging\" --configuration Debug.Staging",
        "ios:staging:release": "npx react-native run-ios --scheme \"NameOfApp-Staging\" --configuration Release.Staging",
        "ios:production": "npx react-native run-ios --scheme \"NameOfApp-Production\"",
        "android:development": "npx react-native run-android --variant=developmentDebug --appIdSuffix 'development'",
        "android:development:release": "npx react-native run-android --variant=developmentRelease --appIdSuffix 'development'",
        "android:staging": "npx react-native run-android --variant=stagingDebug --appIdSuffix 'staging'",
        "android:staging:release": "npx react-native run-android --variant=stagingRelease --appIdSuffix 'staging'",
        "android:production": "npx react-native run-android --variant=productionDebug",
        "android:production:release": "npx react-native run-android --variant=productionRelease",
        "android:emulator": "node scripts/android/emulator.js",
        "android:emulator:single": "node scripts/android/emulator.js --single",
        "android:emulator:multiple": "node scripts/android/emulator.js --multiple",
        "fix:node": "ln -sf $(which node) /usr/local/bin/node",
        "lint": "yarn lint:ts && yarn lint:eslint",
        "lint:eslint": "eslint src",
        "lint:ts": "tsc --noEmit --skipLibCheck",
        "postinstall": "patch-package && cd ios && pod install && cd ../",
        "pre-commit": "lint-staged",
        "prepare": "husky install",
        "graphql:types": "graphql-codegen --config codegen-types.config.ts --errors-only",
        "graphql:schema": "DOTENV_CONFIG_PATH=./.env.development graphql-codegen --require dotenv/config --config codegen-schema.config.ts --errors-only"
      },
      "dependencies": {
        "@apollo/client": "^3.7.2",
        "@bugsnag/react-native": "^7.18.2",
        "@react-native-async-storage/async-storage": "^1.17.11",
        "@react-native-community/art": "^1.2.0",
        "@react-native-community/blur": "^4.3.0",
        "@react-native-community/cameraroll": "^4.1.2",
        "@react-native-community/datetimepicker": "^6.7.5",
        "@react-native-community/netinfo": "^9.3.7",
        "@react-native-firebase/app": "14.11.1",
        "@react-native-firebase/dynamic-links": "14.11.1",
        "@react-native-masked-view/masked-view": "^0.2.8",
        "@react-native-picker/picker": "^2.4.8",
        "@softmedialab/react-native-material-textfield": "^0.16.24",
        "date-fns": "^2.29.3",
        "deprecated-react-native-prop-types": "^2.3.0",
        "form-data": "^4.0.0",
        "graphql": "^16.6.0",
        "highlight-words-core": "^1.2.2",
        "html-entities": "^2.3.3",
        "lodash": "^4.17.21",
        "lottie-react-native": "^5.1.5",
        "moment": "^2.29.4",
        "path": "^0.12.7",
        "prop-types": "^15.8.1",
        "react": "18.2.0",
        "react-native": "0.71.3",
        "react-native-android-open-settings": "^1.3.0",
        "react-native-animatable": "^1.3.3",
        "react-native-auth0": "^2.17.1",
        "react-native-base64": "^0.2.1",
        "react-native-code-push": "^7.1.0",
        "react-native-config": "^1.5.0",
        "react-native-device-info": "^5.5.3",
        "react-native-fs": "^2.20.0",
        "react-native-gesture-handler": "^2.8.0",
        "react-native-gradle-plugin": "^0.0.7",
        "react-native-haptic-feedback": "^1.14.0",
        "react-native-image-crop-picker": "^0.38.1",
        "react-native-keep-awake": "^4.0.0",
        "react-native-keyboard-aware-scroll-view": "^0.9.5",
        "react-native-linear-gradient": "^2.6.2",
        "react-native-material-ripple": "^0.9.1",
        "react-native-mime-types": "^2.3.0",
        "react-native-mmkv": "^2.7.0",
        "react-native-modal": "^13.0.1",
        "react-native-modal-datetime-picker": "^14.0.0",
        "react-native-onesignal": "^4.5.0",
        "react-native-path": "^0.0.5",
        "react-native-permissions": "^3.6.1",
        "react-native-picker-select": "^8.0.4",
        "react-native-progress": "^5.0.0",
        "react-native-reanimated": "^2.13.0",
        "react-native-safe-area-context": "^4.4.1",
        "react-native-screens": "^3.20.0",
        "react-native-share": "^8.2.0",
        "react-native-simple-toast": "^1.1.4",
        "react-native-snap-carousel": "^3.9.1",
        "react-native-spinkit": "^1.5.1",
        "react-native-store-review": "^0.3.0",
        "react-native-svg": "^13.8.0",
        "react-native-vector-icons": "^9.2.0",
        "react-native-video": "^5.2.1",
        "react-native-vision-camera": "^2.15.4",
        "react-native-webview": "^11.25.1",
        "react-navigation": "^4.4.4",
        "react-navigation-hooks": "^1.1.0",
        "react-navigation-stack": "^2.10.4",
        "react-navigation-tabs": "^2.11.2",
        "semver": "^7.3.8",
        "socket.io-client": "2.1.1",
        "subscriptions-transport-ws": "^0.9.19",
        "vision-camera-code-scanner": "^0.2.0"
      },
      "devDependencies": {
        "@babel/core": "^7.20.0",
        "@babel/preset-env": "^7.20.0",
        "@babel/runtime": "^7.20.0",
        "@bugsnag/source-maps": "^2.3.1",
        "@commitlint/cli": "^12.1.4",
        "@commitlint/config-conventional": "^12.1.4",
        "@graphql-codegen/add": "^3.2.3",
        "@graphql-codegen/cli": "^2.16.1",
        "@graphql-codegen/near-operation-file-preset": "^2.4.4",
        "@graphql-codegen/schema-ast": "^2.6.0",
        "@graphql-codegen/typescript": "^2.8.5",
        "@graphql-codegen/typescript-operations": "^2.5.10",
        "@graphql-codegen/typescript-react-apollo": "^3.3.7",
        "@react-native-community/eslint-config": "^3.0.0",
        "@tsconfig/react-native": "^2.0.3",
        "@types/highlight-words-core": "^1.2.1",
        "@types/jest": "^29.2.4",
        "@types/lodash": "^4.14.191",
        "@types/react": "^18.0.26",
        "@types/react-native": "^0.70.6",
        "@types/react-native-keep-awake": "^2.0.3",
        "@types/react-native-vector-icons": "^6.4.12",
        "@types/react-test-renderer": "^18.0.0",
        "@typescript-eslint/eslint-plugin": "^5.42.0",
        "@typescript-eslint/parser": "^5.42.0",
        "babel-eslint": "^10.0.3",
        "babel-jest": "^29.2.1",
        "babel-plugin-module-resolver": "^4.1.0",
        "chalk": "^4.1.2",
        "commander": "^4.1.0",
        "dotenv": "^16.0.3",
        "eslint": "^8.26.0",
        "eslint-config-airbnb": "^18.2.1",
        "eslint-config-airbnb-typescript": "^17.0.0",
        "eslint-config-prettier": "^8.5.0",
        "eslint-import-resolver-babel-module": "^5.3.1",
        "eslint-plugin-flowtype": "^5.7.2",
        "eslint-plugin-import": "^2.26.0",
        "eslint-plugin-json": "^3.1.0",
        "eslint-plugin-jsx-a11y": "^6.6.1",
        "eslint-plugin-prettier": "^3.4.0",
        "eslint-plugin-react": "^7.31.11",
        "eslint-plugin-react-native": "~3.8.1",
        "husky": "^8.0.0",
        "inquirer": "8.2.5",
        "jest": "^29.2.1",
        "jetifier": "^1.6.4",
        "lint-staged": "^9.4.2",
        "metro-react-native-babel-preset": "0.73.7",
        "patch-package": "^6.5.0",
        "prettier": "^2.8.1",
        "react-native-apollo-devtools-client": "^1.0.4",
        "react-native-clean-project": "^4.0.1",
        "react-test-renderer": "18.2.0",
        "shelljs": "^0.8.5",
        "ts-toolbelt": "^9.6.0",
        "typescript": "^4.9.4"
      },
      "jest": {
        "preset": "react-native"
      },
      "lint-staged": {
        "*.js": [
          "eslint --fix",
          "git add"
        ]
      }
    }
    

    and yarn.lock

  3. cortinico commented on Feb 20, 2023

    @cortinico
    Contributor

    The issue is that you have a:

        "react-native-gradle-plugin": "^0.0.7",
    

    in your package.json that should shouldn't have (as you should never depend on "react-native-gradle-plugin" directly).

    If you remove it, your issue:

       > Cannot resolve external dependency com.facebook.flipper:flipper:0.125.0 because no repositories are defined.
    

    will be resolved 👍

  4. added
    Resolution: AnsweredWhen the issue is resolved with a simple answer
    and removed
    Needs: AttentionIssues where the author has responded to feedback.
    on Feb 20, 2023
  5. xeroxoid commented on Feb 20, 2023

    @xeroxoid
    Author

    OMG. Appreciate the solution!

  6. Gijuno commented on Apr 4, 2023

    @Gijuno

    But.. How can I do if there is no react-native-gradle-plugin in package.json?

  7. Gijuno commented on Apr 5, 2023

    @Gijuno

    In my case, it occurs when > Configure project :react-native-reanimated
    Does anybody have some solutions?

    My Solution

    • just add apply plugin: "com.facebook.react" in app/build.gradle what React Native Upgrade Helper says
  8. avioXD commented on Apr 27, 2023

    @avioXD

    1: Task failed with an exception.

    • What went wrong:
      Execution failed for task ':app:configureCMakeDebug[arm64-v8a]'.

    [CXX1405] error when building with cmake using D:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt: -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Configuring incomplete, errors occurred!
    See also "D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/android/app/.cxx/Debug/p6z2k1x3/arm64-v8a/CMakeFiles/CMakeOutput.log".

    C++ build system [configure] failed while executing:
    @echo off
    "C:\Users\abhis\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe" ^
    "-HD:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup" ^
    "-DCMAKE_SYSTEM_NAME=Android" ^
    "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
    "-DCMAKE_SYSTEM_VERSION=21" ^
    "-DANDROID_PLATFORM=android-21" ^
    "-DANDROID_ABI=arm64-v8a" ^
    "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" ^
    "-DANDROID_NDK=C:\Users\abhis\AppData\Local\Android\Sdk\ndk\25.2.9519653" ^
    "-DCMAKE_ANDROID_NDK=C:\Users\abhis\AppData\Local\Android\Sdk\ndk\25.2.9519653" ^
    "-DCMAKE_TOOLCHAIN_FILE=C:\Users\abhis\AppData\Local\Android\Sdk\ndk\25.2.9519653\build\cmake\android.toolchain.cmake" ^
    "-DCMAKE_MAKE_PROGRAM=C:\Users\abhis\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe" ^
    "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\android\app\build\intermediates\cxx\Debug\p6z2k1x3\obj\arm64-v8a" ^
    "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\android\app\build\intermediates\cxx\Debug\p6z2k1x3\obj\arm64-v8a" ^
    "-DCMAKE_BUILD_TYPE=Debug" ^
    "-DCMAKE_FIND_ROOT_PATH=D:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\android\app\.cxx\Debug\p6z2k1x3\prefab\arm64-v8a\prefab" ^
    "-BD:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\android\app\.cxx\Debug\p6z2k1x3\arm64-v8a" ^
    -GNinja ^
    "-DPROJECT_BUILD_DIR=D:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\android\app\build" ^
    "-DREACT_ANDROID_DIR=D:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\node_modules\react-native\ReactAndroid" ^
    "-DANDROID_STL=c++_shared"
    from D:\DATASPACE\Dataspace Academy Mobile APP\NEW-RELASE\DataspaceAcademy\android\app
    CMake Warning at C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/build/cmake/android-legacy.toolchain.cmake:418 (message):
    An old version of CMake is being used that cannot automatically detect
    compiler attributes. Compiler identification is being bypassed. Some
    values may be wrong or missing. Update to CMake 3.19 or newer to use
    CMake's built-in compiler identification.
    Call Stack (most recent call first):
    C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/build/cmake/android.toolchain.cmake:54 (include)
    C:/Users/abhis/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:93 (include)
    CMakeLists.txt:28 (project)

    CMake Warning at C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/build/cmake/android-legacy.toolchain.cmake:418 (message):
    An old version of CMake is being used that cannot automatically detect
    compiler attributes. Compiler identification is being bypassed. Some
    values may be wrong or missing. Update to CMake 3.19 or newer to use
    CMake's built-in compiler identification.
    Call Stack (most recent call first):
    C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/build/cmake/android.toolchain.cmake:54 (include)
    D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/android/app/.cxx/Debug/p6z2k1x3/arm64-v8a/CMakeFiles/3.18.1-g262b901-dirty/CMakeSystem.cmake:6 (include)
    D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/android/app/.cxx/Debug/p6z2k1x3/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

    CMake Warning at C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/build/cmake/android-legacy.toolchain.cmake:418 (message):
    An old version of CMake is being used that cannot automatically detect
    compiler attributes. Compiler identification is being bypassed. Some
    values may be wrong or missing. Update to CMake 3.19 or newer to use
    CMake's built-in compiler identification.
    Call Stack (most recent call first):
    C:/Users/abhis/AppData/Local/Android/Sdk/ndk/25.2.9519653/build/cmake/android.toolchain.cmake:54 (include)
    D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/android/app/.cxx/Debug/p6z2k1x3/arm64-v8a/CMakeFiles/3.18.1-g262b901-dirty/CMakeSystem.cmake:6 (include)
    D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/android/app/.cxx/Debug/p6z2k1x3/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

    CMake Error at D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:6 (add_subdirectory):
    add_subdirectory called with incorrect number of arguments
    Call Stack (most recent call first):
    D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:106 (include)
    CMakeLists.txt:31 (include)

    CMake Error at D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:7 (add_subdirectory):
    add_subdirectory called with incorrect number of arguments
    Call Stack (most recent call first):
    D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:106 (include)
    CMakeLists.txt:31 (include)

    CMake Error at D:/DATASPACE/Dataspace Academy Mobile APP/NEW-RELASE/DataspaceAcademy/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:109 (target_link_libraries):
    Cannot specify link libraries for target "react_codegen_RNCViewPager" which
    is not built by this project.
    Call Stack (most recent call first):
    CMakeLists.txt:31 (include)

    • Try:

    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    ==============================================================================

    2: Task failed with an exception.

    • What went wrong:
      java.lang.StackOverflowError (no error message)

    • Try:

    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    ==============================================================================

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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 https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

    BUILD FAILED in 1m 24s
    324 actionable tasks: 319 executed, 5 up-to-date

    Package.json

    {
    "name": "DataspaceAcademy",
    "version": "0.0.1",
    "private": true,
    "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
    },
    "dependencies": {
    "@react-native-async-storage/async-storage": "^1.17.11",
    "@react-native-firebase/app": "^17.4.3",
    "@react-native-firebase/messaging": "^17.4.3",
    "@react-navigation/bottom-tabs": "^6.5.7",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/native-stack": "^6.9.12",
    "accordion-collapse-react-native": "^1.1.1",
    "axios": "^1.3.4",
    "crypto-js": "^4.1.1",
    "deprecated-react-native-prop-types": "^4.0.0",
    "expo-asset": "^8.9.1",
    "expo-av": "^13.2.1",
    "expo-modules-core": "^1.2.6",
    "lottie-react-native": "^5.1.5",
    "moment": "^2.29.4",
    "native-base": "^3.4.28",
    "react": "18.2.0",
    "react-native": "0.71.3",
    "react-native-animatable": "^1.3.3",
    "react-native-crypto-js": "^1.0.0",
    "react-native-document-picker": "^8.2.0",
    "react-native-firebase": "^5.6.0",
    "react-native-htmlview": "^0.16.0",
    "react-native-image-crop-picker": "^0.39.0",
    "react-native-image-slider-box": "^2.0.7",
    "react-native-knob": "^2.3.2",
    "react-native-linear-gradient": "^2.6.2",
    "react-native-orientation-locker": "^1.5.0",
    "react-native-pager-view": "^6.2.0",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^2.17.0",
    "react-native-recaptcha": "^1.0.6",
    "react-native-recaptcha-that-works": "^1.3.2",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.20.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-svg": "^12.5.1",
    "react-native-svg-uri": "^1.2.3",
    "react-native-swiper": "^1.6.0",
    "react-native-system-setting": "^1.7.6",
    "react-native-tab-view": "^3.5.1",
    "react-native-toast-message": "^2.1.6",
    "react-native-vector-icons": "^9.2.0",
    "react-native-video": "^5.2.1",
    "react-native-video-basic-controls": "^0.1.16",
    "react-native-video-controls": "^2.8.1",
    "react-native-webview": "^11.26.1",
    "sync-storage": "^0.4.2",
    "zustand": "^4.3.6"
    },
    "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/eslint-config": "^3.2.0",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^29.2.1",
    "@types/node": "^18.15.13",
    "@types/react": "^18.0.24",
    "@types/react-native-crypto-js": "^1.0.0",
    "@types/react-native-dotenv": "^0.2.0",
    "@types/react-native-htmlview": "^0.16.0",
    "@types/react-native-push-notification": "^8.1.1",
    "@types/react-native-snap-carousel": "^3.8.5",
    "@types/react-native-vector-icons": "^6.4.13",
    "@types/react-test-renderer": "^18.0.0",
    "@types/sync-storage": "^0.4.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "jetifier": "^2.0.0",
    "metro-react-native-babel-preset": "0.73.8",
    "prettier": "^2.4.1",
    "react-native-dotenv": "^3.4.8",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4"
    },
    "jest": {
    "preset": "react-native"
    }
    }

    I Tried to us react-native-firebase after that this is happening

  9. qasimgit commented on May 6, 2023

    @qasimgit

    Same issue as @avioXD mentioned after adding react native firebase in android!
    anyone knows how to fix this?

    @avioXD were you able to fix that?

  10. cheymahassine commented on May 3, 2024

    @cheymahassine

    can anyone help me please
    npm run android --info

    auth@0.0.1 android
    react-native run-android

    info A dev server is already running for this project on port 8081.
    info Installing the app...

    Configure project :react-native-firebase_app
    :react-native-firebase_app package.json found at C:\appmobile\climat\auth\node_modules@react-native-firebase\app\package.json
    :react-native-firebase_app:firebase.bom using default value: 32.8.1
    :react-native-firebase_app:play.play-services-auth using default value: 21.0.0
    :react-native-firebase_app package.json found at C:\appmobile\climat\auth\node_modules@react-native-firebase\app\package.json
    :react-native-firebase_app:version set from package.json: 19.2.2 (19,2,2 - 19002002)
    :react-native-firebase_app:android.compileSdk using custom value: 34
    :react-native-firebase_app:android.targetSdk using custom value: 34
    :react-native-firebase_app:android.minSdk using custom value: 21
    :react-native-firebase_app:reactNativeAndroidDir C:\appmobile\climat\auth\node_modules\react-native\android

    Configure project :react-native-reanimated
    Android gradle plugin: 8.2.1
    Gradle: 8.3

    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.

    For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
    5 actionable tasks: 1 executed, 4 up-to-date

    info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

    FAILURE: Build failed with an exception.

    • What went wrong:
      Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

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

    • Try:

    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.
    Get more help at https://help.gradle.org.

    BUILD FAILED in 10s
    error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. > Could not find com.facebook.react:flipper-integration:. Required by: project :app * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 10s.
    info Run CLI with --verbose flag for more details.
    PS C:\appmobile\climat\auth> npx react-native doctor
    Common
    ✓ Node.js - Required to execute JavaScript code
    ✓ npm - Required to install NPM dependencies
    ✓ Metro - Required for bundling the JavaScript code

    Android
    ✓ Adb - Required to verify if the android device is attached correctly
    ✓ JDK - Required to compile Java code
    ✓ Android Studio - Required for building and installing your app on Android
    ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
    ✓ Gradlew - Build tool required for Android builds
    ✓ Android SDK - Required for building and installing your app on Android

    Errors: 0
    Warnings: 0

  11. silentEngineer009 commented on Dec 17, 2024

    @silentEngineer009

    Hi I need help with this issue I am trying to nom publishing my react native app as an sdk which has native android code

    java file
    package com.sampleapprn1test;

    import androidx.annotation.NonNull;

    import com.facebook.react.bridge.Promise;
    import com.facebook.react.bridge.ReactApplicationContext;
    import com.facebook.react.bridge.ReactContextBaseJavaModule;
    import com.facebook.react.bridge.ReactMethod;

    public class HelloWorld extends ReactContextBaseJavaModule {

    HelloWorld(ReactApplicationContext context){
     super(context);
    
    }
    @NonNull
    @Override
    public String getName() {
        return "HelloWorld";
    }
    
    @ReactMethod
    void displayMessage(Promise promise){
        promise.resolve("Hello World");
    }
    

    }

    another java file
    package com.sampleapprn1test;

    import androidx.annotation.NonNull;

    import com.facebook.react.ReactPackage;
    import com.facebook.react.bridge.NativeModule;
    import com.facebook.react.bridge.ReactApplicationContext;
    import com.facebook.react.uimanager.ViewManager;

    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.List;

    public class HelloWorldModule implements ReactPackage {
    @nonnull
    @OverRide
    public List createNativeModules(@nonnull ReactApplicationContext reactApplicationContext) {
    List list = new ArrayList<>();
    list.add(new HelloWorld(reactApplicationContext));
    return list;
    }

    @NonNull
    @Override
    public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactApplicationContext) {
        return Collections.emptyList();
    }
    

    }

    mainApplication file
    package com.sampleapprn1test

    import android.app.Application
    import com.facebook.react.PackageList
    import com.facebook.react.ReactApplication
    import com.facebook.react.ReactHost
    import com.facebook.react.ReactNativeHost
    import com.facebook.react.ReactPackage
    import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
    import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
    import com.facebook.react.defaults.DefaultReactNativeHost
    import com.facebook.react.soloader.OpenSourceMergedSoMapping
    import com.facebook.soloader.SoLoader

    class MainApplication : Application(), ReactApplication {

    override val reactNativeHost: ReactNativeHost =
    object : DefaultReactNativeHost(this) {
    override fun getPackages(): List =
    PackageList(this).packages.apply {
    // Packages that cannot be autolinked yet can be added manually here, for example:
    // add(MyReactNativePackage())
    add(HelloWorldModule())
    }

        override fun getJSMainModuleName(): String = "index"
    
        override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
    
        override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
        override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
      }
    

    override val reactHost: ReactHost
    get() = getDefaultReactHost(applicationContext, reactNativeHost)

    override fun onCreate() {
    super.onCreate()
    SoLoader.init(this, OpenSourceMergedSoMapping)
    if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
    // If you opted-in for the New Architecture, we load the native entry point for this app.
    load()
    }
    }
    }

    React App
    import React, {useEffect} from 'react';
    import {NativeModules, Button} from 'react-native';

    const {HelloWorld} = NativeModules;

    const App = () => {
    const dummy = async () => {
    let thing = await HelloWorld.displayMessage();
    console.log(thing);
    };

    return (
    <>

    </>
    );
    };

    export default App;

    now I have made this into an sdk and published it to npm
    npm I sampleapprn1test
    now I installed it into a new react app and tried to run it in android. Im getting this error log

    Task :gradle-plugin:react-native-gradle-plugin:jar UP-TO-DATE
    13 actionable tasks: 3 executed, 10 up-to-date

    info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

    FAILURE: Build failed with an exception.

    • What went wrong:
      Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

    Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
    Could not resolve project :sampleapprn1test.
    Required by:
    project :app
    > No matching variant of project :sampleapprn1test was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.6.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
    - No variants exist.

  12. Surajtalole commented on Apr 18, 2025

    @Surajtalole

    PS D:\User-App-main\android> ./gradlew.bat installDebug

    Configure project :app
    WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.

    Configure project :react-native-reanimated
    Android gradle plugin: 7.4.2
    Gradle: 7.5.1
    WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

    FAILURE: Build failed with an exception.

    • What went wrong:
      Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

    Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
    Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available.
    Required by:
    project :app
    project :app > project :invertase_react-native-apple-authentication
    project :app > project :pusher_pusher-websocket-react-native

    • Try:

    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to get full insights.

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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 https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

    BUILD FAILED in 6s
    5 actionable tasks: 5 up-to-date

    got this error

  13. Toissincera commented on Jun 11, 2025

    @Toissincera

    Hey, I have nothing of value to add, I just wanted to let "the team" and "the creators" or whatever know, that React Native is the buggiest fuqing piece of sheet in the history of software development, its creators should feel bad, and its advertising team should label, in impact font, on their website:
    THIS FUQING PIECE OF AMPHIBIAN HORSESHEET DOES NOT FUQING WORK AND FUQ YOU FOR TRYING IT.

  14. PrathameshTI commented on Oct 29, 2025

    @PrathameshTI

    I pushed my project to git, deleted project from system, pulled back code from git in new folder. Then npm install and run and started working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: AnsweredWhen the issue is resolved with a simple answerType: Upgrade IssueIssues reported from upgrade issue form

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions