I tried the solution given before in stack overflow for this question, but it didnt worked... I am trying to use TextInputLayout for floating label, so I tried this code in gradle file
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'
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.adroid.support:support-core-utils:28.0.0'
implementation 'com.android.support.design:28.0.0'
}
and added this snippet in build.gradle(project) ..
allprojects {
repositories {
google()
jcenter()
maven{
url "https://maven.google.com"
}
}
}
but i am getting the error failed to resolve com.android.support.design
I even tried with versions 26 and 25...
what can be the problem? and how can i solve it?
Change it:
implementation 'com.android.support.design:28.0.0' with it:
implementation 'com.android.support:design:28.0.0' and try again
Related
I wanted to use the class LostLocationEngine in the package com.mapbox.services.android.location shown in this Mapbox documentation, however I get the error Cannot resolve symbol 'services'. Is it something with my gradle?
Here are my repositories and dependencies, and let me know if you need any other information:
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.2.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v8:0.9.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
Thanks!
add this dependency to your build.gradle
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.11.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.8.0'
reference link https://docs.mapbox.com/android/plugins/overview/location-layer/
This error only happening in android studio 3.5. I don't know why because I have used this same library in my other projects but after upgrading to the latest android studio which is 3.5, I am having this issue. I have checked and tried some answers but I was unable to solve it.
The error:
ERROR: Failed to resolve: com.github.hatamiarash7:RTL-Toast:1.3
Show in Project Structure dialog
Affected Modules: app
The library:
implementation 'com.github.hatamiarash7:RTL-Toast:1.3'
My apps dependencies section:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.+'
implementation 'com.android.support:design:28.+'
implementation 'com.android.support:cardview-v7:28.+'
implementation 'com.android.support:recyclerview-v7:28.+'
// circle image view
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.hatamiarash7:RTL-Toast:1.3'
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
You must define JitPack in your root build.gradle:
allprojects {
repositories {
...
maven {
url 'https://jitpack.io'
}
}
}
and you will use this dependency:
implementation 'com.github.hatamiarash7:RTL-Toast:1.3'
I'm trying to read data from firebase but somehow I cannot sync my Gradle project.
I went to Tools -> Firebase and added Authentication and Realtime Database as a video I referred on Youtube.
But my Gradle project sync keep on fails after that.
I've searched this problem on google and tried to update my versions but it didn't work.
I also added com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true at the bottom of build.gradle file but it says it's an unnecessary qualified reference.
Here's some code.
build.gradle
// 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.2.1'
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
}
build.gradle (Module : app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.el.ariby"
minSdkVersion 21
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'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-core:16.0.8'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-database:15.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.1'
//implementation 'com.google.firebase:firebase-auth:16.2.1'
//implementation 'com.google.firebase:firebase-storage:16.1.0'
//implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.4.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.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.google.firebase:firebase-auth:16.0.1:15.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
}
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
UPDATE
Sorry I forgot to add error messages.
Failed to resolve: firebase-database-15.0.0
Open File
Failed to resolve: firebase-auth-15.0.0
Open File
I really wish I can sync the file..
Thank you!
Please next time provide more details of the error, per console or xlint so we can evaluate the problem.
But I've already encountered an error that prevents sync, you use different versions of libraries causing conflicts. Please note that if you use a firebase library of one version, you have to use all libraries of the same version. The error is here:
implementation 'com.google.firebase:firebase-database:15.0.1' // 15.0.1????
implementation 'com.google.firebase:firebase-auth:16.0.3' // 16.0.3???
implementation 'com.google.firebase:firebase-storage:16.0.1' //16.0.1???
example:
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.3' //this is the same version
implementation 'com.google.firebase:firebase-auth:16.0.3' //than this
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.3'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.4.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.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'
just replace this line
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
with
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[11.0.1,11.0.1], [15.0.1,15.0.1]], but resolves to 15.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
When i am trying to add Firebase on my android project,I got this error.I have done every possible things to solve this error,but i still getting this error.Please give me some suggestion to solve this issue.
App level dependency
repositories {
maven {
url "http://dl.bintray.com/lukaville/maven"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7: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.constraint:constraint-layout:1.1.3'
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'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.8.4'
implementation 'com.facebook.android:facebook-login:4.28.0'
implementation 'com.facebook.android:account-kit-sdk:4.28.0'
implementation 'com.facebook.android:facebook-android-sdk:4.28.0'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
//noinspection GradleCompatible
implementation 'com.borjabravo:readmoretextview:2.0.1'
implementation 'com.gmail.samehadar:iosdialog:1.0'
implementation 'com.gdacciaro:iosdialog:1.0.3'
implementation 'com.wdullaer:materialdatetimepicker:3.6.0'
implementation 'com.bignerdranch.android:recyclerview-multiselect:0.2'
implementation 'com.wrapp.floatlabelededittext:library:0.0.6'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.ms-square:expandableTextView:0.1.4'
implementation 'com.nbsp:library:1.8'
implementation 'net.gotev:uploadservice:2.1'
implementation 'javax.mail:javax.mail-api:1.5.3'
implementation 'com.google.firebase:firebase-core:16.0.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'
project level dependency
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
I am not sure about the root cause of this problem(Probably some dark magic).
add:
import com.google.gms.googleservices.GoogleServicesPlugin
GoogleServicesPlugin.config.disableVersionCheck = true
to the app level build.gradle file.
Took the advice from:
https://github.com/OneSignal/OneSignal-Gradle-Plugin/issues/37
I am frustrated that I don't understand the reason for that. But it may help.
I'm building an app for the first time, it worked well with Google Map but a problem appeared when i added Firebase to my app.
I change some dependencies and this error occured after syncing with Gradle file :
Failed to resolve: com.google.android.gms:play-services:15.0.1
Install Repository and sync project
Show in File
Show in Project Structure dialog
Obviously i tried to click on Install Repository and sync project. During the installation, another error occured :
Could not find dependency "com.google.android.gms:play-services:15.0.1"
Here is my dependencies in build.gradle file. As you can see, i didn't forget to use implementation 'com.google.android.gms:play-services:15.0.1'.
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-annotations:28.0.0-alpha3'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-identity:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.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'
}
I found people with the same problem and i tried lots of proposed solutions, but the problem isn't solved.
You can see below my build.gradle project file.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.0.1'
classpath 'com.android.tools.build:gradle:3.3.0-alpha03'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}