I just installed Android Studio on elementary os 0.3.1 (based on Ubuntu 14.04 LTS), but I get the following error:
Error:(24, 13) Failed to resolve: com.android.support:appcompat-v7:15.+
Install Repository and sync project
Show in File
Show in Project Structure dialog
When I click on "Install Repository and sync project", I get this error:
Loading SDK information...
Ignoring unknown package filter 'extra-android-m2repository'
Warning:The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
My build.gradle (Module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 15
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.android.happybirthday"
minSdkVersion 15
targetSdkVersion 15
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:15.+'
}
My build.gradle (Project: HappyBirthday)
// 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:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
From Android Studio go to: Tools >> Android >> SDK Manager
Select and install "Extras|Android Support Repository"
If doesnt help, please post your gradle file.
try to install the option Android Support Library on the menu tools >> Android >> SDK Manager >> SDK Tools (tab).
Before that create a new project, that's worked for me.
Got same errors.
Mac OSX
V. 10.9.5
Android studio 1.4.1
build.gradle:
Before: android { compileSdkVersion 15 buildToolsVersion "19.1.0"
After: android { compileSdkVersion 23 buildToolsVersion "19.1.0"
Before: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:15.+' }
After: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.0' }
AndroidStudioProjects > 'app_name' > app > build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.johnkonderla.condor_paint"
minSdkVersion 16
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.0'
compile 'com.android.support:design:23.1.0'
}
Above changes + Build >> Clean Project.
Hope that helps!
Related
Hi all i am using charts library in my project a month ago it was working fine but now i have reinstalled android studio and when i build my project it gives gradle sync error.
Failed to resolve:com.github.PhilJay:MPAndroidChart:v2.1.3
I am stuck on this any suggestions how to solve this.My android studio version is 2.1
Here is project dependencies
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.app.comismv"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
jcenter()
url "https://jitpack.io"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
//compile 'com.cardiomood.android:android-widgets:0.1.1'
}
Thanks in advance
I had the same problem, here is the latest version of MPAndroidChart-v2.2.5.jar jar file.
Just put the MPAndroidChart-v2.2.5.jar inside app/libs/
and add
dependencies {
.
.
compile files('libs/MPAndroidChart-v2.2.5.jar')
}
in gradle file
I have following at project level :
classpath 'com.android.tools.build:gradle:2.1.2'
Works well i have Android Studio 2.1.2
As per project requirement I need to add firebase anaylytics to my project.
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
and
apply plugin: 'com.google.gms.google-services'
while adding all above requirements it gives error as follow
Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
I am stuck with this problem kindly guide if someone has this issue before
moudle level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.videoapp"
minSdkVersion 17
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'])
compile files('libs/volley.jar')
compile files('libs/picasso-2.4.0.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.gms:play-services-ads:9.2.1'
compile 'com.google.firebase:firebase-core:9.2.1'
}
apply plugin: 'com.google.gms.google-services'
I get the following error while I am trying to run the app.I have earlier updated the Android Studio.Gradle has also been posted below.
Error:
Error:(1, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Could not create plugin of type 'AppPlugin'.
Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.jobinsabu.georgetravels"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases' }
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.0'
}
Check your grade file and update classpath version here:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
Try to change your classpath version and then update.
Make sure you are connected to internet for gradle syncing.
Hope it may helpful to you.
Thanks,
Bhuvnesh
I'm developing a library for android that will be used in many applications.
The library depends on some other libraries.
For example, it uses Dagger 1.2, so if an app that will include my library will useDagger 2.0, the project won't build because of conflicts.
What can I do?
I tried Jarjar, with this workspace gradle
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'net.vrallev.gradle:jarjar-gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
this is the app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xxx.yyy.sdklauncherapp"
minSdkVersion 15
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 project(':library')
compile 'com.google.dagger:dagger:2.2'
}
and this is my library gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'net.vrallev.jarjar'
jarjar {
jarJarFile 'jarjar-1.4.jar'
rules = [
'rule com.squareup.dagger.** ext.com.squareup.dagger.#1'
]
srcExcludes = ['META-INF/**']
outputName 'build_repackaged.jar'
outputDir 'libs'
ignoreJarJarResult false
}
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:support-v4:23.1.1'
jarjar 'com.squareup.dagger:dagger:1.2.2'
}
I'm working with #Beni in the same problem and we get some working solution to this problem. The bad news are related with gradle version plugin. With this solution you are tied to gradle 1.3 version because espresso gradle script we are using is looking for a task that is present in 1.3 gradle versiĆ³n and not in the following versions.
So this is not the best approach ever, but it works and solves our problem. Anyway if someone can help to not be tied to any gradle version it would be great.
I give you a link with our solution: https://github.com/GigigoGreenLabs/JarJarDagger2Example
You have similar tools to jarjar that you can use, have a look at:
https://github.com/musketyr/gradle-fatjar-plugin
Gradle shadow plugin or maven shade plugin if you are using maven.
Hope this helps!
I am getting this error when I Run or Debug the app but when I build or clean my project there are no errors. It sounds strange but I've wasted my 4-5 hours searching for this but nothing was helpful.
Error:
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.> java.io.FileNotFoundException: C:\Users\Saeed Jassani\Downloads\AppName\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\8.4.0\jars\classes.jar (The system cannot find the path specified)
build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 9
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:recyclerview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.1.1'
}
You can fix this by using alpha6:
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}
Clean your project and add following dependencies in your project level build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
}