Grade build compile gives dependency error - android

Hey guys im making an app in kotlin with jetpack compose but when i run the app its gives me this error.
"Execution failed for task ':app:compileDebugKotlin'.
Could not resolve all files for configuration ':app:kotlin-extension'.
Could not find androidx.compose.compiler:compiler:0.1.0-dev07.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/androidx/compose/compiler/compiler/0.1.0-dev07/compiler-0.1.0-dev07.pom
- https://jcenter.bintray.com/androidx/compose/compiler/compiler/0.1.0-dev07/compiler-0.1.0-dev07.pom
- https://jitpack.io/androidx/compose/compiler/compiler/0.1.0-dev07/compiler-0.1.0-dev07.pom
Required by:
project :app
Possible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
"
This is my code(build-gradle):
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.github.zsoltk.pokedex"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion "0.1.0-dev07"
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation "androidx.lifecycle:lifecycle-livedata:2.3.1"
implementation 'androidx.ui:ui-framework:0.1.0-dev07'
implementation 'androidx.ui:ui-layout:0.1.0-dev07'
implementation 'androidx.ui:ui-foundation:0.1.0-dev07'
implementation 'androidx.ui:ui-material:0.1.0-dev07'
implementation 'androidx.ui:ui-tooling:0.1.0-dev07'
implementation 'com.github.zsoltk:compose-router:0.7.0'
implementation "io.reactivex.rxjava2:rxjava:2.2.17"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
buildscript {
ext.kotlin_version = "1.3.61"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0-alpha14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Any ideia of what i need to do?

How about adding the dependency it demands?
One needs this Gradle plugin:
https://mvnrepository.com/artifact/androidx.compose.compiler/compiler
And these are the Java dependencies:
https://mvnrepository.com/artifact/androidx.compose
implementation "androidx.compose:compose-compiler:0.1.0-dev17"
It's meanwhile dev17 and not dev7.

Related

I am getting lot of errors while setting up google maps API in my android Application

I am trying to integrate google maps API in my android application but getting lot of errors. I went through lot of questions online for solving the problem but couldn't find a single post which could help me. For this specific errors lot of solution recommended to toggle the offline button and I have already done that but it didn't help me. So anyone could help me in giving different solution. I am hereby attaching my build.gradle file for your reference
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
}
apply plugin: 'com.google.gms.google-services'
android {
compileSdk 31
defaultConfig {
applicationId "com.example.mppolice"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation "androidx.cardview:cardview:1.0.0"
}
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'com.google.firebase:firebase-auth:21.0.7'
implementation 'com.google.android.gms:play-services-maps:18.0.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:30.3.1')
implementation 'com.google.firebase:firebase-analytics'
}
Following is the list of error I am getting while building my application
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath'.
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.google.android.gms:play-services-maps:18.0.0.

Failed to resolve library

I know there are a lot of questions like this, but none of them worked for me.
I tried using settings.Gradle, adding "www."
I'm using jitpack to publish my android library in a GitHub repo
my app-level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.realdev.betrage"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.github.RealDev05:ColorPickerDialog:0.2.1'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.palette:palette:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
my project level gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.Gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My jitpack logs : logs
My library : ColorPickerDialog

cannot add navigation dependency

I am trying to Add Navigation in my project but its showing failed to add Navigation dependency,
when i click on 'ok' in the window to add these now , its showing failed to add dependency and my navigation xml editor is not visible
build gradle project:
// Top-level build file where you can add configuration options common
to all sub-projects/modules.
buildscript {
ext {
version_navigation = "2.3.0"
kotlin_version = "1.4.32"
}
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}
allprojects {
repositories {
google()
jcenter()
}}
task clean(type: Delete) {
delete rootProject.buildDir}
build gradle module:
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 32
buildToolsVersion "30.0.3"
buildFeatures{
dataBinding true
viewBinding true
}
defaultConfig {
applicationId "com.example.exampleko"
minSdkVersion 19
targetSdkVersion 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-
rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//navigation
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
}
What you have to do is the following:
In the build.gradle (project version), find where you have the ext { } and put this inside:
navigationVersion = "2.3.0"
Then, in the build.gradle (module), inside the dependencies { } you have to put theese two dependencies:
implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"
And finally, Sync project with gradle files and Rebuild it to make sure everything is okay.
You can change the navigationVersion to the one that you are using on the project gradle.
Then follow this codelab if you encounter some extra problems.

Execution failed task ':app:kaptGenerateStubsDebugKotlin'

When I want to run the app, I get the following Build output:
Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
> Could not resolve all files for configuration ':app:kapt'.
> Could not find com.android.databinding:compiler:4.2.1.
I searched it already up on stackoverflow but it didn't help. I am stuck on this issue for 2 days now and it's driving me nuts :/
My project build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.10"
ext.version_navigation = "2.3.0"
ext.version_core = "1.3.1"
ext.version_constraint_layout = "2.0.0-rc1"
ext.version_lifecycle_extensions = "2.2.0"
ext.version_material = "1.2.0"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Navigation
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$version_navigation"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My module build.gradle file:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'androidx.navigation.safeargs'
id 'kotlin-kapt'
}
android {
buildFeatures {
dataBinding = true
viewBinding = true
}
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.commentapp"
minSdkVersion 27
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//Navigation
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
kapt "com.android.databinding:compiler:4.2.1"
}
I hope you can help me with that. Write me if you need more information on my project (e.g. fragment file or something like that).
you dont need to put
kapt "com.android.databinding:compiler:4.2.1"
only need enable data binding in the gradle, and you did this
documentation: https://developer.android.com/jetpack/androidx/releases/databinding

How can I install Realm

I am struggling with installation of Realm Library.
I've got failure massage like below
A problem occurred configuring root project 'My Application'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find io.realm:realm-gradle-plugin:7.0.0-beta.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/realm/realm-gradle-plugin/7.0.0-beta/realm-gradle-plugin-7.0.0-beta.pom
- https://jcenter.bintray.com/io/realm/realm-gradle-plugin/7.0.0-beta/realm-gradle-plugin-7.0.0-beta.pom
Required by:
project :
Possible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
build.gradle(:Module)
plugins {
id 'com.android.application'
id 'kotlin-android'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava3:rxjava:3.0.7'
implementation 'io.reactivex.rxjava3:rxkotlin:3.0.0'
implementation 'com.facebook.stetho:stetho:1.5.1'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
implementation 'com.facebook.stetho:stetho-js-rhino:1.5.1'
}
build.gradle(:project)
buildscript {
ext.kotlin_version = "1.3.72"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:7.0.0-beta"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please let me know how yo fix it.

Categories

Resources