get image from Firebase storage. GlideApp unresolved reference - kotlin

I have tried literally every solution on the web to try and resolve GlideApp with no success. Is there another method I can use to retrieve an image from Firebase Storage and put into an ImageView instead of glide? I worry that if it's this hard to find a solution to using Glide initially, what's gonna happen down the line? Google recommends it, but I just cannot get it to work. Here's what I'm implementing:
implementation "com.github.bumptech.glide:glide:4.3.1"
Implementation "com.github.bumptech.glide:okhttp3-integration:4.3.1"
kapt "com.github.bumptech.glide:compiler:4.3.1"1
and here's my fragment code:
val storageRef = data.getReference()
val pathReference = storageRef.child(user?.uid.toString() + "/images/coverphoto")
GlideApp.with(context)
.load(pathReference)
.into();
It really shouldn't be this difficult to initially use Glide.
I should mention that this is a kotlin project and that I am trying to access the image in a fragment.
Just in case you need it:
repositories {
maven {
url "https://dl.bintray.com/kotlin/exposed"
}
mavenCentral()
maven { url 'https://maven.google.com' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'org.jetbrains.anko:anko-common:0.9'
implementation 'com.beust:klaxon:3.0.1'
implementation "com.android.support:recyclerview-v7:27.1.1"
testImplementation 'junit:junit:4.12'
implementation "com.github.bumptech.glide:glide:4.3.1"
implementation "com.github.bumptech.glide:okhttp3-integration:4.3.1"
kapt "com.github.bumptech.glide:compiler:4.3.1"
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android-extensions'
****2nd Update****
Here's my ful gradle.build file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.ntx_deisgns.cyberchatter.cyberchatter"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
customDebugType {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://dl.bintray.com/kotlin/exposed"
}
mavenCentral()
maven { url 'https://maven.google.com' }
}
dependencies {
// implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'org.jetbrains.anko:anko-common:0.9'
implementation 'com.beust:klaxon:3.0.1'
implementation "com.android.support:recyclerview-v7:27.1.1"
testImplementation 'junit:junit:4.12'
implementation 'com.github.bumptech.glide:annotations:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.7.1'
implementation "com.github.bumptech.glide:okhttp3-integration:4.6.1"
implementation 'com.github.bumptech.glide:annotations:4.7.1'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

Add this class anywhere in your app module and it'll work:
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.module.AppGlideModule
#GlideModule
class RequiredAppGlideModule : AppGlideModule()
And don't forget the glide compiler:
implementation 'com.github.bumptech.glide:annotations:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.7.1'
implementation "com.github.bumptech.glide:okhttp3-integration:4.6.1"
implementation 'com.github.bumptech.glide:annotations:4.7.1'
And make sure you also do
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

I have solved by :
Click menu Build
Click Make Module
And GlideApp Class will automatically generated

Related

Error while evaluating property 'filteredArgumentsMap' of task ':app:kaptGenerateStubsDebugKotlin'

Full info of Errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
Error while evaluating property 'filteredArgumentsMap' of task ':app:kaptGenerateStubsDebugKotlin'
Could not resolve all files for configuration ':app:kapt'.
> Could not resolve com.github.bumptech.glide:glide:compiler.
Required by:
project :app
> No cached version of com.github.bumptech.glide:glide:compiler available for offline mode.
> No cached version of com.github.bumptech.glide:glide:compiler available for offline mode.
2: Task failed with an exception.
What went wrong:
Execution failed for task ':app:javaPreCompileDebug'.
Could not resolve all files for configuration ':app:_agp_internal_javaPreCompileDebug_kaptClasspath'.
Could not resolve com.github.bumptech.glide:glide:compiler.
Required by:
project :app
> No cached version of com.github.bumptech.glide:glide:compiler available for offline mode.
> No cached version of com.github.bumptech.glide:glide:compiler available for offline mode.
I updated all highlighted values in both Gradle files, but my project still don't start. I was creating this project follow this tutorial (https://www.youtube.com/watch?v=nKz_GyCvitw&list=PLaQox2QQZDpjCmqVPvJ5eDyN26UYEojAt&index=9).
I think it`s problem with Dagger&Hilt, because main errors by functions kapt in Gradle file.
I tried start project in toggle offline mode
My Gradle (Module) file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'androidx.navigation.safeargs.kotlin'
id 'dagger.hilt.android.plugin'
id 'kotlin-kapt'
}
android {
namespace 'com.example.movieapp'
compileSdk 33
defaultConfig {
applicationId "com.example.movieapp"
minSdk 21
targetSdk 33
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 {
dataBinding = true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation 'com.google.dagger:hilt-android:2.31.2-alpha'
kapt 'com.google.dagger:hilt-android-compiler:2.31.2-alpha'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'androidx.paging:paging-runtime-ktx:3.1.1'
implementation 'com.github.bumptech.glide:glide:4.13.0'
kapt 'com.github.bumptech.glide:glide:compiler:4.13.0'
}
My Gradle (Project) file
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'androidx.navigation.safeargs' version '2.4.2' apply false
id 'com.google.dagger.hilt.android' version '2.41' apply false
}

Android API 31 FLAG_IMMUTABLE Error using Firebase Auth UI

I'm receving the below error in API 31 devices during Firebase Auth UI library(Only Phone number credential),
Fatal Exception: java.lang.IllegalArgumentException: com.sstech.racemanager: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
at android.app.PendingIntent.getActivity(PendingIntent.java:444)
at android.app.PendingIntent.getActivity(PendingIntent.java:408)
at com.google.android.gms.internal.auth-api.zzr.zzc(zzr.java:19)
at com.google.android.gms.auth.api.credentials.CredentialsClient.getHintPickerIntent(CredentialsClient.java:10)
at com.firebase.ui.auth.ui.phone.CheckPhoneHandler.fetchCredential(CheckPhoneHandler.java:28)
at com.firebase.ui.auth.ui.phone.CheckPhoneNumberFragment.setDefaultCountryForSpinner(CheckPhoneNumberFragment.java:238)
at com.firebase.ui.auth.ui.phone.CheckPhoneNumberFragment.onActivityCreated(CheckPhoneNumberFragment.java:127)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2996)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:580)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:285)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3138)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
at android.app.Activity.performStart(Activity.java:8339)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3925)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2407)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8278)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)
Below is my gradle files,
app Level:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
}
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.firebase.firebase-perf'
def versionMajor = 2
def versionMinor = 0
def versionPatch = 10
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.aaa.xxxx"
minSdkVersion 21
targetSdkVersion 31
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas".toString())
arg("room.incremental", "true")
arg("room.expandProjection", "true")
}
}
}
buildTypes {
debug {
minifyEnabled false
multiDexEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders = [enableCrashReporting: "false"]
}
}
// Enables data binding.
buildFeatures {
dataBinding = true
}
compileOptions {
sourceCompatibility = 1.7
}
// For Java issue
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.play:core-ktx:1.8.1'
implementation 'com.google.firebase:firebase-perf:20.0.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'com.google.android.gms:play-services-maps:18.0.1'
implementation 'androidx.preference:preference:1.1.1'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.arch.core:core-runtime:2.1.0'
// Firebase
implementation platform('com.google.firebase:firebase-bom:29.0.3')
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.google.firebase:firebase-database-ktx'
implementation 'com.google.firebase:firebase-config-ktx'
implementation 'com.google.firebase:firebase-inappmessaging-display-ktx'
implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-dynamic-links'
implementation 'com.google.firebase:firebase-functions'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.firebaseui:firebase-ui-auth:8.0.0'
// Fragment
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
implementation "androidx.fragment:fragment-ktx:1.4.0"
// LifeCycle
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0"
// Circle Image View
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation "androidx.recyclerview:recyclerview:1.2.1"
// For control over item selection of both touch and mouse driven selection
// Image cache
implementation 'com.github.bumptech.glide:glide:4.12.0'
kapt 'com.github.bumptech.glide:compiler:4.12.0'
//gmap
implementation 'com.google.android.gms:play-services-location:19.0.0'
// compressor
implementation 'id.zelory:compressor:3.0.1'
implementation 'com.github.Shouheng88:compressor:1.5.0'
// kotlin general
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.31"
//Zoom
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
//Room
implementation "androidx.room:room-runtime:2.3.0"
kapt "androidx.room:room-compiler:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"
// json
implementation 'com.google.code.gson:gson:2.8.9'
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.0"
// SDP
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
// Security
implementation "androidx.security:security-crypto:1.1.0-alpha03"
// Animation
implementation 'com.airbnb.android:lottie:4.2.2'
// Browser
implementation "androidx.browser:browser:1.4.0"
// Camera
def camerax_version = "1.0.2"
// CameraX core library using camera2 implementation
implementation "androidx.camera:camera-camera2:$camerax_version"
// CameraX Lifecycle Library
implementation "androidx.camera:camera-lifecycle:$camerax_version"
// CameraX View class
implementation "androidx.camera:camera-view:1.0.0-alpha31"
implementation "com.github.lisawray.groupie:groupie:2.9.0"
implementation 'com.github.dhaval2404:imagepicker:2.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
}
Project level,
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.firebase:perf-plugin:1.4.0'
def nav_version = "2.3.5"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
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
}
I've searched online and for some the issue is resolved by adding androidx.work:work-runtime-ktx:2.7.1 pacakage, but in my case even this is not solving.
Can anyone help on this issue.
In my case, firebase UI (com.firebaseui:firebase-ui-auth:8.0.0) was using com.google.android.gms:play-services-auth:19.0.0 which I found with the command './gradlew -q app:dependencyInsight --dependency play-services-auth --configuration debugCompileClasspath'
This version of the play services auth was causing the issue for me.
I added a separate
implementation 'com.google.android.gms:play-services-auth:20.0.1'
to my gradle and this issue disappeared.

Data Class with Nullable Parameter in Kotlin 1.5.0 & 1.6.0 Throwing BackendException

Recently updated from Kotlin 1.4.20 to 1.5.30.
I have this class which used to compile no problem
data class Optional<M>(val value: M?)
However, after upgrading, I get the following exception
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: .../Optional.kt
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:235)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:68)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:55)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:41)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:43)
at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.doGenerateFilesInternal(JvmIrCodegenFactory.kt:191)
at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.generateModule(JvmIrCodegenFactory.kt:60)
at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:321)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:113)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:56)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:412)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:112)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:358)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:300)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:119)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:170)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:81)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:607)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:96)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1658)
I get that it's telling me that Any's toString() method doesn't have a body as I can see that from looking at the source code.
What I don't understand is how to rectify it.
EDIT
Can confirm this still happens when upgrading to kotlin version 1.6.0.
It also happens in this data class:
data class Advertisement(
var id: String,
var image: String,
var navUrl: String?
)
My build.gradle file for this module looks like so:
apply plugin: 'kotlin'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.stustirling.redacted-gradle-plugin'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "io.reactivex.rxjava2:rxkotlin:$rxKotlinVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "com.jakewharton.timber:timber:$timberVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
implementation "org.json:json:$testOrgJsonVersion"
implementation "net.sf.biweekly:biweekly:$biweeklyVersion"
testImplementation "junit:junit:$junitVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation "org.mockito:mockito-inline:$mockitoInlineVersion"
testImplementation "org.json:json:$testOrgJsonVersion"
}
redacted {
redactAllDataClasses true
redactClassName true
}
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
My Gradle couldn't find the redacted-gradle-plugin but both of your classes compiles with this minimalistic build.gradle.kts:
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
val kotlinVersion = "1.6.0"
kotlin("jvm") version kotlinVersion
}
repositories {
mavenCentral()
}
Also, while looking at the redacted page at https://github.com/StuStirling/redacted-compiler-plugin, it says "Kotlin compiler plugins are not a stable API", so at least do a "./gradlew clean"!

Kotlin :Execution failed for task ':app:checkDebugAarMetadata'

I am using kotlin ,and I get these error when I add the third library:
** implementation 'com.github.AsynctaskCoffee:tinderlikecardstack:1.0'**
from: https://github.com/AsynctaskCoffee/TinderLikeCardStack
The Error:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.AsynctaskCoffee:tinderlikecardstack:1.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/AsynctaskCoffee/tinderlikecardstack/1.0/tinderlikecardstack-1.0.pom
- https://repo.maven.apache.org/maven2/com/github/AsynctaskCoffee/tinderlikecardstack/1.0/tinderlikecardstack-1.0.pom
- https://jcenter.bintray.com/com/github/AsynctaskCoffee/tinderlikecardstack/1.0/tinderlikecardstack-1.0.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
And my guild.gradle(:app)
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.gearsrun.stackviewapplication"
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'
}
}
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 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.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.airbnb.android:lottie:3.4.1'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.facebook.fresco:fresco:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
implementation 'com.github.AsynctaskCoffee:tinderlikecardstack:1.0'
}
build.grandle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.0"
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
// 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 gradle.properties:
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.enableJetifier=true
Could anyone take a look what was going on please ,thank you so much !
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.AsynctaskCoffee:TinderLikeCardStack:1.0'
}
Normally, your declarations are true but you may declare them on wrong places. implementation part should be in Gradle app - maven declaration should be in main Gradle.
You can also define project with maven
<dependency>
<groupId>com.github.AsynctaskCoffee</groupId>
<artifactId>TinderLikeCardStack</artifactId>
<version>1.0</version>
</dependency>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Also please check you should disable offline Gradle build. You can also download project and import as module.

Expo SDK 33 Update Error in ExpoKit33 or React-native

I was using SDK 30. And my app is a standalone app.
I was going to update SDK33 to launch a 64-bit app.
So I did it in the order that it was written on the homepage. But I've made a lot of errors about where the problem is.
my app.bundle
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'com.jackson.myapp'
targetSdkVersion 26
versionCode 1
versionName '1.0.0'
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
flavorDimensions 'minSdk'
productFlavors {
devMinSdk {
dimension 'minSdk'
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
}
prodMinSdk {
dimension 'minSdk'
minSdkVersion 19
}
}
buildTypes {
debug {
debuggable true
ext.enableCrashlytics = false
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
exclude "lib/arm64-v8a/librealm-jni.so"
}
configurations.all {
resolutionStrategy.force 'com.android.support:design:28.0.0'
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
// Don't use modern jsc-android since it still has some critical bugs that
// crash applications when the string for the JS bundle is loaded and when
// locale-specific date functions are called.
// configurations.all {
// resolutionStrategy {
// force 'org.webkit:android-jsc:r216113'
// }
// }
apply from: 'expo.gradle'
dependencies {
implementation project(':react-native-iap')
implementation project(':react-native-fetch-blob')
implementation project(':react-native-touch-id')
implementation project(':react-native-keychain')
implementation project(':react-native-fs')
implementation project(':react-native-secure-randombytes')
implementation project(':react-native-fast-crypto')
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'host.exp.exponent:expo-app-loader-provider:+'
api 'org.unimodules:core:+'
api 'org.unimodules:unimodules-constants-interface:+'
api 'host.exp.exponent:expo-constants:+'
api 'org.unimodules:unimodules-file-system-interface:+'
api 'host.exp.exponent:expo-file-system:+'
api 'org.unimodules:unimodules-image-loader-interface:+'
api 'host.exp.exponent:expo-permissions:+'
api 'org.unimodules:unimodules-permissions-interface:+'
api 'org.unimodules:unimodules-sensors-interface:+'
api 'host.exp.exponent:expo-react-native-adapter:+'
api 'host.exp.exponent:expo-task-manager:+'
api 'org.unimodules:unimodules-task-manager-interface:+'
// Optional universal modules, could be removed
// along with references in MainActivity
api 'host.exp.exponent:expo-ads-admob:+'
api 'host.exp.exponent:expo-app-auth:+'
api 'host.exp.exponent:expo-analytics-segment:+'
api 'org.unimodules:unimodules-barcode-scanner-interface:+'
api 'host.exp.exponent:expo-barcode-scanner:+'
api 'org.unimodules:unimodules-camera-interface:+'
api 'host.exp.exponent:expo-camera:+'
api 'host.exp.exponent:expo-contacts:+'
api 'host.exp.exponent:expo-face-detector:+'
api 'org.unimodules:unimodules-face-detector-interface:+'
api 'host.exp.exponent:expo-font:+'
api 'host.exp.exponent:expo-gl-cpp:+'
api 'host.exp.exponent:expo-gl:+'
api 'host.exp.exponent:expo-google-sign-in:+'
api 'host.exp.exponent:expo-local-authentication:+'
api 'host.exp.exponent:expo-localization:+'
api 'host.exp.exponent:expo-location:+'
api 'host.exp.exponent:expo-media-library:+'
api 'host.exp.exponent:expo-print:+'
api 'host.exp.exponent:expo-sensors:+'
api 'host.exp.exponent:expo-sms:+'
api 'host.exp.exponent:expo-background-fetch:+'
implementation 'expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1#aar'
apply from: "../../node_modules/react-native-unimodules/gradle.groovy"
implementation 'com.android.support:multidex:1.0.1'
// Our dependencies
implementation 'com.android.support:appcompat-v7:28.0.0'
// Our dependencies from ExpoView
// DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation('com.facebook.android:audience-network-sdk:4.99.0') {
exclude module: 'play-services-ads'
}
compileOnly 'org.glassfish:javax.annotation:3.1.1'
implementation 'com.jakewharton:butterknife:8.4.0'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.amplitude:android-sdk:2.9.2' // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
implementation "com.raizlabs.android:DBFlow:2.2.1"
implementation "com.madgag.spongycastle:core:1.53.0.0"
implementation "com.madgag.spongycastle:prov:1.53.0.0"
debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
implementation 'com.facebook.device.yearclass:yearclass:1.0.1'
implementation 'commons-io:commons-io:1.3.2'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
implementation 'com.yqritc:android-scalablevideoview:1.0.1'
implementation 'commons-codec:commons-codec:1.10'
implementation 'com.segment.analytics.android:analytics:4.3.0'
implementation 'com.google.zxing:core:3.2.1'
implementation 'net.openid:appauth:0.4.1'
implementation('com.airbnb.android:lottie:2.5.5') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.squareup.okio:okio:1.9.0'
// Testing
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.robolectric:robolectric:3.8'
testImplementation 'com.android.support.test:runner:1.0.2-alpha1'
testImplementation 'com.android.support.test:rules:1.0.2-alpha1'
}
// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'
ERROR: Failed to resolve: org.unimodules:core:+
Show in Project Structure dialog
Affected Modules: app
ERROR: Failed to resolve: host.exp.exponent:expo-react-native-adapter:+
Show in Project Structure dialog
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkDebug/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkDebugAndroidTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkDebugUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkRelease/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#prodMinSdkReleaseUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkDebug/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkDebugAndroidTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkDebugUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkRelease/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app#devMinSdkReleaseUnitTest/compileClasspath': Could not find expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1.
Show Details
Affected Modules: app
How can I fix this error? I don't know which part, so there's too much to solve.
Follow steps defined below "If upgrading from SDK32 or below:"
https://docs.expo.io/versions/latest/expokit/expokit/#upgrading-expokit
I got the project back to square one, and then executed it in order.
My difference is not using npm but using Yarn.
It was very effective, and I removed all the places where 'expolib_v1' was present.