I use com.squareup.okhttp3:okhttp:4.4.1
but when should the messages from firebase in app messaging be displayed (when the app starts) the app crashes on 11 android. Okhttp in mainactivity I don't use at all.
Use 'com.google.firebase:firebase-inappmessaging-display:19.1.5'
Tried different versions of
okhttp and firebase inappmessaging display
Fatal Exception: java.lang.AssertionError
Method getAlpnSelectedProtocol not supported for object SSL socket over Socket[address=firebaseinappmessaging.googleapis.com/***,port=*,localPort=*
Fatal Exception: java.lang.AssertionError: Method getAlpnSelectedProtocol not supported for object SSL socket over Socket[address=firebaseinappmessaging.googleapis.com/***,port=*,localPort=*]
at io.grpc.okhttp.internal.OptionalMethod.invoke(OptionalMethod.java:67)
at io.grpc.okhttp.internal.OptionalMethod.invokeWithoutCheckedException(OptionalMethod.java)
at io.grpc.okhttp.OkHttpProtocolNegotiator$AndroidNegotiator.b(OkHttpProtocolNegotiator.java:15)
at io.grpc.okhttp.OkHttpProtocolNegotiator$AndroidNegotiator.negotiate(OkHttpProtocolNegotiator.java)
at io.grpc.okhttp.OkHttpTlsUpgrader.upgrade(OkHttpTlsUpgrader.java:8)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:17)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:11)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation('com.google.android.material:material:1.3.0') {
exclude group: 'androidx'
}
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation('androidx.lifecycle:lifecycle-extensions:2.2.0') {
exclude group: 'androidx'
}
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation('com.squareup.picasso:picasso:2.71828') {
exclude group: 'com.android.support'
exclude module: ['exifinterface', 'support-annotations']
}
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.r0adkll:slidableactivity:2.1.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'de.hdodenhof:circleimageview:3.1.0'
//noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
implementation 'com.google.android.exoplayer:exoplayer:2.10.4'
implementation 'com.google.android.exoplayer:extension-okhttp:2.10.4'
implementation('com.google.firebase:firebase-analytics:18.0.2') {
exclude group: 'androidx'
}
implementation('com.google.firebase:firebase-core:18.0.2') {
exclude group: 'androidx'
}
implementation('com.google.firebase:firebase-perf:19.1.1') {
exclude group: 'androidx'
}
implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'
implementation 'tech.schoolhelper:moxy-x:1.7.0'
annotationProcessor 'tech.schoolhelper:moxy-x-compiler:1.7.0'
implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'
implementation 'tech.schoolhelper:moxy-x-material:1.7.0'
implementation 'com.android.support:preference-v7:30.0.0'
implementation 'pub.devrel:easypermissions:0.2.0'
implementation 'com.github.codekidX:storage-chooser:2.0.4.4'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.firebase:firebase-ads:19.7.0'
implementation('com.android.billingclient:billing:3.0.2') {
exclude group: 'androidx'
}
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.6'
implementation 'com.alimuzaffar.lib:pinentryedittext:2.0.6'
implementation 'com.mindorks.android:prdownloader:0.6.0'
implementation('com.stepstone.apprating:app-rating:2.3.1') {
exclude group: 'androidx'
}
implementation 'com.diogobernardino:williamchart:2.2'
implementation 'com.h6ah4i.android.widget.verticalseekbar:verticalseekbar:1.0.0'
implementation('com.google.firebase:firebase-inappmessaging-display:19.1.5') {
exclude group: 'androidx'
}
implementation 'com.google.android.exoplayer:exoplayer:2.10.4'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
implementation 'it.xabaras.android:recyclerview-swipedecorator:1.2.3'
This is a known problem https://github.com/firebase/firebase-android-sdk/issues/2642
Possible workaround
implementation('com.google.firebase:firebase-inappmessaging-display:19.1.5', {
exclude group: 'io.grpc', module: 'grpc-okhttp'
})
implementation 'io.grpc:grpc-okhttp:1.32.2'
Related
Trying to use ImagePicker from Jitpack however it won't import into my code even after following the adding dependency steps.
settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
}
}
rootProject.name = "Flower Identifier v1"
include ':app'
build.gradle
dependencies {
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.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'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.jkwiecien:EasyImage:Tag'
implementation 'com.github.Dhaval2404:ImagePicker:Tag'
}
ImagePicker not being imported correctly:
Also tried removing the repos from settings.gradle and adding it to build.gradle like this:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
but still having the same issue
Firs of all you need to declare version of this library. Change
implementation 'com.github.jkwiecien:EasyImage:Tag'
implementation 'com.github.Dhaval2404:ImagePicker:Tag'
to specified version tag like implementation 'com.github.dhaval2404:imagepicker:2.1'.
Then you could delete
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
form build.gradle.
I am getting this error multiple times in all my Jetpack compose projects. Is this error an issue related to the Gradle? Because I have not changed anything to the Theme.
java.lang.NoSuchFieldError: No field Companion of type Landroidx/compose/runtime/SlotTable$Companion; in class Landroidx/compose/runtime/SlotTable; or its superclasses (declaration of 'androidx.compose.runtime.SlotTable' appears in /data/app/~~-cK_xmGsJokhf6B_7aQseg==/com.swetajain.library-CN37OSea3A4uAWXYCBb63w==/base.apk)
app.build.gradle
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.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.ui:ui-tooling:$compose_version"
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "com.google.android.material:compose-theme-adapter:$compose_version"
api 'com.github.bumptech.glide:glide:4.11.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-beta01'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-beta01#aar'
implementation 'androidx.activity:activity-ktx:1.2.0-beta01#aar'
implementation "dev.chrisbanes.accompanist:accompanist-coil:0.3.3.1"
def nav_compose_version = "1.0.0-alpha02"
implementation "androidx.navigation:navigation-compose:$nav_compose_version"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
build.gradle -Project
buildscript {
ext.compose_version = '1.0.0-alpha04'
ext.kotlin_version = "1.4.20"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.0-alpha16"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Try to update your compose version to the latest if you see such error.
java.lang.NoSuchFieldError: No field Companion of type Landroidx/compose/foundation/layout/BoxScope$Companion;
If you use binding and change component from XML for example if you add Button after that changed to EditText It will through that exception. Just you need to do rebuild.
Just trying out micronaut with Spring capability, and can't get access to my /actuator endpoints Spring Boot v2.3.0 release and micronaut 2.0.0.M3
I created a basic micronaut project using the mn create-app xxx --lang groovy.
I have then added the spring dependencies and micronaut-spring and associated annotation processors.
My build.gradle now looks as follows
plugins {
id "groovy"
id "com.github.johnrengelman.shadow" version "5.2.0"
id "application"
id "net.ltgt.apt" version "0.21" //enables annotation preproccessing support
id "net.ltgt.apt-idea" version "0.21"
id "org.springframework.boot" version "2.3.0.RELEASE"
id "io.spring.dependency-management" version "1.0.9.RELEASE"
}
ext['groovy.version'] = '3.0.4'
version "0.1"
group "com.softwood"
repositories {
mavenCentral()
maven { url "https://jcenter.bintray.com" }
}
configurations {
// for dependencies that are needed for development only
developmentOnly
}
dependencies {
//annotation processors
annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
annotationProcessor "io.micronaut.spring:micronaut-spring-boot-annotation"
annotationProcessor "io.micronaut.spring:micronaut-spring-web-annotation"
testAnnotationProcessor "io.micronaut.spring:micronaut-spring-web-annotation:2.0.1"
//latest groovy v3
implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '3.0.4' //, ext: 'pom'
//spring
compileOnly "io.micronaut.spring:micronaut-spring-annotation:2.0.1"
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation group: 'io.micronaut.spring', name: 'micronaut-spring-web', version: '2.0.1'
runtime ("io.micronaut.spring:micronaut-spring-boot:2.0.1")
compileOnly platform("io.micronaut:micronaut-bom:$micronautVersion")
compileOnly "io.micronaut:micronaut-inject-groovy"
implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
implementation "io.micronaut:micronaut-runtime-groovy"
implementation "io.micronaut:micronaut-validation"
implementation "javax.annotation:javax.annotation-api"
implementation "io.micronaut:micronaut-http-server-netty"
implementation "io.micronaut:micronaut-http-client"
runtimeOnly "ch.qos.logback:logback-classic:1.2.3"
testCompileOnly platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation("org.spockframework:spock-core:2.0-M2-groovy-3.0") {
exclude group: "org.codehaus.groovy", module: "groovy-all"
}
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut.test:micronaut-test-spock"
testImplementation "io.micronaut.test:micronaut-test-junit5"
}
test.classpath += configurations.developmentOnly
mainClassName = "com.softwood.Application"
//added - enable incremetal compile feature - can't enable with annotation processors !
/*tasks.withType(GroovyCompile).configureEach {
options.incremental = true
}*/
tasks.withType(GroovyCompile) {
groovyOptions.forkOptions.jvmArgs.add('-Dgroovy.parameters=true')
}
shadowJar {
mergeServiceFiles()
}
tasks.withType(JavaExec) {
classpath += configurations.developmentOnly
jvmArgs('-noverify', '-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
}
I have adjusted a HelloController as follows
import io.micronaut.http.annotation.Controller
import io.micronaut.http.annotation.Get
import io.micronaut.http.HttpStatus
import org.springframework.boot.actuate.endpoint.annotation.Endpoint
#Controller("/hello")
#Endpoint
class HelloController {
#Get("/")
String index() {
return 'hello william'
}
}
and marked the Application class as being a SpringbootApplication - but call the Micronaut.run() to build the MN context etc
import io.micronaut.runtime.Micronaut
import groovy.transform.CompileStatic
import org.springframework.boot.autoconfigure.SpringBootApplication
#CompileStatic
#SpringBootApplication
class Application {
static void main(String[] args) {
Micronaut.run(Application)
}
}
I tried to adjust application.yml to expose all the endpoints as follows
micronaut:
application:
name: micronaut-std-app
management:
endpoints:
web:
exposure:
include=*:
This all compiles ok, and runs ok. if you invoke the localhost:8080/hello you get the expected string
if you try and access the actuator endpoints - nothing is being generated, and the browser displays
{"message":"Page Not Found","_links":{"self":{"href":"/actuator/health","templated":false}}}
if your trying to do a mixed micronaut and spring project, then how do you get any actuator endpoints enabled for your MN pre processed controllers etc ?
If you just want a health check endpoint, Micronaut have build in health check endpoint available.
Add in the build.gradle the fallowing dependence to add the endpoints like health:
implementation("io.micronaut:micronaut-management")
You can add in the application.yml
endpoints:
health:
enabled: true
Then change the health check url to "/health"
After adding:
implementation (group: 'ir.databeen.sdk', name: 'databeenlib', version: '1.0.2', ext: 'aar')
I have this error when I want to generate my app:
More than one file was found with OS independent path
'okhttp3/internal/publicsuffix/publicsuffixes.gz'
Here are my Gradle dependencies:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.cedarmaps:CedarMapsSDK:3.1.2'
implementation 'co.ronash.android:pushe-base:1.4.1'
implementation 'ir.tapsell.sdk:tapsell-sdk-android:4.0.3'
implementation 'com.android.support:percent:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
implementation (group: 'ir.databeen.sdk', name: 'databeenlib', version: '1.0.2', ext: 'aar')
implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
testImplementation 'junit:junit:4.12'}
I tried to use:
implementation (group: 'ir.databeen.sdk', name: 'databeenlib', version: '1.0.2', ext: 'aar'){
exclude group: 'com.squareup.okio'
exclude group:'com.squareup.okhttp'
}
but the error still persists.
i got the warning msg while sync my app to firebase.
the warning msg is =>"Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. " i don't know how to correct it .someone help me how to clear this error
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.selvakumar.firebase"
minSdkVersion 15
targetSdkVersion 28
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:28.0.0-rc01'//i got error in this line
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'
compile 'com.google.firebase:firebase-core:16.0.0'
}
apply plugin: 'com.google.gms.google-services'
compile is deprecated from android studio 3.1 use implementation before all of libraries
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-beta01'
implementation 'com.android.support:recyclerview-v7:28.0.0-beta01'
implementation 'com.android.support:cardview-v7:28.0.0-beta01'
implementation 'com.android.support:support-v4:28.0.0-beta01'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.blankj:utilcode:1.12.5'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.google.firebase:firebase-crash:11.4.2'
implementation 'com.google.firebase:firebase-core:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
implementation 'com.google.firebase:firebase-perf:11.4.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.dagger:dagger:2.13'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.github.pchmn:MaterialChipsInput:1.0.8'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.daimajia.easing:library:2.0#aar'
implementation 'com.daimajia.androidanimations:library:2.3#aar'
implementation 'com.github.jkwiecien:EasyImage:2.0.4'
implementation 'com.droidninja:filepicker:2.1.5'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.airbnb.android:lottie:2.2.5'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.github.mrengineer13:snackbar:1.2.0'
implementation 'agency.tango.android:material-intro-screen:0.0.5'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.3#aar') { transitive = true }
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.github.sharish:ShimmerRecyclerView:v1.2'
implementation 'com.github.samanzamani.persiandate:PersianDate:0.3'
implementation 'com.stephentuso:welcome:1.4.1'
implementation 'com.yanzhenjie:permission:2.0.0-rc6'
implementation 'com.github.skydoves:powermenu:2.0.4'
implementation 'com.android.support:multidex:1.0.3'
implementation 'lib.kingja.switchbutton:switchbutton:1.1.7'
implementation 'com.github.pinball83:masked-edittext:1.0.4'