I'm using an #aar dependency with transitive=true in build.gradle. It's downloaded to the gradle cache, but isn't resolved while the app is being compiled.
It may or may not be relevant, but I'm using it in a react-native app. The other dependencies in the build are compiled without a problem.
Does anyone have experience dealing with this type of issue?
I figured out that it was a react-native issue. If you are loading a #aar dependency in a package you also need to declare it as a repository in
android/build.gradle
in the block
allprojects {
repositories {
mavenLocal()
jcenter()
DESIRED_REMOTE_REPO_HERE
}
}
Related
I am trying to add this library:
https://github.com/blipinsk/ViewPropertyObjectAnimator
I have added this to my build.gradle file's dependencies:
implementation 'com.bartoszlipinski:viewpropertyobjectanimator:1.5.0'
The Gradle sync is successful after this too.
However when I try to use it:
ViewPropertyObjectAnimator.animate(this#CustomToolbar).topMargin(it).setDuration(200).start()
It keeps telling me Unresolved reference: ViewPropertyObjectAnimator. And I am unable to import as the com.bartoszlipinski doesn't exist when importing.
If I change the library version from 1.5.0 to 1.4.5:
implementation 'com.bartoszlipinski:viewpropertyobjectanimator:1.4.5'
it works fine and import works fine too.
I would prefer using the newer version instead of the old one. Where am I going wrong?
EDIT: I just noticed that even though Gradle sync is successful, it logs a warning:
Failed to resolve: com.bartoszlipinski:viewpropertyobjectanimator:1.5.0 Show in Project Structure dialog Affected Modules: app
And with the older version, I can see the library in the Android Studio's "External Libraries" but it's not there in the newer library version:
Edit 2: I think I figured it out. I came across this:
https://github.com/blipinsk/ViewPropertyObjectAnimator/issues/16
Using custom bintray repo is a bit unusual, and mavenCentral only has up to 1.4.5. Any chance of updating to 1.5.0 on mavenCentral too? Just curious, but technically bintray works well for me atm too
So it seems like mavenCentral doesn't have the updated version.
I recently came across this issue, I added jitpack repository to the settings.gradle file instead of the root file.
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
}
}
Implementation in the build.gradle file was the same.
implementation 'com.github.blipinsk:ViewPropertyObjectAnimator:1.5.0'
I was able to figure this out. I came across this:
https://github.com/blipinsk/ViewPropertyObjectAnimator/issues/16
Using custom bintray repo is a bit unusual, and mavenCentral only has up to 1.4.5. Any chance of updating to 1.5.0 on mavenCentral too? Just curious, but technically bintray works well for me atm too
So it seems like mavenCentral doesn't have the updated version. As a workaround, I added
maven { url "https://jitpack.io" }
to
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
and then change the dependency to:
implementation 'com.github.blipinsk:ViewPropertyObjectAnimator:1.5.0'
I have been trying to fix this error all day now. All I did in the morning was update the compiler I had on my Android Studio. That's when everything went horribly wrong. Since then I have uninstalled the compiler...
These are the types of errors I keep getting everytime I try sync gradle:
Gradle sync failed: Could not find org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0.
Searched in the following locations:
https://maven.google.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.pom
https://maven.google.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.jar
Is the latest and one I can't solve... things I've tried:
To solve the other problems I physically downloaded the jar files and
put them in the respective places (which failed with kotlin 1.2.0)...
I also added this to my gradle:
.
buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'io.fabric.tools:gradle:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
This fixed my other issues...
I tried running from offline mode which failed...
I tried downloading the files into the project and referencing it like this:
.
compile files('kotlin-stdlib-jre8-1.2.0.jar')
I have long since removed the compiler just stuck as to what to do... I couldn't find any way online to fix my problem
I faced this problem after updating to new Android Studio too. You need to provide the dependency with new Kotlin version explicitly. In your app level build.gradle file add:
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.30"
Also you might need to add other dependencies:
compile "org.jetbrains.kotlin:kotlin-stdlib:1.2.30"
compile "org.jetbrains.kotlin:kotlin-reflect:1.2.30"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.30"
I am trying to add an external dependency from jcenter
compile 'com.droidninja:filepicker:2.0.4'
but I keep getting these errors and I can't figure out what is going wrong.
I have seen the same errors come up in lot of projects but nobody seems to know whats going wrong.
The problem is not with the dependency you just added but the Android Support library's dependencies. The latest SDK updates move towards using the remote Google Maven repository instead of downloading everything to be available locally. In order to fix dependency resolution problems follow the Adding Support Libraries guide. Really briefly this is what you have to do:
Open your project's build.gradle (note that this is not the module's file!)
Add the Google Maven repo to the project repositories:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
It's also recommended to add the repo to the buildscript block too, so later on the Gradle plugins can be downloaded from there too:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
All day I'm trying to add my Android library to Github with JitPack.
I did everything described on: https://jitpack.io/docs/ANDROID/, with no success.
The problem is, when i try to build project, Android Studio give me message:
Error:(47, 13) Failed to resolve: com.github.linean:btleuart:v1.0.0
Here is my repo: https://github.com/linean/btleuart
If anyone have any idea what should I check please tell me.
Sorry for my english :)
The release "v1.0.0" does not exist. The release name is "1.0.0". So, in your app or library gradle file, replace
compile 'com.github.linean:btleuart:v1.0.0'
by
compile 'com.github.linean:btleuart:1.0.0'
In addition, make sure that you have included JitPack repo in your root gradle file.
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
You can read some examples describing how to use JitPack to include libraries in your projects
I found solution !
Clean project
use /.gradlew build
use /.gradlew install
Compille project
Git - and now its working
Thanks cricket_007 for info about JitPack build log :)
main build.gradle file should have this:
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
you can check a working example here: https://github.com/matoelorriaga/pokemon-mvp/blob/master/build.gradle
I want to migrate gradle project in Android Studio to version 1.0.
I have the next problem:
Warning:Project app: Only Jar-type local dependencies are supported. Cannot handle: /home/jaume/android-studio-0.8.14/projects/Rutacomandero/app/libs/google-gson-1.7.1-release.zip
Assuming "google-gson-1.7.1-release.zip" is just the gson dependency, then include it in your dependencies section of your build.gradle file, like so:
compile 'com.google.code.gson:gson:1.7.1'
You should be depending on jar files, not zips, and in the case of gson, grab it from central rather than keeping a copy in libs.
Also, 1.7.1 is old, since you're upgrading anyway, try 2.3.1
Had the same problem and I was able to resolve it by adding
repositories {
mavenCentral()
}
so use:
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.code.gson:gson:2.5'
}
I exampled version 2.5 but you should check for updates. see https://github.com/google/gson/releases
My answer was found at http://www.javacodegeeks.com/2013/08/getting-started-with-google-gson.html