Proguard fails to read android.jar - android

I just enable Proguard ( minifyEnabled true ) ... and when I try to build singed apk I get error :
Cause: invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b)
Exception while processing task java.io.IOException: Can't read [D:\AndroidStudio\AndroidStudioSDK\sdk\platforms\android-27\android.jar] (invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b))
my Gradle.app is :
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.test.app"
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "*****-****-****-****-***********",
onesignal_google_project_number: "REMOTE"]
minSdkVersion 19
targetSdkVersion 27
versionCode 8
versionName "1.8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes.each {
it.buildConfigField 'String', 'SERVER_URL', serverUrl
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//ANDROID API
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
//Google API
implementation 'com.google.android.gms:play-services-ads:17.1.2'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-cast-framework:16.1.2'
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
//Google Exo Player
implementation 'com.google.android.exoplayer:exoplayer:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.9.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.4'
//Google Firebase Api
implementation 'com.google.firebase:firebase-core:16.0.6'
//Other Libraries
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.github.ornolfr:rating-view:0.1.2#aar'
implementation 'cn.gavinliu.android.lib:ShapedImageView:0.8.4'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.mobsandgeeks:android-saripaar:2.0.2'
implementation 'com.github.ixiDev:GDPRChecker:v0.2'
implementation 'com.github.halilozercan:BetterVideoPlayer:1.1.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
//OneSignal
implementation 'com.onesignal:OneSignal:3.9.1#aar'
//You Api
implementation files('libs/YouTubeAndroidPlayerApi.jar')
//Test Api
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'
}
apply plugin: 'com.google.gms.google-services'
So I don't change anything just minifyEnabled from false to true and I get the error.

invalid entry CRC (expected 0x9aa3fedc but got 0xfeb7201b) means the file is corrupted.
you'd have to uninstall and reinstall API level 27 with the SDK manager, to get around that.
and probably consider getting a new drive - or at least check the integrity eg. with hddscan.

Related

Migration of app from target sdk 28 to 30 giving library error

I am migrating my application from target sdk 28 to 30 because to upload it on playstore its required but its giving library error for all the libraries.
Below is app level build file with all the required libraries.
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.devakya.kinderstudyzone"
manifestPlaceholders = [onesignal_app_id: "38d403ad-a92d-487f-afa2-c9b1a8c2907d",
onesignal_google_project_number: "REMOTE"]
minSdkVersion 17
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true // <------
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes.each {
it.buildConfigField 'String', 'server_url', server_url
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
// androidTestImplementation 'com.android.support.test:runner:1.0.0'
androidTestImplementation 'androidx.test:runner:1.4.1-alpha03'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0-alpha03'
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//implementation 'com.android.support:customtabs:30.0.0'
implementation 'androidx.browser:browser:1.4.0'
//implementation 'com.android.support:support-v4:30.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//implementation 'com.android.support:exifinterface:30.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
// implementation 'com.android.support:support-media-compat:30.0.0'
implementation "androidx.media:media:1.4.3"
// implementation 'com.android.support:recyclerview-v7:30.0.0'
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.recyclerview:recyclerview-selection:1.1.0"
//implementation 'com.android.support:cardview-v7:30.0.0'
implementation "androidx.cardview:cardview:1.0.0"
// implementation 'com.android.support:design:30.0.0'//appcompact
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.android.gms:play-services-ads:17.2.1'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.onesignal:OneSignal:3.10.8#aar'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.github.siyamed:android-shape-imageview:0.9.3#aar'
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.mobsandgeeks:android-saripaar:2.0.2'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation project(':bettervideoplayer')
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.firebase:firebase-analytics:16.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.mjn1369:prettydialog:1.0.4'
implementation project(path: ':SmoothCheckBox-master')
implementation 'com.github.bosphere.android-fadingedgelayout:fadingedgelayout:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'
How I resolve this error for libraries .which library version I change for it.
I am getting version crashes issue for aome libraires but I am unable to resolve it.

firebase phoneauth- returned Gms: com.google.firebase.auth.api.internal.zzal#830b094

As I said in the title it used to work fine but suddenly it doesn't anymore, I'm not getting any errors in 'Run' so I really can't locate where the probleme is
here is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.nearmessenger"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
allprojects {
repositories {
jcenter()
maven { url "https://dl.bintray.com/hani-momanii/maven" }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-emoji-appcompat:28.0.0'
implementation 'com.android.support:support-emoji-bundled:28.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.android.material:material:1.1.0-alpha03'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation 'com.firebaseui:firebase-ui-database:4.3.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
as well as I'm getting this feedback when i click on the send code button in 'RUN':
W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal#830b094

Can´t implement firebase-ui-auth

The library com.google.android.gms:play-services-basement is being
requested by various other libraries at [[15.0.1,15.0.1]], but
resolves to 16.0.1. Disable the plugin and check your dependencies
tree using ./gradlew :app:dependencies
I´ve got this error and can´t solve it. I tried everything I found, but nothing worked. Do you have an idea.
I wanted to implement implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.alexa.oneline"
minSdkVersion 15
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
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'
//LifeData
implementation 'android.arch.lifecycle:extensions:1.1.1'
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
//room db
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
//Firebase
implementation 'com.google.firebase:firebase-core:17.3.2'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
}
apply plugin: 'com.google.gms.google-services'
firebase-core latest version is: 16.0.4 but the Firestore version seems to be all good.
So, change your dependencies to:
//Firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
Then add;
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Right after:
apply plugin: 'com.google.gms.google-services'
In your build.gradle.

App crashes after upgrading dependencies to latest version in android

I am getting following error after upgrading my project to the latest dependencies
Didn't find class "com.google.android.gms.common.util.zzq" on
path: DexPathList[[zip
file "/system/framework/org.apache.http.legacy.boot.jar",
zip file "/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/lib/x86,
/system/lib]]"
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.example"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled true
}
// buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:cardview-v7:27.1.1'
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:multidex:1.0.3'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.facebook.android:facebook-android-sdk:4.32.0'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
/*map place autosuggest*/
//for calendar class
implementation 'joda-time:joda-time:2.9.9'
implementation 'de.hdodenhof:circleimageview:2.2.0'
//QB dependecies
implementation 'com.quickblox:quickblox-android-sdk-core:3.8.1'
implementation('com.quickblox:quickblox-android-sdk-chat:3.8.0') {
transitive = true
}
implementation 'com.quickblox:chat-message-adapter:2.0'
implementation 'com.quickblox:quickblox-android-sdk-content:3.8.0'
implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.2#aar'
implementation 'com.github.orangegangsters:swipy:1.2.3#aar'
implementation project(':sample-core')
// implementation 'com.jwang123.flagkit:flagkit:1.0'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
//GoogleServicesPlugin.config.disableVersionCheck = true
Can anyone guide me how to solve this issue.
I have been searching stackoverflow from last two days for the solution of this issue. Please help.
Ensure that your top-level build.gradle contains a reference to the google() repo or to maven { url "https://maven.google.com" }.
remove this from your build.gradle file and sync again
apply plugin: 'com.google.gms.google-services'

i want to connect with Firebase but i have an error

I want to connect with Firebase but I have an error: "could not parse the android application modules gradle config.resolve gradle build issues and/or resync." and i check my gradle . if i sync gradle i have a warning "WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'."
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "dxd.zzz.axy"
minSdkVersion 15
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
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
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.mohamadamin:persianmaterialdatetimepicker:1.2.1'
implementation 'com.android.support:mediarouter-v7:26.1.0'
implementation files('libs/sqliteassethelper-2.0.1.jar')
}
apply plugin: 'com.google.gms.google-services'
You should write latest version of gms service in app level gradle
Please see the below image
First of all make sure you are using latest google services version (Project Level):
classpath 'com.google.gms:google-services:4.0.1'
Then change your code, you should also add firebase-core like below.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "dxd.zzz.axy"
minSdkVersion 15
targetSdkVersion 26
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
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
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.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:26.1.0'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.mohamadamin:persianmaterialdatetimepicker:1.2.1'
implementation 'com.android.support:mediarouter-v7:26.1.0'
implementation files('libs/sqliteassethelper-2.0.1.jar')
}
apply plugin: 'com.google.gms.google-services'
Moreover, if you want to use other firebase libraries right now please keep up to the latest version like below and always take a look in this link to be sure that you using the latest version.
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-analytics:16.0.0'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.1'
implementation 'com.google.firebase:firebase-functions:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.0'
implementation 'com.google.firebase:firebase-invites:16.0.0'
implementation 'com.google.firebase:firebase-perf:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-config:16.0.0'
Don't worry about that warning. If it builds successfully then no problem at all.
Please use the latest library for firebase
implementation 'com.google.firebase:firebase-messaging:15.0.0'
And make sure you have to add firebase config file form consol to your project.

Categories

Resources