I don't understand why this is happening.
Gradle sync failed: Timeout waiting to lock buildscript class cache for build file '/Users/user/Documents/android-studio-pubble/App/build.gradle' (/Users/user/.gradle/caches/2.2.1/scripts/build_bqh4uod6cat7u5cm5qkoye2ky/ProjectScript/buildscript). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 909
Owner Operation: unknown
Our operation: Initialize cache
Lock file: /Users/user/.gradle/caches/2.2.1/scripts/build_bqh4uod6cat7u5cm5qkoye2ky/ProjectScript/buildscript/cache.properties.lock
Consult IDE log for more details (Help | Show Log)
general gladle is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url '/Users/user/Documents/sdk/extras/android/m2repository' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
}
App gradle file is:
apply plugin: 'com.android.application'
android {
signingConfigs {
pubblemod {
keyAlias 'testapp'
keyPassword 'testapp'
storeFile file('/Users/user/Documents/sdk/testapp.keystore')
storePassword 'testapp'
}
}
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.test.app"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.intellij:annotations:+#jar'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:support-v13:22.0.+'
compile 'org.apache.commons:commons-lang3:3.2.+'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.afollestad:material-dialogs:0.7.7.0'
compile 'it.neokree:MaterialTabs:0.11'
compile 'com.github.johnkil.android-appmsg:appmsg:1.2.0'
compile 'com.cocosw:bottomsheet:1.+#aar'
compile 'de.psdev.licensesdialog:licensesdialog:1.7.0'
compile 'com.afollestad:material-dialogs:0.7.7.0'
compile 'joda-time:joda-time:2.7'
compile 'com.google.android.gms:play-services:3.1+'
compile project(':loadingLibrary')
compile project(':welcomeLibrary')
// compile project(':licenceDialogLibrary')
compile project(':Bootstrap')
}
It used to work and then i wanted to add a new module and it all went downwards after that. Does anyone had this problem and solved it? I don't even know what is wrong..or how i made this.
The easiest way to solve this is to be delete a cache.
For Windows it's under C:\Users\Administrator\.gradle\caches
For Mac OSX it's ~/.gradle/caches
Try to execute the following command:
find ~/.gradle -type f -name "*.lock" | while read f; do rm $f; done
Related
I'm new to android, so please bear with me if my question is stupid.
I have an android project built in older version of gradle. The app works fine when modifying code in existing activities, but whenever I create a new activity, I get the following error:
Error:(77, 13) Failed to resolve: com.android.support.constraint:constraint-layout:1.0.2
Upgrade plugin to version 3.0.1 and sync project
Show in File
Show in Project Structure dialog
This is the content of app level gradle file:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias ''
keyPassword ''
storeFile file('')
storePassword ''
}
}
compileSdkVersion 27
buildToolsVersion "23.0.2"
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
defaultConfig {
applicationId ""
minSdkVersion 15
targetSdkVersion 22
multiDexEnabled true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
repositories {
jcenter()
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
incremental true
}
productFlavors {
}
}
dependencies {
//compile fileTree(include: ['*.jar'], dir: 'libs')
//Fast and simple data storage library for Android
// compile project(':squarecamera')
// compile 'com.github.boxme:squarecamera:1.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.6'
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'io.paperdb:paperdb:0.9'
compile 'com.fabiendevos:nanotasks:1.1.0'
compile 'com.flipboard:bottomsheet-core:1.5.0'
compile 'com.flipboard:bottomsheet-commons:1.5.0'
compile 'com.android.support:design:23.1.1'
compile 'com.squareup.okhttp:okhttp:1.6.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:1.6.0'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-jackson:2.0.0-beta2'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile project(':squarecamera')
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
This is my project level gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
And my android studio version is 3.0.1.
When I update the plugin, I get a lot of compatibility issues.
Please help me resolve this. Thanks in advance!
I tried to build apk it comes out this. What should I do? Please help!!
I don't where is the problem. The project is fine when I build the project, but it come error when I build apk.
Error:Execution failed for
task':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/auth/api/signin/internal/zzf.class
Here is the gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId 'com.androidbelieve.SeeDate'
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
useLibrary 'org.apache.http.legacy'
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
productFlavors {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:support-v4:22.2.1'
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.code.findbugs:jsr305:2.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.firebase:firebase-client-android:2.5.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.firebaseui:firebase-ui:0.6.0'
}
apply plugin: 'com.google.gms.google-services'
gradle project
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Did you tried Build/Clean Project in Android Studio Menu
Which dependency does the app:transformClassesWithJarMergingForDebug come from? Maybe you should modify that dependency's version number to be consistent with the major sdk version.
I'm trying to import a Jgrapht library in my app, but every time i try to build APK, android studio shows me:
Error:Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForDebug'.
com.android.sched.scheduler.RunnerProcessException: Error during 'TypeLegalizer' runner on 'private final synthetic int org.jgrapht.alg.vertexcover.-$Lambda$25.$m$0(java.lang.Object arg0)': Unexpected error during visit: com.android.jack.ir.ast.JReturnStatement at "Unknown source info"
What is the problem and how i can fix it? Please help me!
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
defaultConfig {
applicationId "it.univpm.gruppoids.iotforemergencyandnavigation"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
compileOptions {
incremental true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
repositories {
maven {
url "https://mint.splunk.com/gradle/"
}
}
packagingOptions {
exclude 'META-INF/services/org.apache.sis.storage.DataStoreProvider'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
}
/*buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}*/
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:percent:25.0.0'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.journeyapps:zxing-android-embedded:3.2.0#aar'
compile 'com.google.zxing:core:3.2.1'
compile files('lib/jgrapht-ext-1.0.0-uber.jar')
compile files('lib/jgrapht-ext-1.0.0.jar')
compile files('lib/jgrapht-demo-1.0.0.jar')
compile files('lib/jgraph-5.13.0.0.jar')
compile files('lib/antlr4-runtime-4.5.3.jar')
compile files('lib/jgrapht-core-1.0.0.jar')
}
And the other gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
/*maven {
url "https://plugins.gradle.org/m2/"
}*/
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'me.tatarka:gradle-retrolambda:3.3.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
apply plugin: 'me.tatarka.retrolambda'
task clean(type: Delete) {
delete rootProject.buildDir
}
The easiest way I can think of is to use maven, then simply add the dependencies to your project. That'll save you a lot of hassel in setting up JGraphT by yourself.
you can find how to use maven with android studio here: How to import Maven dependency in Android Studio/IntelliJ?
While JGraphT's dependencies are here under the "Maven Releases" section:
http://jgrapht.org/
After adding the Espresso test files I got the error. I tried many suggestions, nothing helped so far.
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/test/BuildConfig;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
The app build.gradle is:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keystore stuff ...
}
}
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId ...
minSdkVersion 16
targetSdkVersion 19
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'LICENSE.txt'
}
}
dependencies {
compile 'com.android.support:support-v4:22.1.0'
compile 'com.google.code.gson:gson:2.4'
compile 'joda-time:joda-time:2.0'
compile files('libs/commons-io-2.4.jar')
compile files('libs/commons-lang3-3.4.jar')
compile files('libs/exp4j-0.4.4.jar')
compile files('libs/GraphView-3.1.2.jar')
compile files('libs/mapsforge-map-0.3.1-SNAPSHOT-jar-with-dependencies.jar')
compile files('libs/osmbonuspack_v5.1.jar')
compile files('libs/osmdroid-android-4.3.jar')
compile files('libs/slf4j-android-1.5.8.jar')
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
compile 'com.android.support:support-annotations:22.2.0'
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
}
allprojects {
repositories {
jcenter()
}
}
I tried many suggestions in this area, I hope you can help.
Based on the answer here and your config file, could you remove the following line from your gradle and give it a shot.
com.android.support.test:testing-support-lib:0.1
I'm new to Gradle, and downloaded a project from a repository at work.
When I open the project, Gradle cannot sync.
Error:Could not find org.robobinding:codegen:0.8.9.
Searched in the following locations:
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/android/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.pom
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/android/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.jar
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/google/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.pom
file:/C:/Users/Marcelo/AppData/Local/Android/sdk/extras/google/m2repository/org/robobinding/codegen/0.8.9/codegen-0.8.9.jarRequired by:
GollogAndroidApp:gollog:unspecified
Acording to this log error, I guess that Gradle is not searching Robobinding online. I looked at work offline configuration of Gradle at Android Studion and is not checked.
Here is my gradle.build
buildscript {
repositories {
jcenter()
maven() {
name 'RoboBinding AspectJPlugin Maven Repository'
url "https://github.com/RoboBinding/RoboBinding-aspectj-plugin/raw/master/mavenRepo"
}
}
dependencies {
classpath 'org.robobinding:aspectj-plugin:0.8.4'
classpath 'com.android.tools.build:gradle:1.1.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.6'
}
}
apply plugin: 'com.android.application'
apply plugin: 'org.robobinding.android-aspectj'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
lintOptions{
ignoreWarnings true
}
defaultConfig {
applicationId "br.com.fake.fakeproject"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
productFlavors {
dev {
applicationId "br.com.edeploy.fake.fakeproject"
}
prod {
applicationId "br.com.edeploy.fake.fakeproject"
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
ext {
//robobindingVersion = 'latest.integration'
daggerVersion = '1.2.2'
robobindingVersion = '0.8.9'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'info.hoang8f:android-segmented:1.0.6'
compile 'com.android.support:support-v4:23.0.1'
compile 'net.danlew:android.joda:2.8.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") {
exclude group: 'com.google.guava', module: 'guava'
}
aspectPath("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") {
exclude group: 'com.google.guava', module: 'guava'
}
apt "org.robobinding:codegen:$robobindingVersion"
compile 'com.google.auto.value:auto-value:1.1'
apt "com.squareup.dagger:dagger-compiler:$daggerVersion"
compile "com.squareup.dagger:dagger:$daggerVersion"
/*provided "org.glassfish:javax.annotation:10.0-b28"*/
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:1.10.19"
}
I have Android and Google repository updated.
I'm using Android Studio 1.4
Tks!
You defined the repository only for your buildscript - not for the project - add this:
repositories {
jcenter()
}
on root level behind: apply plugin: 'com.neenbedankt.android-apt'