I have been trying to integrate mp4parser library
by adding
compile 'com.googlecode.mp4parser:isoparser:1.0.5.4'
But it gives me error
Error:(24, 13) Failed to resolve: com.googlecode.mp4parser:isoparser:1.0.5.4
Without your build.gradle I'm speculating here, but I think that you are missing:
repositories {
mavencentral()
}
in you main build.gradle file.
In my I have the following
allprojects {
buildscript {
repositories {
mavenCentral()
maven {
url "http://repository-monochromeroad.forge.cloudbees.com/release/"
}
}
}
repositories {
mavenCentral()
}
}
The second repositories {} block is essential.
Related
I'm building a react native app and I'm using react-native-gallery-manager library.
Without it it works fine, but with it I get the following error:
*What went wrong:
A problem occurred configuring project ':react-native-gallery-manager'.
Could not resolve all artifacts for configuration ':react-native-gallery-manager:classpath'.
Could not find com.android.tools.build:gradle:2.2.3.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
Required by:
project :react-native-gallery-manager
In my android/build.gradle I have the following inside buildscript:
repositories {
google()
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
Does it mean I have to downgrade my gradle version?
Until the library you're talking about will fix the issue, add this code to your build.gradle
subprojects {
if (project.name.contains('react-native-gallery-manager')) {
buildscript {
repositories {
jcenter()
maven { url "https://dl.bintray.com/android/android-tools/" }
}
}
}
}
And same thing with all the libraries that have the problem... Many repo are currently being updated to fix it.
you have to change
./node_modules/react-native-gallery-manager/android/build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
Yesterday, I updated Android Studio to 3.1 and I'm getting this error :
Could not find org.jetbrains.trove4j:trove4j:20160824.
Searched in the following locations:
https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
Required by:
project :library > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.lint:lint:26.0.1 > com.android.tools.lint:lint-checks:26.0.1 > com.android.tools.lint:lint-api:26.0.1 > com.android.tools.external.com-intellij:intellij-core:26.0.1
This is my project's gradle file :
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// classpath 'com.google.gms:google-services:1.5.0-beta2'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my gradle-wrapper-properties's distdistributionUrl:
distdistributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
Try to replace all occurences of mavenCentral() with jcenter() in your gradle builds
Because jCenter will close in May, you should replace it with Maven. Thanks to giorgos.nl now we can add Trove4j:20160824. Thanks to Xavier Rubio Jansana we can replace maven { url 'https://plugins.gradle.org/m2/' } with gradlePluginPortal().
In root build.gradle write:
buildscript {
repositories {
google()
gradlePluginPortal()
}
}
allprojects {
repositories {
google()
mavenCentral()
// org.jetbrains.trove4j:trove4j:20160824.
gradlePluginPortal()
}
}
To add libraries that have not still been moved to mavenCentral, use this method.
Root build.gradle:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then you should search GitHub repositories of not resolved libraries. App's build.gradle example with two libraries:
dependencies {
// When a library has tags.
implementation 'com.github.RedMadRobot:input-mask-android:6.0.0'
// When a library doesn't have tags.
implementation 'com.github.savvisingh:DateRangePicker:master'
}
Now we can launch an application and build apk without errors.
I had the same mistake ... and for me the following worked:
Add jcenter() to repositories {} of allprojects
And add compile 'org.jetbrains.trove4j: trove4j: 20160824' in the build.gradle app module
I had this same error. I also had jcentre() at the appropriate place. But still it was not working.
One thing you can do which worked for me is clear the caches:
1. Close Android Studio.
2. Clear caches in here:
C:\Users"username"\.android\caches
C:\Users"username"\.gradle\caches
3. Open Android Studio.
Also make sure you have the version of the gradle which is newer than the minimum required.
I am trying to add Giphy Android SDK in my Android Project. On Giphy SDK's documentation, it is mentioned that in your Project gradle.build file, add:
repositories {
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
}
and in your module's gradle.build file add:
compile('com.giphy.sdk:core:1.0.0#aar') {
transitive=true
}
But when i am Syncing it, Android Studio is giving me an error saying:
Failed to resolve: com.giphy.sdk:core:1.0.0
Does anyone have any idea what am i missing?
Make sure to add the following line
repositories {
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
}
under allprojects and not under buildscript like so
allprojects {
repositories {
google()
jcenter()
maven {
url "https://giphy.bintray.com/giphy-sdk"
}
}
}
Error:(5, 0) Could not find method maven() for arguments
[build_aag8zq3tvuj38fvgbhe3t9mrr$_run_closure1$_closure2$_closure4#767e190a] on object of type
org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository.
Well, there is no maven() method in the app build.gradle and it shouldn't be. Such types of errors are most often thrown when you have edited wrongly the project build.gradle, the one not shown on your image. Without having looked at it, I couldn't be more specific.
For reference, your project build.gradle should look like, nothing fancy:
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
I'm trying to add Appdynamics into my application, I'm doing those steps: https://docs.appdynamics.com/display/PRO40/Instrument+an+Android+Application#InstrumentanAndroidApplication-ToaddtheAppDynamicsAndroidagentrepositorytoyourproject but after all I have error:
Error:(15, 13) Failed to resolve: com.appdynamics:appdynamics-runtime:1.0
This is how my build.gradle (for all project) looks like:
buildscript {
configurations.classpath.resolutionStrategy.force('com.android.tools.build:gradle:1.2.3')
repositories {
maven { url uri("adeum-maven-repo") }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3', 'com.appdynamics:appdynamics-gradle-plugin:2.0'
}
}
allprojects {
repositories {
mavenCentral()
}
}
and build.gradle (from app module):
apply plugin: 'adeum'
repositories {
flatDir {
dirs 'lib'
}
maven {
url uri('adeum-maven-repo')
}
}
dependencies {
compile 'com.appdynamics:appdynamics-runtime:1.0'
and adeum-maven-repo paste into project. Any idea what am I doing wrong?
That error means that gradle is unable to resolve the dependency on com.appdynamics:appdynamics-runtime. The easiest way to fix this problem is to use the AppDynamics libraries from maven central rather than the adeum-maven-repo directory. You can do that by editing your top level gradle file to look like this:
buildscript {
configurations.classpath.resolutionStrategy.force('com.android.tools.build:gradle:1.2.3')
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.appdynamics:appdynamics-gradle-plugin:4.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
Then your project-level gradle file would look like:
apply plugin: 'adeum'
repositories {
flatDir {
dirs 'lib'
}
}
dependencies {
compile 'com.appdynamics:appdynamics-runtime:4.+'
}
Note that I have removed the references to adeum-maven-repo, and changed the version numbers on the AppDynamics artifacts to refer to them as they exist in maven central. Once you've done this, you no longer need adeum-maven-repo in your project, since gradle is now downloading these dependencies automatically.