Failed to resolve: uz.shift:colorpicker:0.5 - android-studio

After I updated the Android studio to 4.0 version, the color picker dependency is not working: "implementation 'uz.shift:colorpicker:0.5#aar'". I also try another dependencies but same issue.
build.gradle
repositories {
maven { url "https://dl.bintray.com/dasar/maven" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/dasar/maven" }
mavenCentral()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//rate alert
implementation 'com.github.hotchemi:android-rate:1.0.1'
implementation "androidx.exifinterface:exifinterface:1.0.0"
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "com.google.android.material:material:1.0.0"
implementation "androidx.palette:palette:1.0.0"
implementation "androidx.browser:browser:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'uz.shift:colorpicker:0.5#aar'
implementation 'com.github.jetradarmobile:desertplaceholder:1.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.yalantis:ucrop:2.2.2'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
implementation 'com.github.HoraApps:Liz:-SNAPSHOT'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
// TODO check them out
implementation 'com.turingtechnologies.materialscrollbar:lib:10.0.3'
implementation 'de.psdev.licensesdialog:licensesdialog:1.8.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
Error
Failed to resolve: uz.shift:colorpicker:0.5
Show in Project Structure dialog
Affected Modules: app

Downgrade the version of gradle as of now, No proper solution is available.
It will work fine in ( Gradle Version - 5.6.4)
I've tried everything still it won't go away. As the problem struck when I downloaded the latest version. I simply switched back to the previous version of gradle and It's working fine now.

Related

Hilt Unsupported metadata version in Kotlin

I was tried to run my code in Kotlin 1.5.10
With plugin as
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
and dependencies as below
dependencies {
...
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.33-beta"
kapt "com.google.dagger:hilt-android-compiler:2.33-beta"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt "androidx.hilt:hilt-compiler:1.0.0-beta01"
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0-alpha01'
implementation 'com.android.support:palette-v7:28.0.0'
When I migrate to kotlin_version = "1.5.10", it just errors out stating
error: [Hilt]
Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateException: Unsupported metadata version. Check that your Kotlin version is >= 1.0
at dagger.internal.codegen.kotlin.KotlinMetadata.metadataOf(KotlinMetadata.java:206)
at dagger.internal.codegen.kotlin.KotlinMetadata.from(KotlinMetadata.java:186)
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133)
...
Can anyone help me? I spent a lot of time on it, your answer will help me a lot
Go to https://dagger.dev/hilt/gradle-setup check Hilt currently version
Update: For now, you can use the newest version.
Kotlin:1.7.0 with Hilt:2.42
Update: kotlin:1.6.0 is compatible with hilt:2.40.5, thanks #Nazanin Nasab
Currently, Kotlin 1.5.21 is compatible with Hilt 2.38.
dependencies {
...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.42"
}
I got the same error. I changed two gradle files and It worked for me.
Project Gradle
plugins {
// dependencies for dagger hilt
id 'com.google.dagger.hilt.android' version '2.42' apply false
}
Module Gradle
dependencies {
implementation 'com.google.dagger:hilt-android:2.42'
kapt 'com.google.dagger:hilt-compiler:2.42'
implementation("androidx.hilt:hilt-navigation-fragment:1.0.0")
}
Adding this line to build.gradle dependencies helped me:
kapt("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.3.0")
https://youtrack.jetbrains.com/issue/KT-45885
Thanks for the answer , i had to do a slight tweak in order to work for me because i'm using Arctic Fox, hopefully this answer will help as well
Build.gradle (project)
buildscript {
ext {
compose_version = '1.0.0'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0-alpha05'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.37"
}
}
Build.gradle (app)
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.34-beta"
kapt "com.google.dagger:hilt-android-compiler:2.34-beta"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt "androidx.hilt:hilt-compiler:1.0.0"
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0-alpha03'
For Kotlin 1.7.10, you just need to make the hilt versions 2.42.
in Project-level build.gradle change hilt version
id 'com.google.dagger.hilt.android' version '2.44' apply false
in App-Level build.gradle
implementation "com.google.dagger:hilt-android:2.44"
kapt "com.google.dagger:hilt-compiler:2.44"
general solution - in AS build console click link at bottom - build with -stacktrace param and find which annotation processor (KAPT) is causing error - then try to update dependency - if you are lucky new version should be available and supporting your gradle version
message in build output you should lookin for
Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output. Run with --scan to get full insights.
I got same here. I was using dagger:hilt-android:2.33-beta with Kotlin 1.5.10.Please try this
Project gradle
implementation "com.google.dagger:hilt-android:2.33-beta"
Module gradle
plugins {
...
id 'dagger.hilt.android.plugin'
}
dependencies {
...
//dagger-hilt
implementation "com.google.dagger:hilt-android:2.35.1"
kapt "com.google.dagger:hilt-android-compiler:2.35.1"
}
If any solution solved your problem. Go to https://dagger.dev/hilt/gradle-setup, in Using Hilt with Kotlin section, copy the version mentioned in dependencies and update your build.gradle accordingly
I have an issue when upgrading kotlin-gradle-plugin:1.7.x for fulfill requirement of compose. I revert them to org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21 and kotlinCompilerExtensionVersion value
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
kotlinCompilerExtensionVersion compose_version
in my case, the problem was in the different versions that I specified in the dependencies.
"2.40" in classpath 'com.google.dagger:hilt-android-gradle-plugin'
and
"2.43.2" in implementation 'com.google.dagger:hilt-android'
Firstly check helt dependency versions with below url
https://dagger.dev/hilt/gradle-setup
Check you kotlin versions
Kotlin version 1.6.0
Project level gradle
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.40"
App level gradle
def hilt_version="2.40"
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
Kotlin version 1.7.0
Project level gradle
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.42"
App level gradle
def hilt_version="2.42"
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"

Android Studio - KorGE plugin - build.gradle

I would like to use Open Source KorGE Game Engine.
I'm using Android Studio and I would like to know if anyone know how to import the library. I've installed the plugin following the setup documentation.
Could anyone show me how to setup right my build.gradle?
Thanks in Advance
UPDATE:
Following #soywiz suggestion this problem occurred:
UPDATE
Thanks to soywiz , now I can use KorGe In my Android Project.
Just set in build gradle:
buildscript {
repositories {
google()
jcenter()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
maven { url = uri("https://dl.bintray.com/kotlin/kotlin-dev") }
}
dependencies {
...
}
}
allprojects {
repositories {
mavenLocal()
maven { url = 'https://dl.bintray.com/korlibs/korlibs' }
google()
jcenter()
maven { url = uri("https://dl.bintray.com/kotlin/kotlin-dev") }
}
}
and in build.gradle (app):
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.soywiz.korlibs.korge:korge-android:1.13.3'
implementation 'com.soywiz.korlibs.klock:klock-android:1.11.12'
implementation 'com.soywiz.korlibs.kmem:kmem-android:1.10.5'
implementation 'com.soywiz.korlibs.kds:kds-android:1.10.12'
implementation 'com.soywiz.korlibs.korma:korma-android:1.11.16'
implementation 'com.soywiz.korlibs.korio:korio-android:1.11.7'
implementation 'com.soywiz.korlibs.korim:korim-android:1.12.24'
implementation 'com.soywiz.korlibs.korau:korau-android:1.11.9'
implementation 'com.soywiz.korlibs.korgw:korgw-android:1.12.18'
implementation 'com.soywiz.korlibs.krypto:krypto-android:1.11.1'
implementation 'com.soywiz.korlibs.korinject:korinject-android:1.10.1'
implementation 'com.soywiz.korlibs.klogger:klogger-android:1.10.1'
}
The easiest way / most up-to-date way to find out the build.gradle requirements is to actually build a project using KorGE.
If you download this repo:
https://github.com/korlibs/korge-hello-world
Then execute:
./gradlew installAndroidDebug
This will create a folder called build/platforms/android containing a build.gradle file with all the details.
The important parts:
repositories {
// ...
maven { url = 'https://dl.bintray.com/korlibs/korlibs' }
// ...
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.soywiz.korlibs.korge:korge-android:1.13.3'
implementation 'com.soywiz.korlibs.klock:klock-android:1.11.12'
implementation 'com.soywiz.korlibs.kmem:kmem-android:1.10.5'
implementation 'com.soywiz.korlibs.kds:kds-android:1.10.12'
implementation 'com.soywiz.korlibs.korma:korma-android:1.11.16'
implementation 'com.soywiz.korlibs.korio:korio-android:1.11.7'
implementation 'com.soywiz.korlibs.korim:korim-android:1.12.24'
implementation 'com.soywiz.korlibs.korau:korau-android:1.11.9'
implementation 'com.soywiz.korlibs.korgw:korgw-android:1.12.18'
implementation 'com.soywiz.korlibs.krypto:krypto-android:1.11.1'
implementation 'com.soywiz.korlibs.korinject:korinject-android:1.10.1'
implementation 'com.soywiz.korlibs.klogger:klogger-android:1.10.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
All the dependencies might change in the future, so my advice is to trigger the hello world android build, so you get an up-to-date build.gradle file.

Why is kapt not working with Kotlin for Node.Js?

I wanted to port a kotlin project with gradle building from jvm to node.js. The build.gradle goes as follow:
plugins {
id 'org.jetbrains.kotlin.js' version '1.3.72'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
jcenter();
}
apply plugin: 'kotlin-kapt'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
testImplementation "org.jetbrains.kotlin:kotlin-test-js"
implementation 'org.apache.httpcomponents:httpclient:4.5.12'
implementation "com.squareup.moshi:moshi-kotlin:1.9.2"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.9.2'
testCompile 'junit:junit:4.12'
}
kotlin.target.nodejs { }
but received the gradle build error
Could not find method kapt() for arguments [com.squareup.moshi:moshi-kotlin-codegen:1.9.2]
and while this works fine with kotlin(jvm) project. I wonder why and how to solve this problem.
Thanks in advance.

Android Studio - cannot resolve symbol 'Glide'

I'm trying to use glide in Android Studio to deal with Gif animation from a resource stored in R.drawable but i get "cannot resolve sysmbol 'Glide'".
I've added glide to my dependencies in the builde.gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
}
and i'm using the following code to set the image view to the gif.
ImageView img=(ImageView)findViewById(R.id.catImg);
int resourceId = R.drawable.gangrycat;
Glide.with(this.context)
.load(resourceId)
.into(img);
I solved this problem by removing dependency from builde.gradle and sync my project, then again add glide dependency to project builde.gradle and sync again.
I have also solved this problem by removing dependency and then again add glide dependency to project builde.gradle and sync again
I was also having the same problem. Initially, I added the following dependencies:
dependencies {
...
implementation 'com.github.bumptech.glide:glide:4.14.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.14.0'
...
}
I just downgraded the glide dependencies version to 4.12.0 and synced again
and it worked for me.
dependencies {
...
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
...
}
Below Dependency should be Used
/**
* Glide :- https://github.com/bumptech/glide
*/
implementation 'com.github.bumptech.glide:annotations:4.14.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
implementation ("com.github.bumptech.glide:glide:4.14.2#aar") {
transitive = true
}

Android Studio - Too many libraries imported to project eventhough they are not compiled in dependencies

I am creating a new Android application that using Firebase. I followed goolge guide to add Firebase SDK to my project.
below are my project gradle:
buildscript {
repositories {
jcenter(){
url "http://jcenter.bintray.com/"
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
And application build.gradle
....
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
/* For Google Play Services */
//Firebase
//addd firebase notification - messaging.
//add firbaes dynamic link:
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.google.android.gms:play-services-safetynet:9.0.2'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.firebaseui:firebase-ui:0.2.2'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.google.firebase:firebase-invites:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
I checked in External library of my project. There are too many library that I don't not need such as: play-service-location-9.0.2, play-service-maps-9.0.2, play-service--nearby-9.0.2...
enter image description here
Could you explain and help me reduce unused library that I don't added into my project ?
Try removing the dependencies you don't need by deleting the dependency from the build.gradle one by one, if you get an error after removing one of your dependencies, add the dependency you just removed back.
As long as you get no errors or problems when removing the dependencies you don't need, everything will be fine.

Resources