Cannot build because missing common-1.0.0.jar


#1

Suddenly I get the error:

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> 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

This link
https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar
returns 404

What happened? I change nothing and did this process every day a thousand times. But for now it fails on a 404 resource.


#2

I have the same problem


#3

My findings so far: build downloads some files necessary for compilation from jcenter and this link is broken:

https://jcenter.bintray.com/android/arch/lifecycle/common/1.0.0/common-1.0.0.jar

common-1.0.0.jar doesn’t exist at this location.

I’m not sure yet how to solve it.


#4

Is there a path to place this file to avoid loading from internet? Or what file should be hacked to replace the url? And why is this happening? Who failed? I’m really annoyed. Today I need the app. It’s friday and I want to go. Funny, I changed nothing. I did this build process every day hour for hour.

On a new ionic project + android platform the build works. I compared the versions of packages and plugins. Nothing helps. Any ideas? Who needs the file common-1.0.0.jar?


#5

Today another guy has the same problem:
https://forums.adobe.com/thread/2500322
Someone deleted android/arch?


#6

After some googling
(https://github.com/zo0r/react-native-push-notification/issues/748,
https://stackoverflow.com/questions/50563338/could-not-find-runtime-jar-android-arch-lifecycleruntime1-0-0/50564224) ,

here is proposed solution: add this line to your build.gradle file:

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        mavenCentral();
        maven { url 'https://maven.google.com' }  //add this line
        jcenter()
    }
}

It instructs gradle to use another repository do download files it needs. It seems to be working, thought I really don’t understand why build process has to be dependent on downloading files from remote repository. Quite annoying!


#7

Thanks. Summary:
Change the repositories of the android builder.

Got to <your-project>\platforms\android\build.gradle
Moved jcenter() to the bottom! Use maven.google.com at first.

Before:

    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }

After

    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }

Done! I should work now.


#8

Yeah, makes sense. It goes to the first repository in the list.


#9

Okay. Only if the whole domain does not work it goes to the next entry? I expected, if one resource is missing. But ok.

skydive you know what. You saved me. Thanks a lot. :+1:

But who’s such evil and removed the resources from jcenter? .


#10

You are welcome! :grinning: This forum saved my ass so many times, I’m glad I can give back and help somebody too!


#11

As for jcenter - I have no f… idea!


#12

Any solutions for Ionic Pro users as editing the local build.gradle file does nothing for the build on the server ?


#13

I’m facing the same issue on our build server.


#14

solved for me, thanks! :slight_smile:


#15

This solves the build but the app crashes on start. Did you try?


#16

It didn’t crash in my case. Worked just fine.


#17

I am also using the Pro build in the cloud function, any ideas on how to proceed?


#18

Ionic Pro Package users can try the hook script described in the following article.

Android builds fail due to missing jcenter dependencies


#19

solved for me too, thank you :slightly_smiling_face:


#20

not working for me, i think internet connection problem.