I take a reference on official website https://developer.chrome.com/multidevice/android/customtabs
They gradle like this :compile 'com.android.support:customtabs:23.3.0'
My project had used a lots of compile gradle that the sdk is 25 , i don't want to change it.
Is anyone to compile gragdle Custom Tabs when sdk is 25 ? Thanks in advance.
Here is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.my.myapp"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.crashlytics.sdk.android:crashlytics:2.6.6#aar') {
transitive = true;
}
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.android.support:appcompat-v7:25.1.1'//i don't want to change it.
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:customtabs:23.3.0'//is this with verson 25 ?
testCompile 'junit:junit:4.12'
}
apply plugin: 'io.fabric'
You should use
dependencies {
...
compile 'com.android.support:customtabs:25.1.0' //25.2.0 has been published
}
Advantages
Customizing the UI and interaction with the custom tabs.
Making the page load faster, and keeping the application alive.
Read Chrome Custom Tabs
Related
Just installed Android Studio for the first time on this new machine and was trying to import a project that used to work without any errors a year ago on another machine.
Had to fix plenty of errors by just downloading and installing updates (recommendations).
The one error that's left is in the title.
This is my build.gradle source:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.test.testaa"
vectorDrawables.useSupportLibrary = true
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.google.android.gms:play-services:9.6.1'
compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
testCompile 'junit:junit:4.12'
}
This occurred after I upgraded my android studio. I've attempted all similar answers on stack overflow, and a few other obscure forums, but I'm not getting anywhere with this error and I've been at it for 6 hours. I've monkeyed around with the sdk tools manager as well, but I'm not getting anywhere. Oh, and that maven thing is new, tried it from a similar answer.
Here is my gradle file:
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.loredylore.lorebuilder"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.android.support:support-vector-drawable:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.google.firebase:firebase-crash:11.0.2'
compile 'com.google.firebase:firebase-storage:11.0.2'
compile 'com.android.support:support-annotations:26.0.0-alpha1'
//new
testCompile 'junit:junit:4.12'
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
use version 25.0.3, you may have to recast some views to text views when if you have to migrate backward from version 26 android to 25.
I have an issue and have looked at possible duplicate questions and answers and I think this one is not answered by the others so asking it here.
I updated my play services to make use of the fused location provider and now the appcompat in my gradle is showing an error.
So I created a new project and checked the build.gradle on the new project and have exactly the same appcompat but my project is showing an error.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "au.com.itmobilesupport.sqltwo"
minSdkVersion 17
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 {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services:11.0.1'
}
Its this line that is showing the error:
compile 'com.android.support:appcompat-v7:26.+'
But in a new project its fine. Why am I getting the error?
UPDATE:
If I remove these two lines then the error goes away:
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services:11.0.1'
But I need them so still have the error.
Add these lines to your build.gradle file to get libraries that you don't have based on Google site.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Caution: Using dynamic dependencies (for example, palette-v7:23.0.+) can cause unexpected version updates and regression incompatibilities. We recommend that you explicitly specify a library version (for example, palette-v7:25.4.0).
Finally solved the issue with the help of ZeroOne's answer to a similar question.
What led me to look at ZeroOnes answer was Google giving me the reason but not as an error. My issue was that the following line is too encompassing and a lot of extra dependencies were added that would have made the app unnecessarily larger.
compile 'com.google.android.gms:play-services:11.0.1'
I simply needed to be more specific and the error disappeared.
Here is the final gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "au.com.itmobilesupport.sqltwo"
minSdkVersion 17
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 {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-location:11.0.1'
}
And this is the specifc line I change the above to:
compile 'com.google.android.gms:play-services-location:11.0.1'
Hope it helps someone who comes across the same issue.
Being more specific using compile 'com.google.android.gms:play-services-location:11.0.1' rather than compile 'com.google.android.gms:play-services:11.0.1' saved my project as well, tks a lot guys.
I am trying to use FirebaseListAdapter and for it , it requires
dependency of com.firebaseui:firebase-ui-database:1.2.0 . But when I add this in my gradle file I am getting an error in
com.android.support:appcompat-v7:25.3.1
below are the screenshot and code for app.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.ashish.internchat"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
}
apply plugin: 'com.google.gms.google-services'
This is the error I am getting:
You are using mismatching library versions. com.android.support:animated-vector-drawable is version 25.3.1 while your com.android.support:recyclerview-v7 is version 25.1.1. Using mismatched versions could cause your app to crash/errors. FirebaseUi must be using version 25.1.1.
Add the below to your apps gradle:
compile 'com.android.support:recyclerview-v7:25.3.1'
how can i avoid or remove rendering problem warning permanently
i am using Android Studio 2.2.3.
i m getting rendering problems in most of my XML files
and my layout files not show any of my controls or design
guys help me to solve this problem
and if possible , try to tell me how can i permanently block these warning.
this is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "design.ray.com.finalproject"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.3.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
// compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.android.support:palette-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
//compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
testCompile 'junit:junit:4.12'
}
You can suppress the warnings on Android Studio.
Analyze > Inspect Code find the warning the you want to suppress and click it then Alt+Enter find suppress warning on the menu.