How to import ViewPagerIndicator in android studio? - android

I want to use ViewPagerIndicator in my app. So I need its library. I find these 2 links for downloading, Link1 and Link2.
But I don't know how can I add it to my project?
this is my build gradle file:
apply plugin: 'com.android.application'
android {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
mavenCentral()
}
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "standup.maxsoft.com.standup"
minSdkVersion 13
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.viewpagerindicator:library:2.4.1#aar'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.viewpagerindicator:library:2.4.1#aar'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
}
I just copy 2 files in libs.folder. Would you please help me steplly? Thanks

You can use this dependency (it's an analog):
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1#aar'

Related

Error:Execution failed for task ':app:prepareComAndroidSupportAnimatedVectorDrawable2610Library

I think there is a bug in android studio when i try to use lottie library
from lottie introduction :
Gradle is the only supported build configuration, so just add the dependency to your project build.gradle file:
dependencies {
...
compile 'com.airbnb.android:lottie:2.2.5'
... }
I've added the dependency , but project is not sync and not being built.
-here is complete error :
Error:Execution failed for task ':app:prepareComAndroidSupportAnimatedVectorDrawable2610Library'.
Unable to unzip 'C:\Users\ramin\.gradle\caches\modules-2\files-2.1\com.android.support\animated-vector-drawable\26.1.0\abdf83a0192c03ff190f941c6c885af18d257a2c\animated-vector-drawable-26.1.0.aar' to 'C:\Users\ramin\.android\build-cache\6b7ed6c6f6a25dd18477727c16a13e0789c57b4e\output'
any idea ?
build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "chavosh.com.bztebuses"
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(dir: 'libs', include: ['*.jar'])
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.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
compile 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.github.boxme:squarecamera:1.1.0'
compile 'com.minimize.library:seekbar-compat:0.2.5'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.github.medyo:fancybuttons:1.8.4'
compile 'com.airbnb.android:lottie:2.2.5'
}
allprojects {
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/gigamole/maven/" }
maven { url "http://dl.bintray.com/ahmedrizwan/maven" }
jcenter()
maven {
url "https://maven.google.com"
}
}
}

Firebase Database gradle not resolving Failed to resolve 'com.android.firebase:firebase-database:10.2.0'

Module app Gradle:
Updated the google repository and service from sdk too
but this error is still there. Please someone check it out
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.norsoftbd.user.test1vaia"
minSdkVersion 22
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.android.gms:play-services:10.2.1'
implementation 'com.android.firebase:firebase-core:10.2.0'
implementation 'com.android.firebase:firebase-database:10.2.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
compile "com.android.support:recyclerview-v7:26.1.0"
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-messaging:10.2.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'com.google.gms.google-services'`enter code here`
Add the Google Maven repository in your project level build.gradele file as shown below.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Within build.gradle(Project) file, add latest google-services and Google maven repository
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Then, in your build.gralde(Module:app) file, add latest Firebase dependencies, apply google-services plugin and fix android support dependecies version:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.norsoftbd.user.test1vaia"
minSdkVersion 22
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(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.firebase:firebase-core:11.4.2'
compile 'com.android.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'com.google.gms.google-services'
Using configuration above should work.
Just replaced all "compile" with "implements" , #AlexTa I also placed the latest google services earlier.

Android Gradle method not found : 'compile()'

Can't run an android application due to below error of gradle .
Gradle DSL method not found : 'compile()'
Possible Causes :
The project XXXX may be using a version of Gradle that does not contain the method .
The build file may be missing a Gradle Plugin .
Please help how to resolve this .
EDIT :
File build.gradle
PFB my build.gradle file from project , most the file seems to be added in dependencies but why the issue cannot address the same .
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "xxxxxxxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 2
versionName "1.2"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'me.zhanghai.android.materialprogressbar:library:1.1.6'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.sa90.materialarcmenu:library:1.4.1'
compile files('libs/jxl.jar')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.github.clans:fab:1.6.4'
compile 'com.android.support:cardview-v7:23.4.0'
compile files('libs/acra-4.6.1.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.6.1#aar') {
transitive = true;
}
compile 'commons-codec:commons-codec:1.10'
compile "com.android.support:support-v4:+"
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
}
You have dependency in the project build.gradle, make sure to place it in the app/build.gradle.
For example in app/build.gradle
dependencies {
compile 'com.android.support:appcompat-v7:25.2.0'
}

Error:(44, 0) Version: 4.0.4 is lower than the minimum version (9.0.0) required for google-services plugin

I am trying to add the firebase admin SDK to my project following the instructions here: https://firebase.google.com/docs/admin/setup
but when i add compile 'com.google.firebase:firebase-admin:4.0.4' on my build.grandle file, then following error appears:
Error:(44, 0) Version: 4.0.4 is lower than the minimum version (9.0.0) required for google-services plugin.
If i try version 4.0.3 i face the same problem.
My build.grandle file at the moment:
android {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.qrcodereader"
minSdkVersion 19
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(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// compile 'com.google.android.gms:play-services-appindexing:9.0.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.zxing:core:3.2.1'
compile 'com.google.firebase:firebase-admin:4.0.4'
compile 'com.journeyapps:zxing-android-embedded:3.2.0#aar'
compile 'com.android.support:gridlayout-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui:1.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile project(':linkedin-sdk')
testCompile 'junit:junit:4.12'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}
apply plugin: 'com.google.gms.google-services'
Any help appreciated :)

Error failed to resolve 'com.yqritic:recylerview-flexibledivider:1.2.4;

zubliquzaini commented just now
Hello, I am getting this issue when I sync the project:
Error:(30, 13) Failed to resolve: com.yqritic:recylerview-flexibledivider:1.2.4
Here's my app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.ztl.ztlubricant.testing"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.yqritic:recylerview-flexibledivider:1.2.4'
}
I am not sure probably there is a file that I need to download for the yqritic dependencies to work..
Help! Thank you..
You need add:
repositories {
jcenter()
}
And try to use version 1.2.6
...
compile 'com.yqritc:recyclerview-flexibledivider:1.2.6'
...

Categories

Resources