Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Could not find com.facebook.fresco.stetho #32944

Closed
Rc85 opened this issue Jan 21, 2022 · 11 comments
Closed

Could not find com.facebook.fresco.stetho #32944

Rc85 opened this issue Jan 21, 2022 · 11 comments

Comments

@Rc85
Copy link

Rc85 commented Jan 21, 2022

Description

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.facebook.fresco:stetho:2.2.0.
     Searched in the following locations:
       - file:/C:/Users/roger/.m2/repository/com/facebook/fresco/stetho/2.2.0/stetho-2.2.0.pom
       - file:/F:/Projects/my_takeouts/client/mobile/marketplace/node_modules/react-native/android/com/facebook/fresco/stetho/2.2.0/stetho-2.2.0.pom
       - file:/F:/Projects/my_takeouts/client/mobile/marketplace/node_modules/jsc-android/dist/com/facebook/fresco/stetho/2.2.0/stetho-2.2.0.pom
       - https://dl.google.com/dl/android/maven2/com/facebook/fresco/stetho/2.2.0/stetho-2.2.0.pom
       - https://repo.maven.apache.org/maven2/com/facebook/fresco/stetho/2.2.0/stetho-2.2.0.pom
       - https://www.jitpack.io/com/facebook/fresco/stetho/2.2.0/stetho-2.2.0.pom
     Required by:
         project :app > com.facebook.flipper:flipper-fresco-plugin:0.75.1

This only happens when I use mavenCentral in android/build.gradle. Using jcenter is fine. But jcenter is gonna be removed soon.

facebook/flipper#2410

Version

0.66.4

Output of npx react-native info

System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 10.96 GB / 31.93 GB
  Binaries:
    Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Version  4.1.0.0 AI-201.8743.12.41.7042882
    Visual Studio: 15.9.28307.1401 (Visual Studio Community 2017)
  Languages:
    Java: 17.0.1
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^17.0.2 => 17.0.2
    react-native: ^0.66.4 => 0.66.4
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

  1. Use mavenCentral in android/build.gradle
  2. Run app in development

Snack, code example, screenshot, or link to a repository

android/build.gradle

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

buildscript {
    ext {
        minSdkVersion = 23
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "20.1.5948944"
        googlePlayServicesVersion = "17.0.0"
        kotlinVersion = "1.5.20"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.0.0")
        classpath 'com.google.gms:google-services:4.3.8'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        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")
        }

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

android/app.build.gradle (omitted some code)

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation "androidx.core:core-splashscreen:1.0.0-alpha02"
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.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'
        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
    }

    implementation platform('com.google.firebase:firebase-bom:28.2.1')
    implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
    implementation 'com.facebook.android:facebook-share:[5,6)'
    implementation 'com.android.support:multidex:2.0.1'

    implementation 'com.google.android.gms:play-services-wallet:19.0.1'
}

// 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)
@cortinico
Copy link
Contributor

What you're experiencing is caused by having a FLIPPER_VERSION=0.75.1 somewhere inside a gradle.proprties inside your project. That Flipper version is really old and you should instead use at least 0.99.0 which is the correct version to use with 0.66.4:

FLIPPER_VERSION=0.99.0

@sapramit
Copy link

sapramit commented Jan 28, 2022

Anyone still facing the same issue as it not working for me as well even with FLIPPER_VERSION=0.99.0

@cortinico
Copy link
Contributor

Anyone still facing the same issue as it not working for me as well even with FLIPPER_VERSION=0.99.0

What's the exact error message you're facing?

@henrymoulton
Copy link
Contributor

@cortinico I'm getting this error too across 0.99.0 and 0.138.0

When I rollback to 0.75.1 it's fine?

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-flipper:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-flipper:debugCompileClasspath'.
   > Could not find com.facebook.flipper:flipper:0.99.0 # https.
     Required by:
         project :react-native-flipper

* 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:
Execution failed for task ':app:checkDevDebugAarMetadata'.
> Could not resolve all files for configuration ':app:devDebugRuntimeClasspath'.
   > Could not find com.facebook.flipper:flipper:0.99.0 # https.
     Searched in the following locations:
       - file:/Users/henrymoulton/.m2/repository/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
       - file:/Users/henrymoulton/Code/app/node_modules/react-native/android/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
       - file:/Users/henrymoulton/Code/app/node_modules/jsc-android/dist/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
       - https://dl.google.com/dl/android/maven2/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
       - https://repo.maven.apache.org/maven2/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
       - https://jcenter.bintray.com/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
       - https://www.jitpack.io/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
       - https://maven.google.com/com/facebook/flipper/flipper/0.99.0 # https/flipper-0.99.0 # https.pom
     Required by:
         project :app
         project :app > project :react-native-flipper

@cortinico
Copy link
Contributor

Not sure what is going on with your setup, but this link is working fine:
https://repo.maven.apache.org/maven2/com/facebook/flipper/flipper/0.99.0/
(as Flipper is on Maven Central as expected).

@cortinico
Copy link
Contributor

Closing as there we no follow up, no reproducer, and the provided dependency is verified as available on maven central. Feel free to reopen if the issue persist

@wadhia-yash
Copy link

Any status even I am still getting same issue @cortinico

@IlkhomKurbanov
Copy link

Same issue, same messages as on henrymoulton's screen

@Vashiru
Copy link

Vashiru commented Oct 31, 2022

@Aarush-wadhia @IlkhomKurbanov I ran into this today as well and it's a good chance that you're actually affected by jCenter going down / being down today: https://status.gradle.com/incidents/9740r6bzx438

I ended up following the steps from here: https://stackoverflow.com/questions/74258160/is-jcenter-down-permanently-31-oct

Which meant adding mavenCentral() before google() and jcenter() in my build.gradle. As well as using patch-package to patch any other packages having jcenter() still in their build.gradle. You also might have to try some different version for the FLIPPER_SDK. I ended up with FLIPPER_VERSION=0.99.0 for react-native 0.65.1.

Note: If you use patch-package, running a gradle sync actualy undoes your changes. You'll have to run yarn install again to have it run as a post-install script and get all your packages in.

@jerry-santana
Copy link

Anyone still facing this issue? I haven't been able to fix this for days :(

@marcocirillo01
Copy link

I have already this problem with no solution at this moment, if i solve i will type there

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

No branches or pull requests

9 participants