I have an aar library project, I am using it in a sample project. I added the relevant library to Maven Local Repository. When I check the Pom file, I can see it as Okhttp3 / logging / HttpLoggingInterceptor dependency. But i am facing with below screen shoot error. Any suggestions?
my parent app gradle file looks like above code
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.deneme"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
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.6'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
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:2.0.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.mylibrary:feature:1.0.15#aar'
implementation 'com.android.support:multidex:1.0.3'
}
My problem is that when the pom file is generated it generates incorrectly, I am actually having a problem on the wrong sub-mobule. After I fixed my pom settings my problem was resolved.
Related
I am trying to implement firebase crash analytics for my android app I added the dependencies as as shown in firebase site,I also added the googleservices.json. Now after making changes I installed my map and it crashes.
I have attached screenshot of logcat. Please help me.
build.gradle of app
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.android.quotesapp"
minSdkVersion 21
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'
}
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.android.support:design:28.0.0'
implementation("androidx.recyclerview:recyclerview:1.2.1")
// For control over item selection of both touch and mouse driven selection
implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
implementation 'com.squareup.picasso:picasso:2.71828'
implementation("com.android.volley:volley:1.2.0")
implementation "androidx.cardview:cardview:1.0.0"
implementation platform('com.google.firebase:firebase-bom:28.3.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Add the following in your gradle file:
apply plugin: 'com.google.firebase.crashlytics'
After
buildFeatures {
}
add
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Also add
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
Also in your project build.gradle if you have not added
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
in dependencies then do so
When I build the project the error says,
What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.android.support:multidex:2.0.1.
my app build.gradle looks like this;
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 31
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.example.derepostelouest"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
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.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-auth:19.2.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.android.support:multidex:2.0.1'
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.google.firebase:firebase-database-ktx'
// Cardview Library
implementation 'androidx.cardview:cardview:1.0.0'
}
Please someone somewhere help, I'm going nuts...
I have crossed the whole internet unsuccessfully.
Connecting module application and get following error:
Circular dependency between the following tasks:
:app:processDebugResources
\--- :app:processDebugResources (*)
Module structure
/app
|--base
|--authfire
Error appears after adding to authfire gradle this line
api project(path: ':app')
What I actually need is simply use MainActivity class from root app inside authfire for starting MainActivity. Woud be appreciate for any help.
:app gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-kapt'
apply from: '../dependencies.gradle'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.alazar.tracker"
minSdkVersion 22
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 1.8
targetCompatibility 1.8
}
buildFeatures {
viewBinding = true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(path: ':app:base')
implementation project(path: ':app:authfire')
implementation libs.kotlin
implementation libs.core
implementation libs.appcompat
implementation libs.lifecycle
implementation libs.constraint
implementation libs.material
testImplementation libs.testJunit
androidTestImplementation libs.androidTestJunit
androidTestImplementation libs.androidTestEspresso
// dagger
implementation libs.dagger
kapt libs.daggerKapt
}
:app:authfire gradle
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.google.gms.google-services'
id 'kotlin-kapt'
}
apply from: '../../dependencies.gradle'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
minSdkVersion 22
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'
}
buildFeatures {
viewBinding = true
}
}
dependencies {
//noinspection GradleDependency
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72" // because of Firebase compatibility
}
dependencies {
api project(path: ':app')
api project(path: ':app:base')
implementation libs.core
implementation libs.appcompat
implementation libs.material
implementation libs.constraint
implementation libs.lifecycle
testImplementation libs.testJunit
androidTestImplementation libs.androidTestJunit
androidTestImplementation libs.androidTestEspresso
// Firebase
implementation platform('com.google.firebase:firebase-bom:26.0.0')
implementation 'com.google.firebase:firebase-auth-ktx:20.0.0'
implementation 'com.google.firebase:firebase-firestore-ktx:22.0.0'
// RX
implementation libs.rxKotlin
// dagger
implementation libs.dagger
kapt libs.daggerKapt
}
Thanks!
Move the common/shared code used by the two modules to another module, say common:
we have,
common module
module 1 depends on common
module 2 depends on common
and so on..
this way you won't have a circular dependency issue
App is depending on authfire
authfire is depending on App
That for sure make a loop.
it seems that in project: authfire you need to use some parameters from project: App. Solution whould be like this:
App is depending on authfire (that is ok)
App is passing parameters to Project:authfire (that would be ok) (example of passing parameters is using broadcast)
I follow google guidlines to setup compose in my project, this is my app-level build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.super.note"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode rootProject.versionCode
versionName rootProject.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
useIR = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion Versions.compose
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation Kotlin.stdlib
implementation AndroidX.coreKtx
implementation AndroidX.appcompat
implementation AndroidX.constraintLayout
implementation AndroidX.recyclerView
implementation Lifecycle.extensions
implementation Lifecycle.livedata
implementation Material.core
implementation AndroidX.legacySupport
androidTestImplementation "androidx.test.ext:junit:$junit_android_version"
//fragment androidx
implementation AndroidX.fragment
implementation AndroidX.fragmentKtx
//navigation
implementation Navigation.fragment
implementation Navigation.uiKtx
//Debugging
implementation Debug.timber
//lottie
implementation Animation.lottie
//Hilt DI
implementation Di.hiltAndroid
kapt Di.hiltCompiler
implementation Di.hiltViewModel
kapt Di.hiltAndroidX
//compose
implementation Compose.core
implementation Compose.material
implementation Compose.tooling
implementation project(":domain")
implementation project(":data")
}
I get this error when I try build it:
e: java.lang.NoSuchMethodError: org.jetbrains.kotlin.codegen.state.GenerationState$Builder.isIrBackend(Z)Lorg/jetbrains/kotlin/codegen/state/GenerationState$Builder;
I use Firebase, hilt and corutine and build project with Android Studio 4.2 Canary.
Does anyone have idea to fix this or I can’t use firebase and google play corutine with compose at the moment? Thanks
When i'm creating the kotlin project build is failing due to
What went wrong:
A problem occurred configuring root project 'SampleFirstApp'.
Could not resolve all artifacts for configuration ':classpath'.
Could not download kotlinx-coroutines-core-1.3.7.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7)
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.3.7/kotlinx-coroutines-core-1.3.7.jar'.
> Could not GET 'https://d29vzk4ow07wi7.cloudfront.net/ad426ec76f52b1dcdf200f55495aea9a2d2796811884e8c4b514645061cf59f3?response-content-disposition=attachment%3Bfilename%3D%22kotlinx-coroutines-core-1.3.7.jar%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvYWQ0MjZlYzc2ZjUyYjFkY2RmMjAwZjU1NDk1YWVhOWEyZDI3OTY4MTE4ODRlOGM0YjUxNDY0NTA2MWNmNTlmMz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMmtvdGxpbngtY29yb3V0aW5lcy1jb3JlLTEuMy43LmphciUyMiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTYwMDA3NzM5N30sIklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiIwLjAuMC4wLzAifX19XX0_&Signature=QWeAM~fwvUMegI6EgefXgSAV0Cd6m~ULFAMUE2DboAuh1jEkoNp2tE-vpfsgBiehCl5ECs1t96jQrP26I3gGCfeWG-rX1qWAmrMfxESzhPjlvQWs5jOLLuFt8tlnuw6YJeUAbMRlV5mgUXv4~NhqxZ3qhT9XsN3XlTHJXIEKNkyjymJfdWgk2RRFyNFs3aRNIBwPJoNIRx6QiLeYf2MmL43jTxvS~moILHqWwtIoS5G6ObVtLVmOvaCN0QxApaBtcSytM3PKAfaGhnSJoCUCu4G~8d03tMfXdqnH6BsQ7Th1BLTOSQQaI3y8Z2s9xpv9ZsRmm3bJ0lC5oC~63lpjSg__&Key-Pair-Id=APKAIFKFWOMXM2UMTSFA'.
this error is coming
My kotlin version in studio is 1.4.10. I have tried all solutions available in google and SO. I have invalidate and cache studio and clean and rebuild the application.
My gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.e.samplefirstapp"
minSdkVersion 16
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 fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}