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

android : Failed to resolve #21907

Closed
3 tasks done
kmend opened this issue Oct 23, 2018 · 19 comments
Closed
3 tasks done

android : Failed to resolve #21907

kmend opened this issue Oct 23, 2018 · 19 comments
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@kmend
Copy link

kmend commented Oct 23, 2018

Environment

Run react-native info in your terminal and paste its contents here.

React Native Environment Info:
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 740.27 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.2 - /usr/local/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 5.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
Android SDK:
Build Tools: 23.0.1, 23.0.2, 23.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.3
API Levels: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
react-native: 0.57.3 => 0.57.3
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

Description

Describe your issue in detail. Include screenshots if needed. If this is a regression, let us know.

android

react-native init AwesomeProject

open android studio

err:

The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..

Failed to resolve: support-vector-drawable
Open File

Failed to resolve: livedata-core
Open File

Failed to resolve: viewmodel
Open File

Failed to resolve: common
Open File

Failed to resolve: runtime
Open File

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

@react-native-bot react-native-bot added the Platform: Android Android applications. label Oct 23, 2018
@wellingtondessuy
Copy link

I have the same problem at this morning.

@nvelozsavino
Copy link

Same here, yesterday it was working fine

@nvelozsavino
Copy link

nvelozsavino commented Oct 23, 2018

Moving the jcenter repository to the last position fixed the issue for me:
in android/build.gradle

before:

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}

And after the fix:

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"
        }
        google()
        jcenter()
    }
}

@sunnylqm
Copy link
Contributor

Looks like someone (again?) mistakenly uploaded an incomplete Android support package to jcenter.
https://jcenter.bintray.com/com/android/support/support-vector-drawable/maven-metadata.xml
there was an update on 23.Oct
and only pom desc file but no aar package
https://jcenter.bintray.com/com/android/support/support-vector-drawable/27.1.1/

sunnylqm added a commit to sunnylqm/react-native that referenced this issue Oct 23, 2018
Fixes facebook#21907 (comment) and prevent similar issues happening again
fathyb added a commit to segmentio/analytics-react-native that referenced this issue Oct 23, 2018
CI is broken on Android since today, applying a quick workaround to keep CI green while the react-native team figures it out.

See:
- facebook/react-native#21910
- facebook/react-native#21907
@kmend kmend closed this as completed Oct 24, 2018
@sunnylqm
Copy link
Contributor

@kmend Don't close the issue. And make the title more obvious so that some core members could see this soon.

@asleepace
Copy link

Switching the order of jcenter() and google() didn't work for me...

facebook-github-bot pushed a commit that referenced this issue Oct 24, 2018
Summary:
Fixes #21907 (comment) and prevent similar issues happening again
Pull Request resolved: #21910

Differential Revision: D10842256

Pulled By: hramos

fbshipit-source-id: f4abaa1c8ff8df6f0fb57b1bad745f4df9da7143
@victorgonn
Copy link

Switching the order of jcenter() and google() didn't work for me... [2]
Any other sugestion?

@sunnylqm
Copy link
Contributor

Make sure you have found the right file and the right place to switch google() and jcenter()

@victorgonn
Copy link

"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.3",

Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 8, 2018
JRE: 1.8.0_152-release-1136-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

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

buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'

    // 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"
}
google()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
jcenter()
}
}

task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}

Broken

@RtillaWork
Copy link

Thank you @nvelozsavino , moving jcenter() to last position fixed the issue.

@jothikannan
Copy link

Switching the order of jcenter() and google() do not work for me...

@mjmasn
Copy link
Contributor

mjmasn commented Oct 25, 2018

Not sure it's 100% the same issue but I emailed jfrog support about a similar thing a while ago, they did reply but we continued to experience occasional issues for some time after, has seemed ok lately though.

Switching jcenter / google didn't work for us either as the specific version of the broken package wasn't in the google repo, not sure if that's the case here? Luckily for us the issue was intermittent, usually lasting ~30 minutes per day.

...some of the packages originally mirrored in JCenter from Google’s maven repository contained (and still contain) files with broken checksums. Bintray did not mirror such files to protect users against potentially corrupted artifacts. However, since this has caused certain client types to fail, we have decided to stop mirroring the Google maven repository and remove the files from JCenter - requiring users to resolve them directly from Google. In your case, the pom file you were missing is one of the broken checksum files. While we do not believe this issue can happen again, due to our awareness, you can always contact us for any issues via the bintray.com “Feedback widget” tab...

@jorisvanh
Copy link

I get the same issue and switching jcenter to the last position isn't working for me.

Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar

@YuriiNskyi
Copy link

Did somebody find the solution? Switching jcenter to last position doesn't work for me.

@filipef101
Copy link

filipef101 commented Oct 25, 2018

repositories {
	maven { url "https://maven.google.com" }
        jcenter()
        google()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            url "https://maven.fabric.io/public"
        }
        mavenCentral()
}

I have it like this on the gradles and is building just fine

@YuriiNskyi
Copy link

YuriiNskyi commented Oct 25, 2018

@filipef101 No luck, it doesn't work for me. Are there any other ways to solve this problem?

@PrinceAdeleke
Copy link

PrinceAdeleke commented Oct 25, 2018

@YuriyNskiy - It may be one of your react-native libraries in your package.json that are failing when building the react-native application. I kept getting this error:
A problem occurred configuring project ':react-native-camera'.

> Could not resolve all files for configuration ':react-native-camera:classpath'.
   > Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1).
     Searched in the following locations:
        https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar

React-native-camera updated their build.gradle file and all I pulled the latest changes and voila... My react-native-camera module. Check to see if any of your external libraries have been updated. If you do get an error with your libraries you could update the library's build.gradle file in node_modules/{libraryFolder}/android/buidle.gradle (not a solution btw, just a process of elimination to see if the error is coming form the libraries)

@filipef101
Copy link

@YuriyNskiy I'm not sure if it is the correct aproach but I have that on build.gradle on the /android root and on the android/app dir
I start the files with this:

buildscript {
    repositories {
        maven { url "https://maven.google.com" }
        jcenter()
        google()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            url "https://maven.fabric.io/public"
        }
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'de.undercouch:gradle-download-task:3.1.2'
    }
}

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

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                buildToolsVersion '27.0.3'
            }
        }
    }
}

@YuriiNskyi
Copy link

@filipef101 approach that works for me:

My root build.gradle file:

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

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        maven { url "https://maven.google.com" }
        jcenter()
        google()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            url "https://maven.fabric.io/public"
        }
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'de.undercouch:gradle-download-task:3.1.2'
    }
}

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


task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

grabbou pushed a commit to react-native-community/cli that referenced this issue Nov 6, 2018
Summary:
Fixes facebook/react-native#21907 (comment) and prevent similar issues happening again
Pull Request resolved: facebook/react-native#21910

Differential Revision: D10842256

Pulled By: hramos

fbshipit-source-id: f4abaa1c8ff8df6f0fb57b1bad745f4df9da7143
t-nanava pushed a commit to microsoft/react-native-macos that referenced this issue Jun 17, 2019
Summary:
Fixes facebook#21907 (comment) and prevent similar issues happening again
Pull Request resolved: facebook#21910

Differential Revision: D10842256

Pulled By: hramos

fbshipit-source-id: f4abaa1c8ff8df6f0fb57b1bad745f4df9da7143
@facebook facebook locked as resolved and limited conversation to collaborators Oct 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests