i am new in android. i am currently working in android app and when i try to run the app this error occurs.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException:
duplicate entry: com/google/android/gms/internal/zzaso.class
build.gradle(app level)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.drag.screenart"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Thanks in advance.
Related
I am an Android developer.
I released an app for internal public testing and the following error was listed in the pre-release report summary.
"How to fix apps with bad WebRTC versions."
However, I am using WebView and not WebRTC. How do I fix this?
The following is the URL you were guided to at the time of the error.
https://support.google.com/faqs/answer/12577537
The following is build.gradel
apply plugin: 'com.android.application'
android {
compileSdkVersion 32
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "xxxx"
minSdkVersion 21
targetSdkVersion 32
versionName '2.2'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
versionCode 32
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
}
}
productFlavors {
stagingConfig
productConfig
}
flavorDimensions "default"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
ndkVersion '21.4.7075529'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-core:21.1.1'
implementation 'com.google.firebase:firebase-messaging:23.1.0'
implementation 'com.journeyapps:zxing-android-embedded:3.0.0#aar'
implementation 'com.google.zxing:core:3.2.0'
testImplementation 'junit:junit:4.12'
implementation 'me.leolin:ShortcutBadger:1.1.22#aar'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
}
repositories {
google()
mavenCentral ();
jcenter()
}
configurations.all {
resolutionStrategy.eachDependency { details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
details.useVersion '27.1.0'
}
}
}
apply plugin: 'com.google.gms.google-services'
ERROR: Could not find method platform() for arguments [com.google.firebase:firebase-bom:29.0.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Tried upgrading the Gradle version, but didn't resolve.
I'm trying to connect the app with firebase.
build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
defaultConfig {
applicationId "com.example.transportation"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation platform('com.google.firebase:firebase-bom:29.0.1')
implementation 'com.google.firebase:firebase-analytics'
}
build.gradle(project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Project Structure
You need to downgrade the version of firebase to
implementation platform('com.google.firebase:firebase-bom:25.12.0')
and I found the problem on the gradle version by updated it to
classpath 'com.android.tools.build:gradle:4.1.3'
it worked fine
I spend the last 3 hours trying to fix everything the gradle update broke but I can't find any fix for this one. I tried all the possible solutions I found online.
Error: Program type already present: com.google.firebase.auth.UserInfo
Here is my gradle.build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example. ..."
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
pickFirst 'META-INF/io.netty.versions.properties'
pickFirst 'META-INF/INDEX.LIST'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-messaging:17.3.2'
implementation 'com.google.firebase:firebase-core:16.0.4'
compile "com.google.firebase:firebase-auth:16.0.4"
compile 'com.google.firebase:firebase-admin:6.4.0'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
If someone could please help me, I am feeling really desperate
need help with this
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "app.sal.f.myapplication"
minSdkVersion 21
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.android.volley:volley:1.0.0'
compile 'org.jsoup:jsoup:1.7.3'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.google.apis:google-api-services-vision:v1-rev16-1.22.0'
compile 'com.android.support:design:25.1.1'
compile 'com.google.api-client:google-api-client-android:1.20.0' exclude module: 'httpclient'
compile 'com.google.http-client:google-http-client-gson:1.20.0' exclude module: 'httpclient'
}
This is my build.gradle like this:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'
buildscript {
ext.kotlin_version = '1.0.0'
ext.anko_version = '0.8.2'
ext.okhttp_version = '2.4.0'
ext.butterknife_version = '7.0.1'
ext.realm_version = '0.88.0-SNAPSHOT'
repositories {
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap/' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:$realm_version"
}
}
repositories {
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap/' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}
kapt {
generateStubs = true
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "cn.com.xxxx.xxxxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental false
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
sourceSets {
main.java.srcDirs += 'src/main/java'
}
}
//configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
dependencies {
compile 'com.android.support:multidex:1.0.1'
androidTestCompile 'com.android.support:multidex-instrumentation:1.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
// testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'de.hdodenhof:circleimageview:1.2.2'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.anko:anko-sdk15:$anko_version"
compile "org.jetbrains.anko:anko-support-v4:$anko_version"
compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
compile "org.jetbrains.anko:anko-design:$anko_version"
compile "org.jetbrains.anko:anko-recyclerview-v7:$anko_version"
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'de.greenrobot:eventbus:2.4.0'
compile "com.squareup.okhttp:okhttp:$okhttp_version"
compile "com.squareup.okhttp:okhttp-urlconnection:$okhttp_version"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.5.0'
compile("io.realm:realm-android:$realm_version"){
exclude group: 'com.android.support', module: 'multidex'
}
compile "org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}"
compile 'com.github.KeepSafe:ReLinker:1.1'
compile 'com.github.jjobes:slideDateTimePicker:1.0.2'
kapt "io.realm:realm-android:$realm_version"
}
but When I run my project following error occure :
Error:Gradle: Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: io/realm/annotations/Ignore.class
I tried this solution and some of questions in StackOverflow like this, but cannot solve it.
With 0.88 you no longer have to configure Realm yourself to work with Kotlin. That is all done inside the plugin. So you should remove kapt "io.realm:realm-android:$realm_version
We have a working example with Kotlin here:
https://github.com/realm/realm-java/blob/master/examples/kotlinExample/build.gradle
https://github.com/realm/realm-java/blob/master/examples/build.gradle