Error when clone existing Android project from github [closed] - java

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I need to clone my existing android project from github to another computer but while i cloning my repo android studio giving me such error. what can i do for successful cloning my project?
My Module.app file is bwllow
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.whatsapp"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.firebaseui:firebase-ui-database:4.2.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
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 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
}
and the error is

Press double shift and type offline work.
You can go there via. Build, Execution, Deployment > Gradle.
Could you see if you have offline work enabled. If that is the case disable it and try again.

Related

App is crashing but there is no error in the code

I am getting java.lang.NoSuchMethodError in the error log and after that app is crashed. I am not getting any error in my java code. I am not sure which library is causing this issue. Your help is highly appreciated.
I have updated few libraries to 28 and to 27 but still getting the same error.
Error
java.lang.NoSuchMethodError: No static method getScreenWidthDp(Landroid/content/res/Resources;)I in class Landroid/support/v4/content/res/ConfigurationHelper; or its super classes (declaration of 'android.support.v4.content.res.ConfigurationHelper' appears in /data/app/com
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.test.test"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.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'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.szagurskii:patternedtextwatcher:0.5.0'
implementation 'com.github.d-max:spots-dialog:1.1#aar'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.facebook.android:account-kit-sdk:4.+'
}
If I update the appcompat to 28 then I am getting below error.
implementation 'com.android.support:appcompat-v7:28.0.0'
* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.design.widget.CoordinatorLayout$1
Without the full stacktrace it is impossible to tell where the error originates. The only thing that looks suspicious in your build file is that you don't have a common android support version. You use libraries of both the 27.0.0 and 28.0.0 versions.
After adding implementation 'com.android.support:design:28.0.0' then this issue got resolved. Thanks everyone for your comments.

How to update com.google android.gms:play-services-auth:16.0.1?

I am trying to run a code in android-studio but I get following warning "All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-v4:26.1. " How can I fix this?
I know that the problem is in this line:
implementation 'com.google.android.gms:play-services-auth:16.0.1'
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.irma"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
**implementation 'com.android.support:support-media-
compat:28.0.0'**
implementation 'com.android.support:appcompat-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'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
**implementation 'com.google.android.gms:play-services-auth:16.0.1'**
}
So I have conflict here: implementation 'com.android.support:support-media-compat:28.0.0' and here: implementation 'com.google.android.gms:play-services-auth:16.0.1'
But play services-auth is already updated, but the program still says its on version 26.1.0.
You need to update the Google Sign-In lib to the latest version.
In my case, I need to update my v7 AppCompat to v28. After doing so, the issue you stated surfaced. Updating com.google.android.gms:play-services-auth:16.0.1 to the latest version would result to Manifest conflicts because the latest version uses Androidx. You either migrate your project to Androidx to support play-services-auth's latest version or make exclusion in the dependencies. I didn't want to migrate to Androidx yet, so the latter works for me. I added the following to the gradle file:
implementation ('com.google.android.gms:play-services-auth:16.0.1'){
exclude group: 'com.android.support', module:'support-v4'
}
Set Up - Google Play Services, as follow you can see the lastest versions. Google Play Services

Jsoup program type already present

I am using JSoup to parse my HTML response in my Java application but when I add the implementation I get the following:
Program type already present: org.jsoup.Connection$KeyVal
Message{kind=ERROR, text=Program type already present:
org.jsoup.Connection$KeyVal, sources=[Unknown source file], tool
name=Optional.of(D8)}
I am wondering has anyone experienced this before? I will add my full build.gradle below, I am running the most current SDK.
apply plugin: 'com.android.application'
android { compileSdkVersion 28 defaultConfig {
applicationId "uareloadedapp"
minSdkVersion 26
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'
} } productFlavors { } }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation (name: 'wikitudesdk', ext:'aar') implementation 'com.google.ar:core:1.1.0' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'org.altbeacon:android-beacon-library:2.15.2' 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' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.squareup.picasso:picasso:2.5.2' implementation "com.android.support:support-core-utils:28.0.0" implementation 'com.android.support:support-v4:28.0.0' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+' implementation 'org.jsoup:jsoup:1.11.3'
} repositories { flatDir{
dirs 'libs' } }
Check if there is anything that you have added as a dependency and is also in the libs folder. That was my problem. deleting the file from the lib folder fixed it

Android Studio Failed to resolve: com.android.support:appcompat-v7.28.0.0

I am getting this error, Failed to resolve: com.android.support:appcompat-v7.28.0.0 I have been looking on here and tried changing it to other variations of that line but so far no luck, why do I keep getting this error?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapp"
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'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.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'
}
apply plugin: 'com.google.gms.google-services'
The issue is with the appcompat-v7 dependency that you have added to the build.gradle.
Change implementation 'com.android.support:appcompat-v7.28.0.0' to implementation 'com.android.support:appcompat-v7:28.0.0'
Notice the : between appcompat-v7 and 28.0.0 that separates the artifact name and the version.
If we don't consider the typo in :
implementation 'com.android.support:appcompat-v7.28.0.0'
Change it to:
implementation 'com.android.support:appcompat-v7:28.0.0'
Then, you probably should use the latest version for the Firebase dependencies to avoid those Please fix the version errors:
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
Then rebuild the project. Also, remember to use latest gradle to avoid couldn't found such dependency or etc.
Inside build.gradle of the project (inside your project root directory):
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// replace it with the 3.2.0 version
...
classpath 'com.google.gms:google-services:4.1.0' // update this too
}

Got error while testing App - Firebase Test Lab

I just cannot understand what error is this. I got it when I tried to test my app on a device from the Firebase Test Lab. When I test the app on my phone and on the android emulator in Android Studio, everything works fine, but here, at the first activity created, I get this error that I don't know what means. If you know the problem, or how to solve it, please help me out. Thanks
Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "edurbrito.SuperLigaUsers"
minSdkVersion 21
targetSdkVersion 26
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'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'org.apache.commons:commons-lang3:3.7'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.android.support:design:26.1.0'
implementation 'com.shawnlin:number-picker:2.4.6'
implementation files('libs/activation.jar')
implementation files('libs/additionnal.jar')
implementation files('libs/mail.jar')}
apply plugin: 'com.google.gms.google-services'
Can you please join the #test-lab channel at https://firebase-community.slack.com and then post a sample matrix-id of a test with this failure? A new Firebase Test Lab bug was filed a couple days ago that might be the same as this, but we can't tell without inspecting your test matrix.

Categories