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
Related
I want to add android.support to project:
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
maven{
url "https://maven.google.com"
}
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.myapplication2_gradle26_3.app"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
}
and when sync the gralde this error fired
Error:Gradle: Execution failed for task ':app:processDebugManifest'.
Error: [E:\AndroidExamples\MyApplication2-gradle26-3\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\26.0.0-alpha1\AndroidManifest.xml:21]
Invalid instruction 'overrideLibrary', valid instructions are :
REMOVE,REPLACE,STRICT
the project sync successfully when i add appcompat-v7:22.+ but not when want to add appcompat-v7:26.0.0-alpha1
i tried to update gradle but IDE errored 'u cant use this version'
my IDE is IntelliJ 13.1.15
Update the Android Plugin for Gradle.
Change:
classpath 'com.android.tools.build:gradle:0.12.2'
with:
classpath 'com.android.tools.build:gradle:2.3.3'
Also there is no reason to use an alpha version of appcompat. Use the latest stable version of the support libraries:
compile 'com.android.support:appcompat-v7:26.1.0'
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 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'
}
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!
I have used Robolectric before Android 1.1.0 but I cannot use it any more after I updated it. I Googled it and tried some solutions but none of them worked.
Here is my current settings:
project.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'com.github.jcandksolutions.gradle:android-unit-test:2.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
app.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "my_package_name"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'android-unit-test'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:recyclerview-v7:21.0.3'
testCompile 'org.easytesting:fest:1.0.16'
testCompile 'junit:junit:4.10'
testCompile 'org.robolectric:robolectric:2.4'
testCompile 'com.squareup:fest-android:1.0.8'
}
When I try to build the project it gives me the error like below:
Error:(22) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'android-unit-test']
> No such property: bootClasspath for class: com.android.build.gradle.AppPlugin
Of course, I have android-unit-test plugin installed and removed and reinstalled it again but no luck.
Your answer would be appreciated.
Bad news: since Android Plugin 1.1.0 the plugin com.github.jcandksolutions.gradle:android-unit-test:2.1.1 is depricated. Also see https://github.com/JCAndKSolutions/android-unit-test#deprecation-notice
Good news: You don't need anymore a plugin for robolectric. Just remove apply plugin: 'android-unit-test' and all should work like before.
Here an examples project setup https://github.com/nenick/AndroidStudioAndRobolectric