I have upgraded the version of Glide from 4.0.0-RC0 to 4.4.0. But it is giving me an error saying
Error:Module 'com.github.bumptech.glide:glide:4.4.0' depends on one or more Android Libraries but is a jar
It is not saying which jar or any other information.
Does anybody know how to fix this? I am also attaching the entries for Glide in my build.gradle
compile 'com.github.bumptech.glide:glide:4.4.0'
compile 'com.github.bumptech.glide:okhttp3-integration:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
compile 'com.github.bumptech.glide:annotations:4.4.0'
EDIT : I am using the support library version 27.0.1
I faced the same issue, but using this solved it :
compile('com.github.bumptech.glide:glide:4.4.0#aar') {
transitive = true;
}
To pull in the annotations module which contains #GlideModule, you have to use transitive = true
This is may be glide issue so, I will prefer to don't update glide to com.github.bumptech.glide:glide:4.4.0 till now. you can use older version like com.github.bumptech.glide:glide:4.3.1 or com.github.bumptech.glide:glide:4.3.0 or com.github.bumptech.glide:glide:4.2.0
you can read more about these issues on
issue 2318
issue 2319
Just use this in app.gradle and you are done :
compile 'com.github.bumptech.glide:glide:3.7.0'
Just need to do these steps to avoid this error:
1 - update your sdk version to 27
2 - In your dependencies in build.gradle:
implementation('com.github.bumptech.glide:glide:4.6.1') {
exclude group: "com.android.support"
}
And you are good to go as this one resolved my issue.
implementation 'com.github.bumptech.glide:glide:4.0.0-RC0'
Once check with this dependencies for latest android studio 3.0.2 this dependencies build proper gradle.
You can use it like this in your build. Simply:
dependencies {
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
}
Related
Just started this error on Android build. Please help.
"Duplicate class com.google.android.gms.internal.firebase_messaging.zza found in modules jetified-firebase-iid-19.0.0-runtime.jar (com.google.firebase:firebase-iid:19.0.0) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)"
In build.gradle:
implementation "com.google.firebase:firebase-iid:21.1.0"
None of the answers above is correct. And none of them solves the problem.
The problem is in transitive dependencies.
You need to check which libs are causing the issue and do something like:
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation ('com.google.firebase:firebase-iid:21.1.0') {
transitive = true
}
I resolved this problem by using the Firebase Android BoM
In my case the problem depends on the coexistence of messaging and functions.
So from this:
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-functions-ktx:20.0.0'
To this:
implementation platform('com.google.firebase:firebase-bom:28.2.1')
implementation 'com.google.firebase:firebase-functions-ktx'
implementation 'com.google.firebase:firebase-messaging'
BOM 31.x does have currently this problem.
See issue here:
https://github.com/firebase/firebase-android-sdk/issues/4206
Resolved via issue here but not yet official released:
https://github.com/firebase/firebase-android-sdk/pull/4225
Comment:
it was not resolved yet, 31.0.1 only contained a fix to crashlytics crash bug. That's why this issue is still open. The team here will make a fix close the issue, then do a release likely with release notes indicating it is fixed, when it is fixed https://firebase.google.com/support/release-notes/android - here
A current workaround is to add the iid version explicitly until a new BOM version is released:
implementation platform('com.google.firebase:firebase-bom:31.0.0')
implementation 'com.google.firebase:firebase-functions'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-iid:21.1.0'
I encountered the same problem.
I fixed it by redefining my dependencies implementations like this:
In build.gradle:
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
Please note my configuration in buildscript: com.android.tools.build:gradle:4.2.1
Then, clean and rebuild project.
Can you share more information about your setup?
Using react-native-push-notification ^3.1.9, I've got the same error.
To fix it :
in project/build.gradle:
buildscript {
ext {
googlePlayServicesVersion = "17.0.0"
firebaseMessagingVersion = "20.1.0"
firebaseVersion = "20.1.0"
// other settings
}
// other settings
}
in project/app/build.gradle:
dependencies {
implementation "com.google.firebase:firebase-messaging:20.1.0"
// other implementations
}
The reason : react-native-push-notification package specify dependency to firebase-messaging:+ : which ask to get the last version.
So, gradle upload the latest com.google.firebase:firebase-messaging:22.x.x which declare already existing classes in firebase-iid.
If you don't want to use firebase-bom because you don't trust firebase to keep all the proper versions in check then you can remove the duplicate.
Run ./gradlew app:dependencies (or replace app with your module)
Search for iid:19.0.0 (or whatever version is giving you issues)
Scroll up in the list to see where the library originates from.
You should see something like \--- com.google.firebase:firebase-iid:19.0.0
Keep scrolling until you find the dependency and module it originates in, marked with a + eg (+--- com.google.firebase:firebase-ml-vision)
Locate the dependency in your project and remove the duplicate iid
api("com.google.firebase:firebase-ml-vision:$version") {
exclude group: 'com.google.firebase', module: 'firebase-iid'
}
I get the error com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzau; when i run my app
The gradle files are
app.gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.google.android.gms:play-services:7.0.+'
compile 'com.android.support:mediarouter-v7:21.0.3'
compile 'com.squareup:otto:1.3.5'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.4.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.edmodo:rangebar:1.0.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile project(':library_viewpager')
compile project(':androidHorizontalListView')
compile project(':CastCompanionLibrary')
compile project(':mobihelp_sdk_android_v1.4')
compile fileTree(include: 'Parse-*.jar', dir: 'libs')
compile files('libs/Parse-1.9.2.jar')
compile files('libs/GoogleConversionTrackingSdk-2.2.2.jar')
}
CastCompanionLibrary
dependencies {
compile 'com.android.support:appcompat-v7:22.+'
compile 'com.android.support:mediarouter-v7:22.+'
compile 'com.google.android.gms:play-services-cast:7.5.0'
}
How do i fix this? i guess the error occurs because i use google play services in both the module and the app. but the versions are different. is that causing an issue?
I had similar problem and your question helped me solve mine and probably will help you solve yours. Problem is that you have defined:
dependencies {
...
compile 'com.google.android.gms:play-services-cast:7.5.0'
}
and
dependencies {
...
compile 'com.google.android.gms:play-services:7.0.+'
...
}
Since google services 7.5.0, if you're using single modules from play services you can't use whole play services as dependency simultaneously. Solution is to select only those services that you need instead of whole package e.g.:
instead of
dependencies {
...
compile 'com.google.android.gms:play-services:7.0.+'
...
}
use
dependencies {
...
compile 'com.google.android.gms:play-services-maps:7.0.+'
compile 'com.google.android.gms:play-services-location:7.0.+'
compile 'com.google.android.gms:play-services-gcm:7.0.+'
...
}
Also I'm not sure but probably it would be good idea to use the same version of google services in both gradle configs.
I had a similar problem after building using phonegap/cordova:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzsk;
I fixed it by editing build.gradle(module Android), as I had 2 libraries that should have the exact same version with different version numbers (8.4.0 and 9.2.1 in my case)
dependencies{
....
//make sure are both same version (8.4.0 or 9.2.1 in my case)
compile 'com.google.android.gms:play-services-gcm:9.2.1'
// this is the one I changed: compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-location:9.2.1' // it was 8.4.0
....
}
Firebase Android SDKs now have independent version numbers, allowing
for more frequent, flexible updates.
Update all your Firebase dependencies to the latest version (as of 2 May 2018):
Firebase Core com.google.firebase:firebase-core:15.0.2
Ads com.google.firebase:firebase-ads:15.0.0
Analytics com.google.firebase:firebase-analytics:15.0.2
App Indexing com.google.firebase:firebase-appindexing:15.0.0
Authentication com.google.firebase:firebase-auth:15.1.0
Cloud Firestore com.google.firebase:firebase-firestore:16.0.0
Cloud Functions com.google.firebase:firebase-functions:15.0.0
Cloud Messaging com.google.firebase:firebase-messaging:15.0.2
Cloud Storage com.google.firebase:firebase-storage:15.0.2
Crash Reporting com.google.firebase:firebase-crash:15.0.2
Crashlytics com.crashlytics.sdk.android:crashlytics:2.9.1
Invites com.google.firebase:firebase-invites:15.0.2
Performance Monitoring com.google.firebase:firebase-perf:15.1.0
Realtime Database com.google.firebase:firebase-database:15.0.0
Remote Config com.google.firebase:firebase-config:15.0.2
Release note: https://firebase.google.com/support/release-notes/android
I encountered the same issue after manually adding Firebase to my app.
For me the solution was changing:
classpath 'com.google.gms:google-services:3.2.0'
to:
classpath 'com.google.gms:google-services:3.0.0'
in the root-level build.gradle file.
If this is happening with react-native-device-info, you can only change from:
compile(project(':react-native-device-info'))
to
compile(project(':react-native-device-info')) {
exclude group: 'com.google.android.gms'
}
As described here:
https://github.com/rebeccahughes/react-native-device-info/blob/81b0c20fab8a10ccf0341dbd6710d7a5915b06a6/README.md#troubleshooting
Had the same issue while integrating firebase. For my case, it was caused by version mismatch.
on the app gradle, i had:
ext {
PLAY_SERVICES_VERSION = '10.2.0'
}
dependencies {
compile "com.google.android.gms:play-services-maps:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-location:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-places:$PLAY_SERVICES_VERSION"
compile 'com.google.firebase:firebase-database:10.0.1'
}
the firebase dependancy was added through the integrated firebase plugin in Android studio. When i matched the versions, it worked.
I had this issue recently, the reason was the version difference:
'com.google.firebase:firebase-ads:9.0.6'
'com.google.firebase:firebase-crash:11.0.2'
so make sure you have the same version.
I had the same problem but mine was cause by firebase-ui newest version 2.0.0. So I downgraded to 1.2.0 and added the following line to Project level build.gradle file:
allprojects {
repositories {
jcenter()
// Add the following code
maven {
url 'https://maven.fabric.io/public'
}
}
}
My project is a cordova ionic1 project, I spent a full night and morning to solve this issue, this is what I did beacuse i was having firebase dependencies and google services:
Go to this file :
platforms\android\cordova-plugin-firebase\cordova-plugin-firebase\app-build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
// classpath 'com.google.gms:google-services:3.0.0'
// i changed the above line from 3.0.0 to 3.1.1
classpath 'com.google.gms:google-services:3.1.1'
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'me.leolin:ShortcutBadger:1.1.4#aar'
//compile 'com.google.firebase:firebase-crash:+'
// i changed the above line from + to 11.0.2
compile 'com.google.firebase:firebase-crash:11.0.2'
}
Then Go to this file:
platforms\android\project.properties
Originally i was having this
target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-firebase/app-build.gradle
cordova.system.library.1=com.google.gms:google-services:+
cordova.system.library.2=com.google.firebase:firebase-core:+
cordova.system.library.3=com.google.firebase:firebase-messaging:+
cordova.system.library.4=com.google.firebase:firebase-crash:+
cordova.system.library.5=com.google.firebase:firebase-config:+
cordova.system.library.6=com.android.support:support-v4:24.1.1+
cordova.system.library.7=com.google.android.gms:play-services-auth:11.+
cordova.system.library.8=com.google.android.gms:play-services-identity:11.+
Then i commented out the google services as we need specific dependencies and I also put the versions for firebase and gms to the same version number of 11.0.2
so after my file looks like this
target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-firebase/app-build.gradle
# cordova.system.library.1=com.google.gms:google-services:+
cordova.system.library.2=com.google.firebase:firebase-core:11.0.2
cordova.system.library.3=com.google.firebase:firebase-messaging:11.0.2
cordova.system.library.4=com.google.firebase:firebase-crash:11.0.2
cordova.system.library.5=com.google.firebase:firebase-config:11.0.2
cordova.system.library.6=com.android.support:support-v4:24.1.1+
cordova.system.library.7=com.google.android.gms:play-services-auth:11.0.2
cordova.system.library.8=com.google.android.gms:play-services-identity:11.0.2
If anyone had the same issues as mine, I removed the firebase-core dependency and it worked like a charm.
dependencies{
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.firebase:firebase-crash:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
}
to
dependencies{
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.firebase:firebase-crash:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
}
I was having this issue and none of the solutions worked. What worked for me was adding this plugin
cordova plugin add cordova-android-play-services-gradle-release --save
and then in both /platforms/android/cordova-plugin-fcm/ and /platforms/android/cordova-plugin-open/ replace
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
with:
ext.postBuildExtras = {
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}
If anyone else comes across this issue in Ionic removing and re-adding the platform worked for me:
> ionic cordova rm platform android
> ionic cordova add platform android
For anyone wondering how to fix this for Apache Cordova plugins, I fixed this problem by ensuring all plugin.xml files include the same major and minor version, but latest revision, like this:
<framework src="com.google.firebase:firebase-auth:15.0.+" />
<framework src="com.google.firebase:firebase-messaging:15.0.+" />
When using 15.0.0 above, the com.android.dex.DexException error was raised for some reason. By using + for the revision number (which means, latest), everything worked perfectly with cordova 7.1.0 and cordova-android 6.3.0.
Remember to remove and re-add the android platform after editing plugin.xml from plugins, otherwise your changes won't be applied at all!
Also: Ensure only ONE gradle file is applying this, just in case:
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:3.0.0'
}
I was also having this issue, I tried many ways to solve this issue. What worked for me was removing following line from my gradle.
compile 'com.google.firebase:firebase-core:16.0.3'
At first I have both firebase-core and firebase-ml-vision (what I need was only firebase-ml-vision) like following.
compile 'com.google.firebase:firebase-ml-vision:17.0.0'
compile 'com.google.firebase:firebase-core:16.0.3'
After I remove the line I got following warning,
Warning: The app gradle file must have a dependency on
com.google.firebase:firebase-core for Firebase services to work as
intended.
But, according to official docs the core dependency can be absent (https://firebase.google.com/docs/ml-kit/android/detect-faces), so it can be ignored.
Why am I getting this error? My repository and Google play services are up to date and I've used all the requires steps for using Firebase like copying firebase code in both build.gradle(Project and app). The intellisence doesn't even show FirebaseAuth but displays other members of Firebase.
Solved the error by adding this to the build.gradle file(for app) -
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
The 2nd dependency is to solve the version conflict error.
Add this dependency to Gradle.Build(Module:App)
compile "com.google.firebase:firebase-auth:9.0.2"
then sync with gradle :)
Add these two dependencies into your build.gradle
as 'compile' is replaced by 'implementation'
dependencies {
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation "com.google.android.gms:play-services-gcm:16.0.0"
}
***For the latest android studio version 3.0 and new ones ***
Same problem. Clean your project with "Build"->"Clean Project".
add the following to the build.gradle (app)
implementation 'com.google.firebase:firebase-auth:9.2.1'
For me this worked with all the firebase extensions:
eg.:
Android studio adds the following line to your gradle file:
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
You have to change it to:
implementation 'com.google.firebase:firebase-auth:16.0.1'
and add:
kapt 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
I have android studio 3.3.1 installed. Compile is replaced with implementation. So you have to write
implementation 'com.google.firebase:firebase-auth:16.1.0'
You should replace version according to the warning you get.
on dependencies in app gradle
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
this is useful android 3.0 and onwards versions auth:16.0.1 and
core:16.0.1Firebase will work
Solved the error by adding this to the build.gradle file(for app) -
compile 'com.google.firebase:firebase-auth:9.2.1'
compile "com.google.android.gms:play-services-gcm:9.2.1"
You may need to make sure that your activity is importing the Firebase Auth module. In your .java file (eg. Login.java):
import com.google.firebase.auth.FirebaseAuth;
Please add the below line in your build.gradle file:
implementation 'com.google.firebase:firebase-auth:19.3.0'
implementation "com.google.android.gms:play-services-gcm:10.2.1"
In my case, I was using firebase-auth and firebase-messaging with different versions. So After getting an error I kept the same version for both e.g.
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
After sync, my problem was solved. try to keep the version the same for firebase libraries
implementation 'com.google.firebase:firebase-auth:16.0.1'
make sure your firebase and all the dependency are the same versions.
I am new to android studio and volley library so please bear with me.
I've added volley library by GitHub and then and added this line to build gradle file:
compile 'com.android.support:appcompat-v7:23.0.1'
And now I am trying some tutorials about request and response from api, but for some reason I cannot make an instance of RequestQueue why?
I am using Android 4.0.3 IceCreamSandwish
Thank you
add following to your build.gradle file
compile 'com.mcxiaoke.volley:library:1.0.19'
Google have added it to their own documentation pages and GitHub https://developer.android.com/training/volley/index.html
The dependency can be added using:
dependencies {
...
implementation 'com.android.volley:volley:1.1.0'
}
Add this volley repo clone to your gradle dependencies:
compile 'com.mcxiaoke.volley:library:1.0.19'
https://github.com/mcxiaoke/android-volley
Add the Volley library as a dependency in the module build.gradle file.
dependencies {
compile 'com.he5ed.lib:volley:android-cts-5.1_r4'
}
This is another mirror of the Google Volley library https://github.com/he5ed/volley
I would add it in the build.gradle:
compile 'com.mcxiaoke.volley:library:1.0.19'
you were adding
compile 'com.android.support:appcompat-v7:23.0.1'
which is a completely different thing (a backwards COMPATibility library for older API levels).
I installed ALL Extra and SDK API 21-22 including changed
compileSdkVersion 22 to 21 and buildToolsVersion '22.0.1' to 21.1.2.
I'm having Rendering Problems for API 22.
I have tried changing the version to <= 21 but I'm still getting an error.
These are the correct version that you can add in your build.gradle according to the API needs.
API 24:
implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:recyclerview-v7:24.2.1'
API 25:
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:recyclerview-v7:25.4.0'
API 26:
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
API 27:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
In order to make that working I had to set:
compile ("com.android.support:support-v4:22.2.0")
compile ("com.android.support:appcompat-v7:22.2.0")
compile ("com.android.support:support-annotations:22.2.0")
compile ("com.android.support:recyclerview-v7:22.2.0")
compile ("com.android.support:design:22.2.0")
compile ("com.android.support:design:22.2.0")
Documentation states something different (docs):
com.android.support:support-design:22.0.0
Real path for Support Repository Libraries:
You should download Support Repository Libraries.
If the problem still exists:
Go to the real path of your Support Repository Libraries and check that the following folder exists:
"ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support"
In that folder there are support libraries that can't be found.
for example:
"ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support\appcompat-v7"
Open folder appcompat-v7 and you see folders with all available version. You should use only one of these versions in the build.gradle file dependencies or use +, for ex. 18.0.+
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:18.0.+'
compile 'com.android.support:gridlayout-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
}
That is the path taken from grade.build dependencies file:
com.android.support:appcompat-v7:18.0.0
Refer to the real path on your HDD -->
ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support\appcompat-v7\18.0.0
If there is no such folder, you will receive the error:
"failed to resolve com.android.support:appcompat-v7:18.0.0"
p.s. If you have Windows x64, when installing sdk and jdk, make sure that the installation path does not have Program Files(86). Brackets that add Windows may cause additional problems with resolving paths for your project. Use simple paths for your installation folder.
For example:
c:\androidSDK\
Failed to find: com.android.support:appcompat-v7:22.0.0
The "I literally tried everything else" answer:
This problem will also occur if you don't have an upto date Android Support Library and Android Support Repository. Just install using the SDK manager.
Along with other provided solutions, make sure to have the following within project/build.gradle
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
in support libraries you always need to add three numbers as version number
Suppose for 22 -> you need to write it as 22.0.0, not just 22
for 22.1 -> 22.1.0
So your dependencies should look like this
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:cardview-v7:22.0.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
I Programmers language you need to pad extra zeros.
Hope this solves your problem
i solve it
change 22.0.0 to 21.0.3
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:appcompat-v7:21.0.3' }
maybe i have download the com.android.support:appcompat-v7:21.0.3 but have not got the compile 'com.android.support:appcompat-v7:22.0.0'
when i use SDK Manager update my support library and support repository , the problem dismissed.
NOTE1: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).
NOTE2: Support library should not use a different version than the compileSdkVersion
For API 28 you can use:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
https://mvnrepository.com/artifact/com.android.support/appcompat-v7/28.0.0-alpha1
https://mvnrepository.com/artifact/com.android.support/recyclerview-v7/28.0.0-alpha1
All support libraries: https://mvnrepository.com/artifact/com.android.support
It is easier to use "+" sign in the version number. For example
compile 'com.android.support:support-v4:22.0.+'
compile "com.android.support:appcompat-v7:22.0.+"
In this case you won't have to change versions for the same API number
Go to Messages Gradle Sync, and Click on Install Repository and sync project. This is will install needed file in Android SDK and after syncing you will be able to create gradle or run your project.
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Are you import them? Like this:
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile ("com.android.support:support-v4:22.2.0")
compile ("com.android.support:appcompat-v7:22.2.0")
compile ("com.android.support:support-annotations:22.2.0")
compile ("com.android.support:recyclerview-v7:22.2.0")
compile ("com.android.support:design:22.2.0")
paste the above code in your app gradle.
and while setting up the project select empty activity instead of blank activity.
Fixed my issue by changing these
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
to
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
that means your target SDK version should be same as version of cardView and recyclerView and other google libraries.
targetSdkVersion 23
Tools > Android > SDK Manager
Select all of the packages that are not up to date and update them.
I had such dependancy in build.gradle -
compile 'com.android.support:recyclerview-v7:+'
But it causes unstable builds. Ensure it works ok for you, and look in your android sdk manager for current version of support lib available, and replace this dependency with
def final RECYCLER_VIEW_VER = '23.1.1'
compile "com.android.support:recyclerview-v7:${RECYCLER_VIEW_VER}"
I solved the problem updating all packages from Android SDK Manager and also, I had to install Extras -> Android Support Repository.