Problem with dependencies gradle exception - java

What the hell is this? I know that I have to upgrade something within my app dependencies but it does not point out what and where!!
org.gradle.api.GradleException: The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.0.5,16.0.5], [16.0.4,16.0.4], [16.3.0,16.3.0]], but resolves to 16.3.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
I added the following dependencies for admob ads and gave me that error :
implementation 'com.google.android.gms:play-services-ads:17.1.1'
Project level gradle :
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.0.1'
// 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
}
app level :
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.genesisbc.marketplace"
minSdkVersion 23
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.android.gms:play-services-ads:17.1.1'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.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:cardview-v7:28.0.0'
}
apply plugin: 'com.google.gms.google-services'

Related

Unable to resolve dependency in android studio, why this happen?

I close my android project and suddenly when I want to open my project again it giving me error???
ERROR: Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not resolve
androidx.Test:runner:1.2.0.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not resolve
androidx.Test.espresso:espresso-core:3.2.0. Show Details Affected
Modules: app
ERROR: Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not resolve
androidx.Test.ext:junit:1.1.1. Show Details
Affected Modules: app
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.gerobokgo"
minSdkVersion 21
targetSdkVersion 29
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.1.0'
implementation 'androidx.constraintlayout:constraintlayout: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-core:16.0.8'
implementation 'com.firebaseui:firebase-ui-database:4.3.2'
implementation 'com.google.firebase:firebase-storage:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.Test:runner:1.2.0'
androidTestImplementation 'androidx.Test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.Test.ext:junit:1.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
//Layout
implementation 'com.google.android.material:material:1.0.0'
//recylervieer
implementation 'androidx.recyclerview:recyclerview:1.0.0'
// image slider
implementation 'com.github.therealshabi:AutoImageFlipper:v1.4.1'
//image Cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.1.+'
implementation 'androidx.work:work-runtime:2.2.0'
}
// 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.5.0'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You have a capital T in the dependency, use the following one
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'

ERROR: Could not find method android() for arguments

I am facing a problem, when i sync my project this gradle error occurs :(
ERROR: Could not find method android() for arguments [build_4igxve2xutpcfkae0ab7hnkia$_run_closure1#353dd2ed] on project ':app' of type org.gradle.api.Project.
Open File
This is my Build.gradle(project: name)
// 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.0.0-beta6'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:4.3.2'
// 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
}
This is my build.gradle(Module:App)
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.instagram"
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.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
//androidTestImplementation 'com.android.support.test:runner28.0.0'
}
apply plugin: 'com.google.gms.google-services'
You appear to be missing this line from the top of your module's build.gradle file:
apply plugin: 'com.android.application'

How to fix "Cause: invalid type code: 8F"

Cause: invalid type code: 8F this error raise when try to take apk build.
Already I tried.. -- clean and rebuild -- Invalidate and restart -- jdk path setting -- experimental option
Android studio version 3.3.1
gradle version -- classpath 'com.android.tools.build:gradle:3.2.1'
project level gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.app"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4: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'
implementation 'com.android.support:design:28.0.0'
implementation 'nl.psdcompany:duo-navigation-drawer:2.0.6'
apply plugin: 'com.google.gms.google-services'
}
I attached my app and project level gradle file.

Problems when i try to use a new places-compat

i try to use a new placesApi, i follow this documentation https://developers.google.com/places/android-sdk/client-migration#place-picker-deprecation, when i run my app, android studio return this
"Error: Type com.google.android.libraries.places.internal.lm is referenced as an interface from com.google.android.libraries.places.internal.fm"
and this:
"Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\14155709.gradle\caches\transforms-1\files-1.1\places-1.0.0.aar\2f69114c5b5de9392ef400dc02f6f031\jars\classes.jar"
this problem starts when i put this: implementation 'com.google.android.libraries.places:places-compat:1.0.0'
and this:implementation 'com.google.android.libraries.places:places:1.0.0'
i need bout implements, i try to search on google but i didn't found noting, pls help me.
this is my 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.2.0'
// 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
}
this is my gradle app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.motoja.motojapassageiro"
minSdkVersion 16
targetSdkVersion 28
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.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'
//firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
//maps places
implementation 'com.google.android.libraries.places:places-compat:1.0.0'
//implementation 'com.android.support:cardview-v7:28.0.0'
//implementation 'com.google.android.gms:play-services-places:16.0.+'
implementation 'com.google.android.libraries.places:places:1.0.0'
//google-play
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
// Required only if Facebook login support is required
implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
}
apply plugin: 'com.google.gms.google-services'
These two dependencies might be conflicting each other:
// implementation "com.google.android.libraries.places:places-compat:1.1.0"
implementation "com.google.android.libraries.places:places:1.1.0"
The places-compat wrapper is ordinary not required - better refactor your code to the new library.

org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD '

I was modifying and adding some dependencies in my project and then i got this error:
Metadata of https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom 90ms
and some more errors similar to this one
And for the Event Log:
org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'.
My gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And Module Dependencies:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.hasee.seetravel"
multiDexEnabled true
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
// jniLibs.srcDirs = ['libs']
res.srcDirs = [
'src/main/res/layout/home',
'src/main/res/layout/explore',
'src/main/res/layout/camera',
'src/main/res/layout/schedule',
'src/main/res/layout/me',
'src/main/res/layout/video',
'src/main/res/layout/drop_menu',
'src/main/res/layout',
'src/main/res'
]
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.danylovolokh:video-player-manager:0.2.0'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.shuyu:GSYVideoPlayer:4.0.0-beat1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'cn.jzvd:jiaozivideoplayer:6.2.7'
implementation 'com.white.countdownbutton:countdownbtn:1.0.4'
implementation 'com.github.dongjunkun:DropDownMenu:1.0.4'
implementation 'cn.yipianfengye.android:ad-library:1.0'
implementation 'cn.yc:YCDialogLib:3.5'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.sackcentury:shinebutton:0.2.0'
implementation 'me.shaohui:bottomdialog:1.1.9'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation files('libs/Android_Map3D_SDK_V6.0.0_20180211.jar')
}
Besides I am a Chinese user but failures also occurred when i turned on my VPN.
Other Settings:
HTTP Proxy:
enter image description here
Installed SDK Platform: Android API 28 & Android 8.1(Oreo)
Gradle Settings:
enter image description here
Please Help

Categories

Resources