adding ViewPagerIndicator via maven in Android Studio - android

I'd like to use ViewPagerIndicator in my project, but for some reason it does not work.
Here is project top level build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
and here is module build.gradle
apply plugin: 'android'
android {
compileSdkVersion 17
buildToolsVersion '19.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 18
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
repositories {
mavenCentral()
}
dependencies {
compile files('libs/android-support-v13.jar')
compile files('libs/greendao-1.3.6.jar')
compile files('libs/TestFlightLib.jar')
compile 'com.viewpagerindicator:library:2.4.1'
}
After this I hit Sync project with graddle files and all I get is "support-v4-r7" file in External Libraries.
Am I doing anything wrong please?
Thank you :)

Related

how to solve Program type already present: org.apache.http.auth.AuthSchemeProvider?

The below gradle files are i have used in my application. It works fine with api level 23 but when i update from 23 to 26 i faced this issue. Please help me to resolve this.
// Top-level build file
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
task wrapper(type: Wrapper) {
gradleVersion = "3.1.0"
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
}
and my application gradle file is below. this application gradle is works fine with compile and target sdk as 23.
import java.util.regex.Pattern
apply plugin: 'com.android.application'
android {
lintOptions {
abortOnError false
}
//compileSdkVersion 21
compileSdkVersion 26
flavorDimensions "default"
defaultConfig {
applicationId "**********"
minSdkVersion 14
targetSdkVersion 26
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
zipAlignEnabled true
debuggable false
}
debug {
minifyEnabled false
zipAlignEnabled true
debuggable true
}
}
sourceSets {
main {
java {
//
}
}
androidTest {
java {
}
}
}
productFlavors {
devel {
repositories {
jcenter()
maven {
url
}
}
}
stag {
repositories {
jcenter()
maven {
url ""
}
}
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ASL2.0'
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
implementation('org.apache.httpcomponents:httpmime:4.3.5') {
exclude module: 'org.apache.httpcomponents:httpclient'
}
implementation 'com.google.android.gms:play-services-plus:11.8.0'
implementation 'com.google.android.gms:play-services-analytics:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation "com.splunk.mint:mint:4.4.0"
}
repositories {
maven {
url "https://mint.splunk.com/gradle/"
}
}
}

Kotlin build failed in Android Studio

The error:
Error:Execution failed for task ':synclib:compileKotlin'.
> com.intellij.openapi.fileTypes.LanguageFileType.<init>(Lcom/intellij/lang/Language;)V
The build.gradle file of the synclib module:
apply plugin: 'java'
apply plugin: 'kotlin'
compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.firebase:firebase-client-jvm:2.2.3'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile project(':jamodel')
}
buildscript {
ext.kotlin_version = '1.0.0'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
mavenCentral()
}
How to fix or diagnose this?
This is a working configuration. You can adapt it to your multi-project setup:
/build.gradle
buildscript {
ext.kotlin_version = '1.0.4'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
jcenter()
}
ext {
androidBuildToolsVersion = "23.0.3"
androidMinSdkVersion = 16
androidTargetSdkVersion = 23
androidCompileSdkVersion = 23
androidApplicationId = "com.some.example"
androidVersionCode = 1
androidVersionName = "1.0"
supportVersion = "24.0.0"
}
}
/app/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion parent.ext.androidCompileSdkVersion
buildToolsVersion parent.ext.androidBuildToolsVersion
defaultConfig {
minSdkVersion parent.ext.androidMinSdkVersion
targetSdkVersion parent.ext.androidTargetSdkVersion
versionCode parent.ext.androidVersionCode
versionName parent.ext.androidVersionName
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
dexOptions {
preDexLibraries = false
jumboMode = false
javaMaxHeapSize "4g"
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
Follow these instructions or check: https://kotlinlang.org/docs/tutorials/kotlin-android.html
Choose Help | Find Action on the main menu or press CTRL+Shift+A.
Search for this item:
You would be prompted for kotlin version.
Choose the latest available from the list of installed versions.
Now build.gradle file for the application should be updated.
The last thing to do is to sync the project. You can press 'Sync Now' in a prompt or invoke an action Sync Project with Gradle Files.
Hope it will help
ensure all your apps and libs build.gradle's ext.kotlin_version equal to your installed Kotlin version
buildscript {
ext.kotlin_version = PROP_KOTLIN_VERSION // 1.1.2-3 // this should equal to your installed Kotlin version
//...
}

Failed to resolve: com.firebase:fire-client-android:2.4.2

I'm working with firebase.
This is the error on app/build.gradle:
Error:(26, 13) Failed to resolve: com.firebase:fire-client-android:2.4.0
Error:(29, 13) Failed to resolve: com.firebaseui:firebase-ui:1.3.1
Where am I going wrong ?
Here is my module build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.prueba.android.connect4"
minSdkVersion 10
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile files('libs/connect4Lib.jar')
compile 'com.firebase:fire-client-android:2.4.2'
compile 'com.android.support:appcompat-v7:23.0.2'
compile 'com.android.support:design:23.1.1'
compile 'com.firebaseui:firebase-ui:1.3.1'
}
And top-level gradle:
buildscript {
repositories {
jcenter() {
url "http://jcenter.bintray.com/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
jcenter(){
url "http://jcenter.bintray.com/"
}
}
}
Error:
Thanks in advance
I suggest you to move to google firebase as older firebase APIs have been deprecated and will be removed in future.
Change your gradle to include
compile 'com.google.firebase:firebase-core:9.0.1'
compile 'com.google.firebase:firebase-database:9.0.1' //For realtime database
Checkout this for more information.

Can't install via gradle. Artifact * not found

I already tried the solution (Using ViewPagerIndicator library with Android Studio and Gradle) but not successful. Still got this error message
Error:A problem occurred configuring project ':app'.
> Artifact 'library.aar (com.viewpagerindicator:library:2.4.1)' not found.
Searched in the following locations:
https://repo1.maven.org/maven2/com/viewpagerindicator/library/2.4.1/library-2.4.1.aar
What I trying to do is install this plugin (https://github.com/JakeWharton/ViewPagerIndicator) via gradle. Below is my build.gradle.
apply plugin: 'com.android.application'
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.xxxxx.xxxxx"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.viewpagerindicator:library:2.4.1#aar'
}
Add:
repositories {
maven {
url "https://jitpack.io"
}
}
before mavenCentral()
And to dependencies
compile('com.github.JakeWharton:ViewPagerIndicator:2.4.1#aar') {
exclude module: 'support-v4'
}
I think you can miss this line classpath 'com.android.tools.build:gradle:1.2.3'
My gradle:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.n1to.testapp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
// if you have multiple outputs (when using splits), you may want to have other index than 0
// you should set your package name here if you are using different application IDs
// resourcePackageName "your.package.name"
// You can set optional annotation processing options here, like these commented options:
// logLevel 'INFO'
// logFile '/var/log/aa.log'
}
}
buildscript {
repositories {
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:1.2.3'
// replace with the current version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
mavenLocal()
}
dependencies {
compile 'org.androidannotations:androidannotations:3.3.1'
apt 'org.androidannotations:androidannotations:3.3.1'
compile 'org.projectlombok:lombok:1.16.4'
compile('com.android.support:appcompat-v7:22.2.0') {
exclude module: 'support-v4'
}
compile('com.android.support:recyclerview-v7:22.2.0') {
exclude module: 'support-v4'
}
compile('com.android.support:cardview-v7:22.2.0') {
exclude module: 'support-v4'
}
compile('com.android.support:design:22.2.0') {
exclude module: 'support-v4'
}
compile 'com.android.support:support-v4:22.1.1'
compile('com.github.JakeWharton:ViewPagerIndicator:2.4.1#aar') {
exclude module: 'support-v4'
}
}

Configuring Android Annotations v3.0.1 with Android Studio (Beta) 0.8.4

Configuring Android Annotations is quite irksome. But I finally figured out a solution and wish to share with everyone.
Use the below mentioned gradle buildscript.
Following are some of the references:
1) https://github.com/excilys/androidannotations/blob/develop/examples/gradle/build.gradle
2) https://bitbucket.org/hvisser/android-apt
3) http://www.jayway.com/2014/02/21/androidannotations-setup-in-android-studio/
build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
repositories {
mavenCentral()
}
ext.androidAnnotationsVersion = '3.0.1';
configurations {
apt
}
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
useOldManifestMerger true
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
}
}
dependencies {
compile 'com.android.support:support-v4:20.0.+'
compile 'com.android.support:appcompat-v7:20.0.+'
apt "org.androidannotations:androidannotations:${androidAnnotationsVersion}"
compile "org.androidannotations:androidannotations-api:${androidAnnotationsVersion}"
compile fileTree(dir: 'libs', include: '*.jar')
}
apt {
arguments {
resourcePackageName 'com.yourpackage.name'
androidManifestFile variant.processResources.manifestFile
}
}

Categories

Resources