Android Studio displayed this error message when I added the following line to the build.gradle line to the dependencies: compile 'com.android.volley:volley:1.0.0'
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.parse.starter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.parse:parse-android:1.13.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.jetbrains:annotations-java5:15.0'
compile 'com.android.volley:volley:1.0.0'
}
See if you have jcenter() in your repositories in your project gradle.
For example:
allprojects {
repositories {
jcenter()
maven {
}
ivy {
}
}
}
Related
i'am new on android application, i imported an application and i get this error dont know what to do.. someone here can help me!
there is my build.gradle file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.0 rc3"
}
and there is my app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "com.codeandcoder.finalguide"
minSdkVersion 15
targetSdkVersion 22
versionCode 2
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:appcompat-v7:22.2.1'
}
Move this:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
}
and
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:appcompat-v7:22.2.1'
}
to module/build.gradle
here is my code of build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.shadibazzar.delhibookstore"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
classpath 'com.google.gms:google-services:3.0.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile project(":volley")
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
Error:(28, 0) Gradle DSL method not found: 'compile()'
Possible causes:
The project 'Delhi Book Store' may be using a version of Gradle that
does not contain the method.
The build file may be missing a Gradle plugin.
It is very simple and the problem might be fundimental
i want to use GoogleSignInOptions, GoogleSignInResult, and Auth to implement google+ signin.
i am following the guides here are the gradle builds:
project build:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
allprojects {
repositories {
jcenter()
maven { url "http://jzaccone.github.io/SlidingMenu-aar" }
}
}
app build:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.ili.BDigital"
minSdkVersion 14
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':eventBrowser')
}
library (extra module) build:
apply plugin: 'com.android.library'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.code.gson:gson:2.3'
compile 'com.etsy.android.grid:library:1.0.5'
compile 'com.jeremyfeinstein.slidingmenu:library:1.3#aar'
compile 'com.jakewharton:butterknife:4.0.1'
compile 'com.pubnub:pubnub:3.7.5'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.wefika:horizontal-picker:1.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile files('libs/com.haarman.listviewanimations-2.5.2.jar')
compile files('libs/google-play-services.jar')
compile files('libs/htmlcleaner-2.8.jar')
compile files('libs/socialauth-4.9.jar')
compile files('libs/socialauth-android-3.2.jar')
}
/*
compile 'com.pubnub:pubnub-android-debug:3.7.+'
compile 'javax.inject:javax.inject:1#jar'
compile 'com.squareup.dagger:dagger-compiler:1.1.0'
compile 'com.jakewharton:butterknife:4.0.1'
compile 'com.squareup.dagger:dagger:1.1.0'
compile 'com.github.pedrovgs:renderers:1.0.9'
compile 'com.google.gms:google-services:2.0.0-rc1'
*/
I've been stuck on this for a day and it's driving me insane
UPDATE: I removed "compile files('libs/google-play-services.jar')" and now even R is giving me "cannot resolve symbol"
Try to add this line in the bottom of your build.gradle file (which you import your dependency)
apply plugin: 'com.google.gms.google-services'
I'm building android application and I have problem to build it. My build.gradle file contains:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.nakupniseznam"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
flatDir {
dirs 'aars'
}
}
}
dependencies {
//compile fileTree(include: ['*.jar'], dir: 'libs')
repositories {
maven {
url "http://dl.bintray.com/microsoftazuremobile/SDK"
}
}
compile files('libs/notification-hubs-0.3.jar')
compile files('libs/azure-notifications-handler-1.0.1.jar')
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.guava:guava:18.0'
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'
compile 'com.microsoft.azure:azure-notifications-handler:1.0.1#jar'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.2.0'
}
And the build error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/microsoft/windowsazure/notifications/BuildConfig.class
Still the same error.
Try to exclude multidex, but without success and I really don't know why :(
Hie...I am trying to connect to Parse.com but I keep getting the same error over and over again.
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class
I tried everything I found but nothing seems to help. Any help will be greatly appreciated. Thank you.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.kudzai.picabay"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
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'
compile 'com.android.support:multidex:1.+'
compile 'com.parse:parse-android:1.+'
compile files('libs/bolts-android-1.2.1.jar')
}
Try this build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.parse'
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.parse.com/repo' }
}
dependencies {
classpath 'com.parse.tools:gradle:1.+'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.kudzai.picabay"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:multidex:1.+'
compile 'com.parse.bolts:bolts-android:1.2.1'
compile 'com.parse:parse-android:1.10.3'
}