Till yesterday everything was working fine but today i have updated my Android studio from 2.3 to 3.1 and i am getting this error now. But even i am getting Cannot resolve symbol CalligraphyContextWrapper, still project is successfully clean and build and the font is changing fine. I am surprised if everything is working fine then why this error appears. You can see the error in image and also i am adding my gradle code below. Please let me know if i am doing something wrong.
build.grade:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.package"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
}
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.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.0.0'
implementation 'com.android.support:cardview-v7:27.0.0'
/* Retrofit */
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.squareup.okhttp3:okhttp:3.4.2'
//multi dex
implementation 'com.android.support:multidex:1.0.1'
//Picasso
implementation 'com.squareup.picasso:picasso:2.5.2'
//Buimplementationtter knife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
//planet payment gateway
implementation 'com.google.android.gms:play-services-wallet:11.0.4'
//font
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'io.card:android-sdk:5.5.1'
}
I have also raised the issue in github but there is no response from Calligraphy team.
https://github.com/chrisjenx/Calligraphy/issues/449#issuecomment-386390551
Any help or clue will be appreciated.
You can Downgrade version. Use 2.2.0 instead of 2.3.0.
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
Then Clean-Rebuild-Run.
I am not sure if it is related but I've resolved a similar issue by doing the following;
Remove the dependency from gradle build file
Sync the gradle file
Put the same dependency and sync it again.
Related
I am trying to add CardView and RecyclerView dependencies in my Android Studio Project for SDK version 28. Upon building the project, I get the message, "Gradle Project Sync Failed. Basic Functionality will not work properly".
build.gradle(Module:app) file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.kavyabarnadhyahazarika.quarterallotmentiocl"
minSdkVersion 16
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'
}
}
buildToolsVersion '28.0.0'
}
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.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
testImplementation 'junit:junit:4.12'
}
Error Messages:
Failed to resolve: com.android.support:cardview-v7:28.0.0
Failed to resolve: com.android.support:recyclerview-v7:28.0.0
I have tried both build and clean project.
Also if these dependencies are not supported on SDK version 28, how do I resolve the issue?
There is no 28.0.0 final release as of yet - just like your appcompat-v7 dependency, cardview-v7 and recyclerview-v7 should have a version of 28.0.0-alpha3:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:cardview-v7:28.0.0-alpha3'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha3'
This works for me.
// RecyclerView
implementation 'com.android.support:recyclerview-v7:+'
// CardView
implementation 'com.android.support:cardview-v7:+'
Here's a working solution.
replace the following dependencies
implementation 'com.android.support:cardview-v7:28.0.0-alpha3'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha3'
or
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
with the below implementations
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
I hope it helps.
After updating my android studio and build tool version get this error.I have tried all the solution available for this problem over internet , but not successful
don't know why this is happening ??
Android studio version: 3.1
Gradle version": 4.4
Gradle plugin : 3.1
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
My build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.abc.abc"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true //Tryed this but not worked
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
maven {
url 'https://github.com/jitsi/jitsi-maven-repository/raw/master/releases'
}
// maven { url "https://dl.bintray.com/michelelacorte/maven/" }
mavenCentral()
}
configurations {
all*.exclude module: 'support-v4'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
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.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:support-fragment:27.1.0'
// multipart entity
implementation('org.apache.httpcomponents:httpmime:4.+') {
exclude module: "httpclient"
}
implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
// implementation 'com.wonderkiln:camerakit:0.13.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'org.jitsi.react:jitsi-meet-sdk:1.9.0'
// compile 'com.google.code.gson:gson:2.2.4'
// compile 'com.android.support:support-emoji:26.0.1'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'com.yalantis:ucrop:2.2.0-native'
implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'org.igniterealtime.smack:smack-android-extensions:4.2.0'
implementation 'org.igniterealtime.smack:smack-experimental:4.2.0'
implementation 'org.igniterealtime.smack:smack-tcp:4.2.0'
implementation 'org.apache.commons:commons-lang3:3.4'
implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
implementation 'com.googlecode.libphonenumber:libphonenumber:7.0.4'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.google.android.gms:play-services-places:11.8.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
implementation 'com.eyalbira.loadingdots:loading-dots:1.0.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
// implementation 'com.google.android.exoplayer:exoplayer:2.7.1'
// compile 'it.michelelacorte.swipeablecard:library:2.3.0#aar'{
// exclude module: 'appcompat-v7'
// exclude group: 'com.android.support'
// }
// BUTTER KNIFE
implementation('com.jakewharton:butterknife:8.5.1') {
exclude module: 'appcompat-v7'
exclude group: 'com.android.support'
}
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
// implementation project(':libemoji')
implementation 'com.android.support:support-v13:27.1.0'
}
It's waste almost my 10 days...
most confusing error ever encounter..
This error happens if your code has two different modules of google-play-services or support-v4 which are using different versions of these libraries.
Check the dependencies of the libraries you are using in your project or use
gradle app:dependencies
to see dependency tree of your project and then when you find out which libraries is used with different version, add it to your dependencies with correct version. For example if google-play-services:location:11.2.0 appeared in your dependencies, replace it with google-play-services:location:11.8.0
Usually you will see a warning or error message in your build.gradle file (i.e. one dependency will be marked with red underline showing it cause version mismatch) in such cases.
In my case, project and module's package name is same. When running in debug mode, everything is okey. But when i want to build release mode. I got this error. Renaming package name is the solution for me.
I am running gcm web server, but it has over gcm version (previous firebase)
so, referenced older project and use that project's gcm dependency.
I saw this issue: GCM unregister causing the application to crash
but it doesn't work for me.
my gradle setting below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
defaultConfig {
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation project(path: ':permissionchecker')
implementation project(path: ':datastateview')
implementation 'com.android.support:appcompat-v7:25.1.0'
implementation 'com.android.support:support-vector-drawable:25.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:converter-scalars:+'
implementation 'com.squareup.retrofit2:converter-gson:+'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.android.support:design:25+'
implementation 'com.android.support:support-v4:25+'
implementation 'com.android.support:recyclerview-v7:25+'
implementation 'br.com.simplepass:loading-button-android:+'
implementation 'com.googlecode.android-query:android-query:0.25.9'
implementation 'org.altbeacon:android-beacon-library:2.+'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
and root build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
I tried to many version of, but I met many exception.
like
java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in base.apk)
or
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
and any others.
This is because there is duplicated dependencies. You must not use inexact version of library by using +. You should not use this:
implementation 'com.android.support:design:25+'
because it means that you want to get the latest version of support library 25. So, it will be the same as:
implementation 'com.android.support:design:25.4.0'
support design is implicity using appcompat-v7 and support-v4. So, the above code is the same as:
implementation 'com.android.support:design:25.4.0'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:support-v4:25.4.0'
In the end, your support library dependencies will be:
implementation 'com.android.support:appcompat-v7:25.1.0'
implementation 'com.android.support:support-vector-drawable:25.1.0'
implementation 'com.android.support:design:25.4.0'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:support-v4:25.4.0'
which is obviously duplicated.
You need to check if you have another duplicated libraries with:
gradle -q dependencies your-app-project:dependencies
Change your-app-project to your module name, for example, app.
I'm following an Tutorial from youtube and now I ran into an problem. When I sync the build File. Build Completes without any Error but when I run app connecting my Device it give me error of
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
But when I remove the line
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
It works Fine, but I need this library. So How can I resolve it.
My app build.gradle file is
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.nepalpolice.cdp"
minSdkVersion 21
targetSdkVersion 26
versionCode 2
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:support-v4:26.+'
implementation 'com.android.support:cardview-v7:26.+'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.google.gms:google-services:3.1.0'
implementation 'com.android.support:design:26.+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
implementation 'com.android.support:gridlayout-v7:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
and inside my lib folder , I have volley jar file.
I tried below solution but it didn't work for me.
One
android {
defaultConfig {
multiDexEnabled true
}
}
and also using
compile 'com.android.support:multidex:1.0.1'
and also I deleted .gradle file and clean and rebuild project but didn't help either.
How can I solve this?? Thanks in advance.
This issue happened to me and the solution was about the release of the image cropper library.
In my case and as well yours, the SDK is 26 so you need to compile 2.5.1 version, not 2.6.0:
implementation 'com.theartofdev.edmodo:android-image-cropper:2.5.1'
Android Image Cropper releases
I have been using retrofit2 along with Gson convertor in many applications. But currently I'm contributing to an existing project and i have used both dependencies. While running the project directly, it works perfectly. But whenever I generate a debug or release build, This error appears in Toast and Api content is not parsed.
Proguard is disabled. Here is the error:
No virtual method
newJsonReader(Ljava/io/Reader;)Lcom/google/gson/stream/JsonReader; in
class Lcom/google/gson/Gson; or its super classes (declaration of
'com.google.gson.Gson' appears in
/data/app/com."packagename"/base.apk:classes2.dex)
App Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.medris.medrisemt.medrishcemt"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a'
universalApk true
}
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':zoomsdk')
implementation project(':zoomcommonlib')
implementation project(':redirectionalgorithm');
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'io.jsonwebtoken:jjwt:0.9.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'commons-codec:commons-codec:1.9'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:design:25.4.0'
implementation 'com.android.support:support-v4:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'org.apache.httpcomponents:httpcore:4.4.1'
testImplementation 'junit:junit:4.12'
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'io.nlopez.smartlocation:library:3.3.3'
implementation 'com.google.android.gms:play-services:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
I have searched for relevant answers but no satisfactory results. I have tried to downgrade the gson & retrofit dependencies but no success.
Update
I have updated the Gson & retrofit-convertor dependencies in the gradle code above to the one I was actually using initially. I mistakenly posted the downgraded ones that I tried for testing.
Try this,
I started using the newer versions:
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
And the error disappeared.
After adding this dependencies in your gradle file, please clean and
rebuild your project.
write this in build.gradle > these are newer versions
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'