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.
Related
i'm trying to import clarifai api in my android project but it gives the following error :
Error:(28, 13) Failed to resolve: com.clarifai.clarifai-api2:android:2.0.2
project.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "ir.codinglab.objectrecognizer"
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'
}
}
lintOptions {
lintConfig rootProject.file('gradle/lint.xml')
}
}
dependencies {
compile 'com.github.markushi:circlebutton:1.1'
compile 'com.clarifai.clarifai-api2:android:2.0.2'
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'
})
testCompile 'junit:junit:4.12'
}
I have to note that i don't have any problems with importing other libraries .
Thank you in advance.
the library you have entered is wrong. This is the correct one -
compile 'com.clarifai.clarifai-api2:core:2.2.3'
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
//...
}
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 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
}
}
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 :)