Hey I am updating kotlinx coroutines to latest version in android. I am getting weird issue on lint check. I updated my version to 1.5.1 to 1.6.0 in my project.
buidl.gradle(application)
ext {
kotlin_version = '1.5.21'
kotlin_serializtion_version = '1.5.21'
kotlin_coroutines_version = "1.6.0"
retrofit_version = '2.5.0'
moshiVersion = "1.12.0"
retrofit2_version = "2.5.0"
okhttp3_version = "4.9.0"
mockk_version = "1.10.4"
picassoVersion = "2.71828"
lifecycle_version = "2.4.0"
koin_version = "3.1.5"
barcode_scanner_version = "16.1.1"
camerax_version = "1.0.0"
camera_view_version = "1.0.0-alpha22"
stripe_version = "19.0.0"
jacoco_version = "0.8.7"
room_version = "2.3.0"
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_serializtion_version"
classpath 'com.google.firebase:firebase-appdistribution-gradle:2.2.0'
}
buidl.gradle(app)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "androidx.fragment:fragment-ktx:1.4.0"
implementation 'com.google.android.play:core:1.10.3'
implementation 'com.google.android.material:material:1.2.1'
//Kotlin extensions library for Play Core
implementation 'com.google.android.play:core-ktx:1.8.1'
//Android Kotlin extensions
implementation "androidx.core:core-ktx:1.3.2"
//Unit test
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-inline:3.4.0'
androidTestImplementation 'org.mockito:mockito-android:3.4.0'
implementation "org.jacoco:org.jacoco.core:$jacoco_version"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation "io.mockk:mockk:${mockk_version}"
//Moshi (JSON parser)
implementation "com.squareup.moshi:moshi-kotlin:$moshiVersion"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"
//Retrofit2
implementation "com.squareup.retrofit2:retrofit:$retrofit2_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit2_version"
//Paging 3
implementation "androidx.paging:paging-runtime-ktx:3.0.0-alpha07"
//Okhttp3
implementation "com.squareup.okhttp3:okhttp:$okhttp3_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3_version"
//Kotlin Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_coroutines_version"
//ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
//HTML parser
implementation 'org.jsoup:jsoup:1.12.1'
//Payments
implementation 'com.google.android.gms:play-services-wallet:19.1.0'
implementation "com.stripe:stripe-android:$stripe_version"
//Firebase
implementation platform('com.google.firebase:firebase-bom:27.1.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-config-ktx'
implementation "com.google.firebase:firebase-messaging"
implementation "com.google.firebase:firebase-core"
//Pager indicator
implementation 'me.relex:circleindicator:2.1.4'
//Animations
implementation 'com.airbnb.android:lottie:3.2.2'
implementation 'pl.bclogic:pulsator4droid:1.0.3'
//Loading images
implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
//View container which can wrap content
implementation 'com.google.android:flexbox:2.0.1'
//Phone Authentication
implementation 'com.google.android.gms:play-services-auth:20.0.1'
implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.7.0'
//Video player
implementation 'com.google.android.exoplayer:exoplayer:2.11.3'
//Dependency injection - Koin AndroidX Scope features
implementation "io.insert-koin:koin-android:$koin_version"
implementation "io.insert-koin:koin-androidx-workmanager:$koin_version"
testImplementation "io.insert-koin:koin-test-junit4:$koin_version"
testImplementation "io.insert-koin:koin-test:$koin_version"
//WorkManager
implementation "androidx.work:work-runtime-ktx:2.7.1"
// App Startup
implementation "androidx.startup:startup-runtime:1.1.0"
//Progress button extension
implementation 'com.github.razir.progressbutton:progressbutton:2.1.0'
//PDF Viewer
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
//Amplitude
implementation 'com.amplitude:android-sdk:2.25.2'
//Salesforce chat
implementation "com.salesforce.service:chat-ui:4.2.2"
//Jumio
implementation "com.jumio.android:core:3.9.2#aar" // Jumio Core library
implementation "com.jumio.android:nv:3.9.2#aar" // Netverify library
implementation "com.jumio.android:nv-barcode:3.9.2#aar" // Barcode scanning
implementation "com.jumio.android:nv-mrz:3.9.2#aar" // MRZ scanning
//AppsFlyer
implementation 'com.appsflyer:af-android-sdk:6.2.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
// Code Scanner & Camera
implementation "com.google.mlkit:barcode-scanning:$barcode_scanner_version"
implementation "androidx.camera:camera-camera2:$camerax_version"
implementation "androidx.camera:camera-lifecycle:$camerax_version"
implementation "androidx.camera:camera-view:$camera_view_version"
// Braze (marketing push notifications)
implementation "com.appboy:android-sdk-ui:14.0.0"
// Room
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
androidTestImplementation "androidx.room:room-testing:$room_version"
implementation "androidx.room:room-runtime:$room_version"
//Memory leak analysis - should only run in dev builds (devqaImplementation)
//devqaImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
}
Error what I am getting
Could not load custom lint check jar file /Users/vmodi/.gradle/caches/transforms-2/files-2.1/28f32124189df6c8d7d39ecfef6ee770/jetified-ui-graphics-1.0.5/jars/lint.jar
java.lang.NoClassDefFoundError: com/android/tools/lint/client/api/Vendor
at androidx.compose.ui.graphics.lint.UiGraphicsIssueRegistry.<init>(UiGraphicsIssueRegistry.kt:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at com.android.tools.lint.client.api.JarFileIssueRegistry$Factory.loadIssueRegistry(JarFileIssueRegistry.kt:200)
at com.android.tools.lint.client.api.JarFileIssueRegistry$Factory.get(JarFileIssueRegistry.kt:152)
at com.android.tools.lint.client.api.JarFileIssueRegistry$Factory.get(JarFileIssueRegistry.kt:116)
at com.android.tools.lint.client.api.LintDriver.registerCustomDetectors(LintDriver.kt:494)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.kt:414)
at com.android.tools.lint.LintCliClient.run(LintCliClient.kt:256)
at com.android.tools.lint.LintCliClient.run(LintCliClient.kt:237)
at com.android.tools.lint.gradle.LintGradleClient.run(LintGradleClient.kt:255)
at com.android.tools.lint.gradle.LintGradleExecution.runLint(LintGradleExecution.kt:259)
at com.android.tools.lint.gradle.LintGradleExecution.lintSingleVariant(LintGradleExecution.kt:275)
at com.android.tools.lint.gradle.LintGradleExecution.analyze(LintGradleExecution.kt:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.android.tools.lint.gradle.api.ReflectiveLintRunner.runLint(ReflectiveLintRunner.kt:38)
at com.android.build.gradle.tasks.LintBaseTask.runLint(LintBaseTask.java:117)
at com.android.build.gradle.tasks.LintPerVariantTask.lint(LintPerVariantTask.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:726)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:693)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:569)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:554)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:537)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:108)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:278)
Related
I have a compile-time error with the samples provided in the code-labs.
This is the ViewModel
class VM : ViewModel() {
val isVisible = MutableStateFlow(true).asStateFlow()
}
This is what I'd like to write:
#Composable
fun Whatever(vm: VM = viewModel()) {
val isVisible by vm.isVisible.collectAsState(true)
// Use is visible here
}
But it yields to the following error:
Type 'State<TypeVariable(R)>' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
Which is really strange because I can use it like so:
#Composable
fun Whatever(vm: VM = viewModel()) {
val isVisible = vm.isVisible.collectAsState(true)
if(isVisible.value) { … }
}
What dependency do I need to bring in to make the delegate work?
Here are my dependencies: and compose_version = 1.0.0-beta01
dependencies {
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation "androidx.activity:activity-compose:1.3.0-alpha03"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.animation:animation:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
// Kotlin coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
implementation 'androidx.activity:activity-ktx:1.2.0'
implementation 'androidx.core:core-ktx:1.5.0-beta02'
implementation "androidx.activity:activity-compose:1.3.0-alpha03"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha02"
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation "androidx.compose.ui:ui-test:$compose_version"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
}
As described in the doc, try to add the following imports:
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
In my activity, I'm trying to use MaterialContainerTransform but it shows an error that
Required Transition found: MaterialContainerTransform
override fun onCreate(savedInstanceState: Bundle?) {
window.requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS)
setEnterSharedElementCallback(MaterialContainerTransformSharedElementCallback())
//this is giving error
window.sharedElementEnterTransition = MaterialContainerTransform().apply {
addTarget(android.R.id.content)
duration = 300L
}
window.sharedElementReturnTransition = MaterialContainerTransform().apply {
addTarget(android.R.id.content)
duration = 250L
}
My dependencies
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 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//material
implementation 'com.google.android.material:material:1.3.0-alpha02'
def coroutines_version = "1.3.8"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
}
There are two types of MaterialContainerTransform the com.google.android.material.transition.MaterialContainerTransform that uses AndroidX Transition and includes bug fixes that apply to all API levels and the com.google.android.material.transition.platform.MaterialContainerTransform class that is built on the framework Transition class.
Only the framework Transition version can be used for window transitions, so you should make sure you're importing the right version of MaterialContainerTransform:
import com.google.android.material.transition.platform.MaterialContainerTransform
Getting -> Cannot access androidx.lifecycle.HasDefaultViewModelProviderFactory Warning On Library Module Activity Class.
Gradle Dependencies:
dependencies {
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'
implementation "com.airbnb.android:epoxy:$rootProject.epoxyVersion"
implementation "com.airbnb.android:epoxy-databinding:$rootProject.epoxyVersion"
annotationProcessor "com.airbnb.android:epoxy-processor:$rootProject.epoxyVersion"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:$rootProject.appCompatVersion"
implementation "se.emilsjolander:StickyScrollViewItems:$rootProject.StickyScrollViewItemsVersion"
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constrainlayout_version"
implementation "com.google.firebase:firebase-analytics:$rootProject.firebase_core_version"
implementation "com.google.firebase:firebase-messaging:$rootProject.firebase_messaging_version"
implementation "com.crashlytics.sdk.android:crashlytics:$rootProject.crashlytics_version"
implementation "com.google.firebase:firebase-analytics:$rootProject.firebase_core_version"
implementation "com.google.firebase:firebase-config:$rootProject.firebase_config"
implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofit_version"
implementation "com.google.code.gson:gson:$rootProject.gson_version"
implementation "com.squareup.okhttp3:okhttp:$rootProject.okhttp_version"
implementation "com.squareup.retrofit2:converter-gson:$rootProject.retrofit_converter_version"
implementation "com.squareup.retrofit2:converter-scalars:$rootProject.retrofit_converter_version"
implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.okhttp_version"
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.retrofit_version"
implementation "com.jakewharton:butterknife:$rootProject.butterknife_version"
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterknife_version"
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.cardview:cardview:$rootProject.card_view_version"
implementation "androidx.legacy:legacy-support-v4:$rootProject.legacy_support_version"
implementation "androidx.recyclerview:recyclerview:$rootProject.recyclerview_version"
implementation "com.android.volley:volley:$rootProject.volley_version"
implementation "com.github.bumptech.glide:glide:$rootProject.glide_version"
annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glide_version"
implementation "com.facebook.shimmer:shimmer:$rootProject.facebook_shimmer_version"
implementation "androidx.gridlayout:gridlayout:$rootProject.grid_layout_version"
implementation "com.github.badoualy:stepper-indicator:$rootProject.stepper_indicator"
implementation "androidx.browser:browser:$rootProject.browser_version"
implementation "com.github.MikeOrtiz:TouchImageView:$rootProject.touch_imageview_version"
implementation "com.orhanobut:logger:$rootProject.orhanobut_logger"
implementation "androidx.multidex:multidex:$rootProject.multidex_version"
implementation "com.google.dagger:dagger:$rootProject.dagger2Version"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
annotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.dagger2Version"
implementation "com.google.dagger:dagger-android-support:$rootProject.dagger2Version"
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-common-java8:$rootProject.lifecycleVersion"
implementation "com.ethanhua:skeleton:$rootProject.skeleton_version"
implementation "io.supercharge:shimmerlayout:$rootProject.shimmerlayout_version"
implementation "org.igniterealtime.smack:smack-android-extensions:$rootProject.smack_version"
implementation "org.igniterealtime.smack:smack-tcp:$rootProject.smack_version"
implementation "org.igniterealtime.smack:smack-extensions:$rootProject.smack_version"
implementation "org.igniterealtime.smack:smack-android:$rootProject.smack_version"
implementation "org.igniterealtime.smack:smack-experimental:$rootProject.smack_version"
implementation "com.vanniktech:emoji:$rootProject.emoji_version"
implementation "com.vanniktech:emoji-google:$rootProject.emoji_version"
implementation "com.amulyakhare:com.amulyakhare.textdrawable:$rootProject.text_drawable_version"
implementation "de.hdodenhof:circleimageview:$rootProject.circle_image_view_version"
implementation "org.jsoup:jsoup:$rootProject.jsoup_version"
implementation "com.squareup.picasso:picasso:$rootProject.picasso_version"
implementation "androidx.room:room-runtime:$rootProject.room_version"
annotationProcessor "androidx.room:room-compiler:$rootProject.room_version"
// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:$rootProject.room_version"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rx_android_version"
// Test helpers
implementation "com.github.smart-fun:XmlToJson:$rootProject.xml_to_json_version"
implementation "androidx.navigation:navigation-fragment:$rootProject.navigation_version"
implementation "androidx.navigation:navigation-ui:$rootProject.navigation_version"
implementation "net.opacapp:multiline-collapsingtoolbar:$rootProject.collapsing_toolbar_version"
implementation "androidx.viewpager2:viewpager2:$rootProject.viewpager2_version"
implementation "com.google.android.material:material:$rootProject.material_version"
implementation "androidx.transition:transition:$rootProject.transition_version"
implementation "androidx.paging:paging-runtime:$rootProject.paging_version"
implementation project(":evalyPaymentLibrary")
implementation project(path: ':richlinkpreview')
configurations {
all*.exclude group: 'xpp3', module: 'xpp3'
}
}
Versions
ext{
dagger2Version = '2.16'
lifecycleVersion = '2.2.0'
epoxyVersion = '3.9.0'
appCompatVersion = '1.1.0'
xml_to_json_version = '1.4.5'
room_version = '2.2.5'
rx_android_version = '2.1.1'
circle_image_view_version = '3.1.0'
emoji_version = '0.6.0'
smack_version = '4.3.0'
shimmerlayout_version = '2.1.0'
skeleton_version = '1.1.2'
multidex_version = '2.0.1'
gson_version = '2.8.6'
logger_version = '2.2.0'
touch_imageview_version = '2.2.0'
facebook_core_version = '5.0.0'
finestwebview_version = '1.2.7'
stepper_indicator = '1.0.7'
android_support_version = '28.0.0'
facebook_shimmer_version = '0.5.0'
glide_version = '4.11.0'
volley_version = '1.1.1'
espresso_core_version = '3.0.2'
runner_version = '1.0.2'
butterknife_version = '8.1.0'
loggin_interceptor_version = '3.10.0'
retrofit_converter_version = '2.7.1'
okhttp_version = '4.4.0'
retrofit_version = '2.7.1'
crashlytics_version = '2.10.1'
firebase_messaging_version = '20.1.7'
firebase_core_version = '17.4.4'
firebase_config = '19.1.4'
constrainlayout_version = '1.1.3'
StickyScrollViewItemsVersion = '1.0.0'
card_view_version = '1.0.0'
legacy_support_version = '1.0.0'
recyclerview_version = '1.1.0'
grid_layout_version = '1.0.0'
browser_version = '1.0.0'
orhanobut_logger = '2.2.0'
text_drawable_version = '1.0.1'
jsoup_version = '1.11.3'
picasso_version = '2.71828'
navigation_version = '2.3.0'
collapsing_toolbar_version = '27.1.1'
viewpager2_version = '1.0.0'
material_version = '1.3.0-alpha01'
transition_version = '1.3.1'
paging_version = '2.1.2'
}
Tried Invalidates Caches Android Studio Multiple Time. No Good Luck.
My project is running up-to-date, I am using Android Studio 4.0.
My Project Structure is As Default ->
my_project
-app
-myLibrary
-anotherLibrary
I am creating the android app for booking and also I need FCM messaging in the android app.When i implement FCM messaging than it is working well but after i implement the Google calendar in app than the app is crashing when i am sending message on FCM on that line:
java.lang.NoSuchMethodError: No static method
createRootContext(II)Lcom/fasterxml/jackson/core/json/JsonReadContext;
in class Lcom/fasterxml/jackson/core/json/JsonReadContext; or its
super classes (declaration of 'com.fasterxml.jackson.core.json.JsonReadContext' appears in /data/app/com.mmf.loggedinapp-2/split_lib_dependencies_apk.apk:classes102.dex)
This is my FCM Code :
fireBaseReference.push().setValue(map);
This is my FCM code which create crashing when i am sending message on FCM
usering this method reference1.push().setValue(map);
PrefManager prefManager = new PrefManager(getApplicationContext());
Map<String, String> map = new HashMap<String, String>();
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String strDate = sdf.format(c.getTime());
map.put("sender_id", prefManager.getLoggedInId());
map.put("message", messageText);
map.put("time", timeString);
map.put("receiver_id", contactid);
map.put("date", strDate);
map.put("type", "mobile");
map.put("messageStatus", "0");
map.put("status", "1");
if (docUri == null) {
map.put("doc_url", "");
map.put("docFileName", "");
} else {
map.put("doc_url", docUri.toString());
map.put("docFileName", docFileName);
}
if (imageUri == null) {
map.put("imageUri", "");
map.put("imageName", "");
} else {
map.put("imageUri", imageUri.toString());
map.put("imageName", imageName);
}
reference1.push().setValue(map);
This is my build.gradle :-
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'
implementation 'com.android.support:design:27.1.1'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation'
com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.8.2'
implementation 'net.gotev:uploadservice:2.1'
implementation 'com.github.ome450901:SimpleRatingBar:1.3.2'
implementation 'com.vincentbrison.openlibraries.android:dualcache:3.1.1'
implementation 'org.apache.commons:commons-lang3:3.5'
implementation 'com.github.travijuu:numberpicker:1.0.7'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.andanhm.quantitypicker:quantitypicker:1.1.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.sundeepk:compact-calendar-view:2.0.2.3'
implementation 'com.hbb20:ccp:2.0.8'
implementation 'com.github.barteksc:android-pdf-viewer:2.3.0'
implementation 'org.apache.commons:commons-io:1.3.2'
implementation 'com.github.bumptech.glide:glide:4.3.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'io.branch.sdk.android:library:2.+'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.devlomi.record-view:record-view:2.0.0'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'com.stripe:stripe-android:7.0.0'
implementation 'com.amitshekhar.android:android-networking:1.0.0'
implementation 'com.github.franmontiel:FullScreenDialog:1.0.1'
implementation 'com.seatgeek:placesautocomplete:0.3-SNAPSHOT'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'com.twilio:voice-android:2.0.7'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.koushikdutta.ion:ion:2.1.8'
implementation 'com.cocosw:bottomsheet:1.3.1'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'net.the4thdimension:audio-wife:1.0.3'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.api-client:google-api-client-android:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-calendar:v3-rev331-
1.24.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') {
transitive = true;
}
implementation 'com.android.volley:volley:1.1.0'
}
apply plugin: 'com.google.gms.google-services'
I am trying to save a location to geofire but not getting any response from console and in logs.
I have added the dependency in gradle files and created my database reference like this:
DatabaseReference pickupRef = FirebaseDatabase.getInstance().getReference(AppConstants.PICK_UP_REF);
pickupRef.keepSynced(true);
and the string AppConstants.PICK_UP_REF equals PickUpRef. In my activity, I have done this:
Log.d(TAG, "UID in PUR:\t" + uid);
GeoFire mGeoFire = new GeoFire(pickupRef.child(uid));
if (mLastLocation != null) {
mGeoFire.setLocation(uid, new GeoLocation(mLastLocation.getLatitude(), mLastLocation.getLongitude()), new GeoFire.CompletionListener() {
#Override
public void onComplete(String key, DatabaseError error) {
if (error != null){
Log.d(TAG, "Write complete");
} else {
Log.d(TAG, "Write Failed:\t" + error.getMessage());
}
}
});
The oncompletionlistener never gets fired and nothing is updated in my database. Anyone else faced this problem or have I misconfigured it?
Here's my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.jjoey.transportr"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-storage:12.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:12.0.1'
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-places:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
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'
implementation 'com.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
Change your dependencies like below in app grandle:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
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'
implementation 'com.android.support:cardview-v7:27.1.1'
}
And change in Project grandle:
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'