question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot build android anymore: Could not find common.jar

See original GitHub issue

Without changing anything about the code, I cannot build android anymore. The following error happens when running ./gradlew clean:


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-push-notification'.
      > Could not find common.jar (android.arch.core:common:1.0.0).
        Searched in the following locations:
            https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar

What could be the issue here?

react-native-cli: 2.0.1 react-native: 0.51.0 react-native-push-notification@3.0.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:14

github_iconTop GitHub Comments

54reactions
FreddyPolycommented, May 28, 2018

Seems like bintray has some problem with their files, you can change your android/build.gradle file to fix it temporarly and add another source to download from:

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

Thanks to this response

19reactions
joshuapintercommented, Jun 8, 2018

The order of repositories is very important. You’ll want to make sure that jcenter() is below your maven listings.

By ordering your repositories like this, you’re essentially pulling libraries from maven first, then your local node_modules directory and then anything that’s not in those two will be pulled from jcenter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native - Run Android - Could not find common.jar ...
I found this solution and works for me: add maven { url "https://maven.google.com" } in line 18 in file android/build.gradle.
Read more >
common.jar not found in Android Studio Canary Build
I used the startup wizard in Android Studio. It created all the project files, and all I did was added a few XML's...
Read more >
Known issues with Android Studio and Android Gradle Plugin
To fix the issue for the current project, click Run > Edit Configurations and change the default JUnit configuration to only include the...
Read more >
The Java Library Plugin - Gradle User Manual
dependencies do not leak into the compile classpath of consumers anymore, ... module // commons-cli-1.4.jar is not a module and cannot be required...
Read more >
Builds started failing in 2 projects I've been changing, with ...
We fixed by changing the build.gradle files under the root and unity-android-resources/ in the exported project tree. Also we had to execute ' ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found