facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118k stars 24.17k forks source link

Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available. #37936 #39320

Closed NeverGone97 closed 11 months ago

NeverGone97 commented 12 months ago

New Version

0.72.4

Old Version

0.66.4

Build Target(s)

Android simulator

Output of react-native info

System: OS: macOS 13.4 CPU: (8) arm64 Apple M1 Memory: 57.67 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.4.0 path: /opt/homebrew/bin/node Yarn: version: 1.22.18 path: /usr/local/bin/yarn npm: version: 8.12.1 path: /opt/homebrew/bin/npm Watchman: version: 2022.06.13.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.11.3 path: /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms:

Issue and Reproduction Steps

My Issue : 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:react-native:0.72.4. Required by: project :app Could not find com.facebook.react:react-native:0.72.4. Required by: project :app > project :baronha_react-native-multiple-image-picker project :app > project :react-native-community_geolocation project :app > project :react-native-firebase_app project :app > project :react-native-firebase_auth project :app > project :react-native-firebase_database project :app > project :react-native-firebase_firestore project :app > project :react-native-firebase_messaging project :app > project :react-native-pager-view project :app > project :react-native-restart

Possible solution:

My build.grade apply plugin: "com.android.application"

import com.android.build.OutputFile

/**

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

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

/**

/**

/**

/**

/**

android { ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

configurations.all { resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' } } defaultConfig { applicationId "com.bicmobileapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 143 versionName "2.4.3" missingDimensionStrategy 'react-native-camera', 'general'

}
splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
    }
}
signingConfigs {
    debug {
        storeFile file('debug.keystore')
        storePassword 'android'
        keyAlias 'androiddebugkey'
        keyPassword 'android'
    }
    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
        }
    }
}
namespace 'com.bicmobileapp'
buildTypes {
    debug {
        signingConfig signingConfigs.debug
        if (nativeArchitectures) {
            ndk {
                abiFilters nativeArchitectures.split(',')
            }
        }
    }
    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"

// proguardFiles "${background_geolocation.projectDir}/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 fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation ("androidx.appcompat:appcompat:1.3.1") { version { strictly '1.3.1' } } implementation "com.facebook.react:react-native:0.66.4!!" // From node_modules implementation "androidx.appcompat:appcompat:+" // implementation 'com.google.android.gms:play-services-location:21.0.1' implementation "com.google.android.gms:play-services-gcm:15.0.1" implementation "com.google.android.gms:play-services-location:15.0.1" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" implementation project(':react-native-push-notification')

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'
    exclude group:'com.squareup.okhttp3', module:'okhttp'
}

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

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.implementation 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' // <- Add this line apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" Project background_geolocation = project(':react-native-background-geolocation') apply from: "${background_geolocation.projectDir}/app.gradle" //apply plugin: "com.facebook.react"

My Packgage.json { "name": "BicMobileApp", "version": "2.8.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@babel/plugin-proposal-optional-chaining": "^7.21.0", "@baronha/react-native-multiple-image-picker": "^0.4.9", "@freakycoder/react-native-single-select": "^0.4.0", "@freakycoder/react-native-text-area": "^0.1.5", "@mapbox/polyline": "^1.1.1", "@react-native-async-storage/async-storage": "^1.17.0", "@react-native-community/geolocation": "^2.1.0", "@react-native-community/netinfo": "^7.1.7", "@react-native-community/push-notification-ios": "^1.10.1", "@react-native-firebase/app": "14.1.0", "@react-native-firebase/auth": "14.1.0", "@react-native-firebase/database": "14.1.0", "@react-native-firebase/firestore": "14.1.0", "@react-native-firebase/messaging": "14.1.0", "@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/elements": "^1.2.1", "@react-navigation/native": "^6.0.6", "@react-navigation/native-stack": "^6.2.5", "@react-navigation/stack": "^6.0.11", "@reduxjs/toolkit": "^1.9.2", "add": "^2.0.6", "dms2dec": "^1.1.0", "graceful-fs": "^4.2.9", "i18next": "^21.6.5", "native-base": "^3.4.7", "patch-package": "^6.4.7", "postinstall-postinstall": "^2.1.0", "prop-types": "15.6.2", "pubnub": "^7.2.0", "pubnub-react": "^3.0.1", "react": "18.2.0", "react-i18next": "^9.0.10", "react-moment": "^1.1.1", "react-native": "0.72.4", "react-native-action-button": "^2.8.5", "react-native-android-location-services-dialog-box": "^2.8.2", "react-native-animated-component": "^0.2.0", "react-native-autocomplete-dropdown": "^2.0.7", "react-native-autocomplete-input": "^5.0.2", "react-native-axios": "^0.17.1", "react-native-background-fetch": "^4.1.2", "react-native-background-geolocation": "^4.8.2", "react-native-camera": "^4.2.1", "react-native-chart-kit": "^6.12.0", "react-native-charts-wrapper": "^0.5.11", "react-native-clean-project": "^3.6.7", "react-native-custom-actionsheet": "^0.1.1", "react-native-custom-picker": "^0.4.0", "react-native-date-picker": "^4.1.3", "react-native-datepicker": "^1.7.2", "react-native-device-info": "^8.4.8", "react-native-dialog": "^9.2.0", "react-native-doc-viewer": "^2.7.8", "react-native-document-picker": "^8.1.1", "react-native-dropdown-autocomplete": "^1.0.18", "react-native-exif": "^0.5.0", "react-native-exit-app": "^1.1.0", "react-native-fs": "^2.20.0", "react-native-geolocation-service": "^5.3.1", "react-native-gesture-handler": "^2.12.1", "react-native-get-location": "^2.2.1", "react-native-gifted-chat": "^0.16.3", "react-native-image-base64": "^0.1.4", "react-native-image-crop-picker": "0.37.3", "react-native-image-picker": "^4.8.4", "react-native-image-resizer": "^1.4.5", "react-native-keyboard-aware-scroll-view": "APSL/react-native-keyboard-aware-scroll-view#pull/501/head", "react-native-keyboard-manager": "^6.5.4-4", "react-native-linear-gradient": "^2.5.6", "react-native-loading-spinner-overlay": "^3.0.1", "react-native-maps": "^0.30.1", "react-native-material-dialog": "^0.7.7", "react-native-mmkv": "^2.10.2", "react-native-modal": "^13.0.0", "react-native-modal-datetime-picker": "^13.1.2", "react-native-modalbox": "^2.0.2", "react-native-pager-view": "5.0.12", "react-native-permissions": "^3.8.0", "react-native-progress": "^5.0.0", "react-native-push-notification": "^8.1.1", "react-native-qrcode-scanner": "^1.5.5", "react-native-reanimated": "2.8.0", "react-native-render-html": "^6.3.1", "react-native-restart": "^0.0.27", "react-native-review-modal": "^0.0.1", "react-native-safe-area-context": "^3.3.2", "react-native-screens": "^3.10.1", "react-native-signature-canvas": "^4.5.0", "react-native-slideshow": "^1.0.1", "react-native-smooth-pincode-input": "^1.0.9", "react-native-spinkit": "^1.5.1", "react-native-star-rating": "^1.1.0", "react-native-step-indicator-v2": "^1.0.3", "react-native-svg": "^13.9.0", "react-native-swipe-list-view": "^3.2.9", "react-native-tab-view": "^3.1.1", "react-native-tag-input": "^0.0.21", "react-native-textinput-effects": "0.6.2", "react-native-vector-icons": "^9.0.0", "react-native-video": "^5.2.0", "react-native-view-pdf": "^0.13.2", "react-native-virtualized-view": "^0.1.5", "react-native-vision-camera": "^3.0.0", "react-native-voice": "^0.3.0", "react-native-webview": "^11.16.0", "react-navigation": "^3.11.0", "react-navigation-stack": "^2.10.4", "react-redux": "^7.2.6", "redux": "^4.1.2", "shortid": "^2.2.16", "socket.io-client": "^4.7.1", "tslib": "^2.3.1", "ws": "^8.13.0", "yarn": "^1.22.19" }, "resolutions": { "react-native-permissions": "^3.8.0" }, "overrides": { "react-native-qrcode-scanner": { "react-native-permissions": "^3.8.0" } }, "devDependencies": { "@babel/core": "7.16.7", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", "@babel/plugin-transform-class-properties": "^7.22.5", "@babel/preset-env": "^7.22.9", "@babel/runtime": "7.16.7", "@react-native-community/eslint-config": "2.0.0", "babel-jest": "26.6.3", "babel-plugin-module-resolver": "^4.1.0", "eslint": "7.14.0", "jest": "26.6.3", "metro-react-native-babel-preset": "0.66.2", "react-native-svg-transformer": "^1.0.0", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }

github-actions[bot] commented 12 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
vksgautam1986 commented 12 months ago

whatever i got from build.gradle , i think you have forgot to change this implementation "com.facebook.react:react-native:0.66.4!!" // From node_modules to This implementation("com.facebook.react:react-android")

https://react-native-community.github.io/upgrade-helper/?from=0.66.4&to=0.72.4#RnDiffApp-android-app-build.gradle

NeverGone97 commented 12 months ago

https://react-native-community.github.io/upgrade-helper/?from=0.66.4&to=0.72.4#RnDiffApp-android-app-build.gradle

after i change implementation "com.facebook.react:react-native:0.66.4!!" to implementation("com.facebook.react:react-android") it still not work. I still get the same error

vksgautam1986 commented 12 months ago

you should clean your android project. ./gradlew clean and try again. if it still showing same error , then i don't know much about it , if it give different error then i can look into it. Match your build.gradle with upgrade helper if anything other thing is missing https://react-native-community.github.io/upgrade-helper/?from=0.66.4&to=0.72.4#RnDiffApp-android-app-build.gradle

NeverGone97 commented 12 months ago

you should clean your android project. ./gradlew clean and try again. if it still showing same error , then i don't know much about it , if it give different error then i can look into it. Match your build.gradle with upgrade helper if anything other thing is missing https://react-native-community.github.io/upgrade-helper/?from=0.66.4&to=0.72.4#RnDiffApp-android-app-build.gradle

thank bro u save my day

vksgautam1986 commented 11 months ago

you can close this issue.