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.
Related
I'm trying to use chaquopy in android studio to recognize audio from video and convert it to text, but when I call Python.getInstance() it overlines it in red. what can be the problem ?.
build.gradle(app)
plugins {
id 'com.google.gms.google-services'
//for chaquopy(python)
id 'com.android.application'
id 'com.chaquo.python'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.talhakara.uzaktanegitimbitirmeprojesi"
minSdk 16
targetSdk 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// for chaquopy(python)
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
python {
buildPython "C:/Users/enest/AppData/Local/Programs/Python/Python39/python.exe"
}
sourceSets {
main {
python.srcDir "src/main/python"
}
}
//
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
dataBinding true
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'com.google.android.gms:play-services-tasks:17.2.1'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:29.0.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-core:20.1.0'
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
implementation 'com.google.firebase:firebase-invites:17.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.google.firebase:firebase-firestore:24.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation ('org.jitsi.react:jitsi-meet-sdk:2.9.0') { transitive = true }
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.drawerlayout:drawerlayout:1.1.1"
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
}
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
//chaquopy
maven { url "https://chaquo.com/maven" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.google.gms:google-services:4.3.10'
//chaquopy
classpath "com.chaquo.python:gradle:10.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
my activity
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityVideoConferenceBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);
//start python
if (! Python.isStarted()) {
Python.start(new AndroidPlatform(VideoConference.this));
}
Python py = new Python.getInstance(); // this line is red and
//it doesn't show any errors
binding.btnChooseVideo.setOnClickListener(view1 -> {
callChooseFromVideo();
});
}
error message
error: cannot find symbol
Python py = new Python.getInstance();
symbol: class getInstance
location: class Python
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details
Could it be a problem with gradle versions? because my gradle version 7.0.4 is showing 7.0 as the latest in chaquopy's docs. can it cause this problem and I am using 10.0.1 as the chaquopy version because android studio recommended it as the latest version. If these are a problem, which versions should I use?
The correct syntax is just Python.getInstance(), not new Python.getInstance().
Hello i am trying export old project in my. android studio version Android Studio 4.2.1
Build #AI-202.7660.26.42.7351085, built on May 10, 2021
when i try compiling my code i am getting this error any one know how fixed this issue
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not create task ':app:minifyReleaseWithR8'.
Cannot query the value of this provider because it has no value available
i already tried this solution but not working Could not create task ':app:minifyReleaseWithR8'. Cannot query the value of this provider because it has no value available
here is my build.gradle file
buildscript {
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/' }
}
}
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin'
id 'com.android.application'
id 'com.google.gms.google-services'
}
repositories {
maven {
url "https://maven.google.com"
}
}
android {
compileSdkVersion 30
buildToolsVersion '31.0.0-rc3'
defaultConfig {
applicationId "com.example.status"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
}
task wrapper(type: Wrapper) {
gradleVersion = '6.7.1'
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
buildTypes.each {
it.buildConfigField 'String', 'My_api', app_url
}
lintOptions {
disable 'MissingTranslation'
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.4.0-alpha03'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.7.2'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.google.android.exoplayer:exoplayer:2.15.0'
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
implementation 'com.google.android.gms:play-services-ads:20.2.0'
implementation 'com.google.android.gms:play-services-auth:19.2.0'
implementation 'com.google.android.ads.consent:consent-library:1.0.8'
implementation 'com.onesignal:OneSignal:4.4.0#aar'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'io.github.lizhangqu:coreprogress:1.0.2'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'com.chaos.view:pinview:1.4.2'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.MasayukiSuda:Mp4Composer-android:v0.4.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'com.facebook.android:facebook-login:5.15.3'
implementation 'com.facebook.android:audience-network-sdk:6.5.1'
implementation 'com.google.ads.mediation:facebook:6.5.1.1'
implementation 'com.github.duanhong169:colorpicker:1.1.6'
implementation "com.hootsuite.android:nachos:1.2.0"
implementation 'com.romandanylyk:pageindicatorview:1.0.3'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'org.jetbrains:annotations:16.0.1'
implementation project(path: ':Wheel')
implementation project(path: ':SmoothCheckBox-master')
implementation project(path: ':IRBottomNavigationLib')
}
I have a depeendency error like
Duplicate class okhttp3.internal.ws.RealWebSocket found in modules jetified-okhttp-3.12.0 (com.squareup.okhttp3:okhttp:3.12.0) and jetified-okhttp-ws-3.4.1 (com.squareup.okhttp3:okhttp-ws:3.4.1)
I'm using WebSocket and LoggingInterceptor and implemented both dependencies,
My build.gradle below
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.mrrights.harvestoperator"
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'
aaptOptions { cruncherEnabled = false }
signingConfig signingConfigs.release
multiDexEnabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
//kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
//ui
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.work:work-runtime:2.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.2'
implementation "androidx.cardview:cardview:1.0.0"
//google map & location
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
implementation 'com.google.android.libraries.places:places:2.4.0'
implementation 'com.google.maps.android:maps-utils-ktx:2.2.0'
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.1.0')
// Firebase Messaging Service
implementation 'com.google.firebase:firebase-messaging-ktx'
// Firebase Analytics for Logs in server side
implementation 'com.google.firebase:firebase-analytics-ktx'
// Firebase Authentication
implementation 'com.google.firebase:firebase-auth-ktx'
// FirebaseUI (for authentication)
implementation 'com.firebaseui:firebase-ui-auth:6.2.0'
//firebase firestore
implementation 'com.google.firebase:firebase-firestore-ktx'
//firebase storage
implementation 'com.google.firebase:firebase-storage-ktx'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:7.1.1'
implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'
implementation 'com.google.firebase:firebase-analytics:18.0.2'
implementation 'com.android.support:cardview-v7:28.0.0'
//Testing
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//image view with URl
implementation 'com.squareup.picasso:picasso:2.71828'
//coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
//steps view
implementation 'com.shuhart.stepview:stepview:1.5.1'
//datePicker
implementation 'com.vivekkaushik.datepicker:datePickerTimeline:0.0.4'
//Retrofit, Interceptor, Json to Gson converter
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1'
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.4.1"
implementation 'com.squareup.retrofit2:converter-jackson:2.1.0'
// PhilJay MPAndroidChart
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
//PhotoView
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
annotationProcessor 'androidx.annotation:annotation:1.1.0'
//Circle Image View
implementation 'de.hdodenhof:circleimageview:3.1.0'
}
help me to resolve the issue,
Thank You !
You must use a single consistent version of all com.squareup.okhttp3 dependencies. Upgrade to 3.12.13
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.12.13"
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.12.13"
java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[...]
Suppressed: java.io.IOException: Failed to open dex files from /....==/base.apk because: Bad encoded_array value: Failure to verify dex file '.....==/base.apk': Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.abstractnewsdigest-gHpWdk3tBZsBeX9bz-UJ-w==/base.apk because: Bad encoded_array value: Failure to verify dex file '/data/app/com.abstractnewsdigest-gHpWdk3tBZsBeX9bz-UJ-w==/base.apk': Bad encoded_value method type size 7
Project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "io.realm:realm-gradle-plugin:5.13.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App build.gradle:
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "kotlin-kapt"
apply plugin: "realm-android"
android {
compileSdkVersion 29
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'com.abstractnewsdigest'
minSdkVersion 16
targetSdkVersion 29
versionCode 13
versionName "13"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
debug {
//Properties stored in ~/.gradle/gradle.properties
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
dataBinding.enabled = true
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
productFlavors {
}
}
repositories {
google()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
}
dependencies {
// Place to find the latest available version of support libraries hosted by Google
// https://dl.google.com/dl/android/maven2/index.html
def androidSupportVersion = "28.0.0"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.firebaseui:firebase-ui-database:4.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android:flexbox:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'androidx.browser:browser:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// kapt "com.android.databinding:compiler:3.1.3"
implementation 'com.github.pardom:redux-kotlin:1.2.1'
// Litho
def lithoVersion = "0.18.0"
implementation "com.facebook.litho:litho-core:$lithoVersion"
implementation "com.facebook.litho:litho-widget:$lithoVersion"
compileOnly "com.facebook.litho:litho-annotations:$lithoVersion"
kapt "com.facebook.litho:litho-annotations:$lithoVersion"
kapt "com.facebook.litho:litho-processor:$lithoVersion"
// SoLoader
implementation 'com.facebook.soloader:soloader:0.5.1'
// For integration with Fresco
implementation 'com.facebook.fresco:fresco:1.10.0'
implementation "com.facebook.litho:litho-fresco:$lithoVersion"
// For testing
testImplementation "com.facebook.litho:litho-testing:$lithoVersion"
// Sections
implementation "com.facebook.litho:litho-sections-core:$lithoVersion"
implementation "com.facebook.litho:litho-sections-widget:$lithoVersion"
compileOnly "com.facebook.litho:litho-sections-annotations:$lithoVersion"
kapt "com.facebook.litho:litho-sections-annotations:$lithoVersion"
kapt "com.facebook.litho:litho-sections-processor:$lithoVersion"
def lifecycle_version = "1.1.1"
// ViewModel and LiveData
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
kapt 'androidx.lifecycle:lifecycle-compiler:2.0.0'
implementation 'com.android.billingclient:billing:1.1'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
def work_version = "1.0.0-alpha10"
implementation ('androidx.work:work-runtime-ktx:2.0.1') {
exclude group: 'com.google.guava', module: 'listenablefuture'
exclude group: 'androidx.work'
}
// use -ktx for Kotlin
implementation ("android.arch.work:work-firebase:$work_version") {
exclude group: 'com.google.guava', module: 'listenablefuture'
}
implementation 'io.branch.sdk.android:library:2.+'
implementation 'joda-time:joda-time:2.10'
// implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
implementation 'com.google.gms:google-services:4.3.3'
}
apply plugin: 'com.google.gms.google-services'
It will be late but maybe someone needs to know it.
You should add compileOptions { targetCompatibility JavaVersion.VERSION_1_8 }
in your build:gradle(:app) under the android section.Then scyn it. It works for me !
This question already has answers here:
Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]
(4 answers)
Closed 4 years ago.
When I'm creating an APK I get such an error:
Caused by: java.lang.RuntimeException: java.io.IOException: Can't write [C:\Users\Smokie\Desktop\datemeet\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\Smokie\Desktop\datemeet\app\build\intermediates\transforms\desugar\debug\241.jar(;;;;;;**.class)] (Duplicate zip entry [241.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]))
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
my build.gradle file :
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
buildscript {
repositories {
maven { url "https://github.com/omadahealth/omada-nexus/raw/master/release" }
maven { url "https://jitpack.io" }
}
dependencies {
}
}
android {
signingConfigs {
config {
}
}
lintOptions {
abortOnError false
}
dataBinding {
enabled = true
}
compileSdkVersion 27
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.oxyn.datemeet"
minSdkVersion 17
targetSdkVersion 27
versionCode 5
versionName "1.0"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
ext.enableCrashlytics = true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
ext.enableCrashlytics = true
proguardFiles 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/**'
exclude 'META-INF/**'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral()
jcenter()
}
android {
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// Navigation Drawer Library
compile('com.mikepenz:materialdrawer:5.3.0#aar') {
transitive = true
}
//Google, Inc (Play services) Libraries
implementation 'com.google.android.gms:play-services-places:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-config:11.8.0'
implementation 'com.google.firebase:firebase-appindexing:11.8.0'
implementation 'com.google.android.gms:play-services-appinvite:11.8.0'
//Google, Inc (Firebase) Libraries
implementation 'com.firebase:firebase-jobdispatcher:0.6.0'
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.firebase:geofire-android:2.1.2'
// Google, Inc (Support) Libraries
implementation 'com.android.support:support-v13:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.android.support:palette-v7:27.0.2'
implementation 'com.android.support:support-vector-drawable:27.0.2'
// Facebook, Inc SDKs
implementation 'com.facebook.android:facebook-android-sdk:4.29.0'
// Libraries for images
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.lorentzos.swipecards:library:1.0.9'
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
implementation 'com.vanniktech:emoji-twitter:0.5.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.github.yalantis:ucrop:2.2.1'
implementation 'com.github.jkwiecien:EasyImage:1.3.1'
implementation 'jp.wasabeef:picasso-transformations:2.1.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
// Location Helper Library
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
// Time library
implementation 'joda-time:joda-time:2.9.9'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.flipboard:bottomsheet-core:1.5.3'
implementation 'com.flipboard:bottomsheet-commons:1.5.3'
implementation 'com.greysonparrelli.permiso:permiso:0.3.0'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.5.2'
implementation 'com.airbnb.android:lottie:2.2.5'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'
I'm using Android Studio 3.1
when I updated the libraries: import static com.google.android.gms.internal.zzahn.runOnUiThread; the code is failing.
implementation 'com.android.support:support-v13:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:palette-v7:27.1.0'
implementation 'com.android.support:support-vector-drawable:27.1.0'
error: cannot find symbol static runOnUiThread
I Changed Android Studio Version 2.3.3. Now Perfectly works.
You might have the jar in your libs folder. Please check, if it is there, then remove it ,and clean and build it again.
I have same Error in recent Days i solved to changing the support library version
implementation 'com.android.support:support-v13:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:palette-v7:27.1.0'
implementation 'com.android.support:support-vector-drawable:27.1.0'