Related
I am very new to Android Development. Whenever I started Android Studio I get in Event Log panel:
03/06/2020
21:23 Gradle sync started
21:23 * daemon not running; starting now at tcp:5038
21:23 * daemon started successfully
21:23 Gradle sync finished in 2 s 618 ms (from cached state)
I guess such daemon is the Android Emulator somehow manage by ADB server. I see soon I start Android Studio:
C:\Users\cast>netstat -ano | findstr "5038"
TCP 127.0.0.1:5038 0.0.0.0:0 LISTENING 4976
TCP 127.0.0.1:5038 127.0.0.1:62710 ESTABLISHED 4976
TCP 127.0.0.1:62710 127.0.0.1:5038 ESTABLISHED 13332
Mine is 5038 instead of 5037 because I created a Windows System Environment variable for learning purposes: ANDROID_ADB_SERVER_PORT
From idea.log I see
2020-06-03 21:23:53,286 [ 9135] INFO - roid.tools.idea.adb.AdbService - Initializing adb using: C:\Users\Cast\AppData\Local\Android\Sdk\platform-tools\adb.exe
So I easily guess it triggers automatically during Android Studio initializion adb.exe start-server
If so, I would expect get some result from command bellow but I don't at all
C:\Users\Cast\AppData\Local\Android\Sdk\platform-tools>adb devices -l
List of devices attached
C:\Users\Cast\AppData\Local\Android\Sdk\platform-tools>
So, my straight question is: if possible, how disable such automatic startup?
Some usefull comments that may help me reach a solution for my issue is:
1) is this daemon started by Android Studio or by Gradle somehow?
2) Does Android Studio really depends on this daemon up and running while I am not running neither debugging the application. Let's say I only want to browse the project code. Well, since I have Angular/Java background I can't understand why starting a server if I don't want.
3) why two ESTABLISHED connections and on LISTENNING and soon I start run/debug the application I got many more connections?
In case it is relavant, here is my AVD
C:\Users\Cast\AppData\Local\Android\Sdk\emulator>emulator -list-avds
Pixel_3a_API_28
Here are my whole Android Studio logs during startup
2020-06-03 21:23:44,151 [ 0] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
2020-06-03 21:23:44,204 [ 53] INFO - #com.intellij.idea.Main - JNA library (64-bit) loaded in 38 ms
2020-06-03 21:23:44,251 [ 100] INFO - #com.intellij.idea.Main - IDE: Android Studio (build #AI-193.6911.18.40.6514223, 20 May 2020 12:07)
2020-06-03 21:23:44,251 [ 100] INFO - #com.intellij.idea.Main - OS: Windows 10 (10.0, amd64)
2020-06-03 21:23:44,251 [ 100] INFO - #com.intellij.idea.Main - JRE: 1.8.0_242-release-1644-b01 (JetBrains s.r.o)
2020-06-03 21:23:44,251 [ 100] INFO - #com.intellij.idea.Main - JVM: 25.242-b01 (OpenJDK 64-Bit Server VM)
2020-06-03 21:23:44,251 [ 100] INFO - #com.intellij.idea.Main - JVM Args: exit -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Djna.nosys=true -Djna.boot.library.path= -Djb.vmOptionsFile=C:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions -Djava.library.path=C:\Program Files\Android\Android Studio\jre\jre\bin;C:\Program Files\Android\Android Studio\jre\jre\bin\server -Didea.platform.prefix=AndroidStudio -Didea.jre.check=true -Dide.native.launcher=true -Didea.paths.selector=AndroidStudio4.0 -XX:ErrorFile=C:\Users\Cast\java_error_in_studio_%p.log -XX:HeapDumpPath=C:\Users\Cast\java_error_in_studio.hprof
2020-06-03 21:23:44,251 [ 100] INFO - #com.intellij.idea.Main - ext: C:\Program Files\Android\Android Studio\jre\jre\lib\ext: [access-bridge-64.jar, cldrdata.jar, dnsns.jar, jaccess.jar, localedata.jar, meta-index, nashorn.jar, sunec.jar, sunjce_provider.jar, sunmscapi.jar, sunpkcs11.jar, zipfs.jar]
2020-06-03 21:23:44,251 [ 100] INFO - #com.intellij.idea.Main - charsets: JNU=Cp1252 file=Cp1252
2020-06-03 21:23:44,367 [ 216] INFO - ntellij.idea.ApplicationLoader - CPU cores: 8; ForkJoinPool.commonPool: java.util.concurrent.ForkJoinPool#7cc9ae70[Running, parallelism = 7, size = 0, active = 0, running = 0, steals = 0, tasks = 0, submissions = 0]; factory: com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory#20ce88a8
2020-06-03 21:23:44,605 [ 454] INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational
2020-06-03 21:23:45,075 [ 924] INFO - llij.ide.plugins.PluginManager - Plugin "Groovy" misses optional descriptor duplicates-groovy.xml
2020-06-03 21:23:45,075 [ 924] INFO - llij.ide.plugins.PluginManager - Plugin "Groovy" misses optional descriptor duplicates-detection-groovy.xml
2020-06-03 21:23:45,191 [ 1040] INFO - llij.ide.plugins.PluginManager - Plugin "Java" misses optional descriptor profiler-java.xml
2020-06-03 21:23:45,297 [ 1146] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: Android APK Support (1.0), Android Games (1.0), Android NDK Support (1.0), Android Support (10.4.0), App Links Assistant (0.1), ChangeReminder (193.6911.18.40.6514223), Compose (0.1.0-dev03), Configuration Script (193.6911.18.40.6514223), Copyright (193.6911.18.40.6514223), Coverage (193.6911.18.40.6514223), EditorConfig (193.6911.18.40.6514223), Firebase App Indexing (0.1), Firebase Services (0.1), Firebase Testing (1.0), Git (193.6911.18.40.6514223), GitHub (193.6911.18.40.6514223), Google Cloud Tools Core (0.2.8), Google Cloud Tools For Android Studio (0.2.8), Google Developers Samples (0.3.1), Google Login (1.0), Google Services (0.1), Gradle (193.6911.18.40.6514223), Gradle-Java (193.6911.18.40.6514223), Groovy (193.6911.18.40.6514223), IDEA CORE (193.6911.18.40.6514223), IntelliLang (193.6911.18.40.6514223), JUnit (193.6911.18.40.6514223), Java (193.6911.18.40.6514223), Java Bytecode Decompiler (193.6911.18.40.6514223), Java IDE Customization (193.6911.18.40.6514223), Java Internationalization (193.6911.18.40.6514223), Java Stream Debugger (193.6911.18.40.6514223), Kotlin (1.3.72-release-Studio4.0-1), Layoutlib Native (1.0), Layoutlib Standard (1.0), Mercurial (193.6911.18.40.6514223), Properties (193.6911.18.40.6514223), Settings Repository (193.6911.18.40.6514223), Shell Script (193.6911.18.40.6514223), Smali Support (193.6911.18.40.6514223), Subversion (193.6911.18.40.6514223), Task Management (193.6911.18.40.6514223), Terminal (193.6911.18.40.6514223), Test Recorder (1.0), TestNG (193.6911.18.40.6514223), TextMate bundles (193.6911.18.40.6514223), YAML (193.6911.18.40.6514223)
2020-06-03 21:23:46,141 [ 1990] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=1217
2020-06-03 21:23:46,156 [ 2005] INFO - tellij.util.io.FileChannelUtil - interruptible FileChannel-s will be used for indexes
2020-06-03 21:23:46,210 [ 2059] INFO - com.intellij.ide.ui.UISettings - Loaded: fontSize=13, fontScale=1.0; restored: fontSize=13, fontScale=1.0
2020-06-03 21:23:46,279 [ 2128] INFO - til.net.ssl.CertificateManager - Default SSL context initialized
2020-06-03 21:23:46,294 [ 2143] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342
2020-06-03 21:23:46,294 [ 2143] INFO - pl.local.NativeFileWatcherImpl - Starting file watcher: C:\Program Files\Android\Android Studio\bin\fsnotifier64.exe
2020-06-03 21:23:46,326 [ 2175] INFO - pl.local.NativeFileWatcherImpl - Native file watcher is operational.
2020-06-03 21:23:46,341 [ 2190] INFO - gs.impl.UpdateCheckerComponent - channel: release
2020-06-03 21:23:46,473 [ 2322] WARN - nSystem.impl.ActionManagerImpl - keymap "ReSharper" not found [Plugin: com.android.tools.ndk]
2020-06-03 21:23:47,197 [ 3046] INFO - pl$FileIndexDataInitialization - Initialization done: 970
2020-06-03 21:23:47,360 [ 3209] INFO - exImpl$StubIndexInitialization - Initialization done: 154
2020-06-03 21:23:48,415 [ 4264] INFO - pl.projectlevelman.NewMappings - VCS Root: [Git] - [C:/WSs/FireStoreDemos]
2020-06-03 21:23:50,388 [ 6237] INFO - artup.AndroidStudioInitializer - Failed to disable 'org.intellij.plugins.intelliLang.inject.groovy.GrConcatenationInjector'
2020-06-03 21:23:50,495 [ 6344] INFO - j.ide.script.IdeStartupScripts - 0 startup script(s) found
2020-06-03 21:23:51,118 [ 6967] WARN - ugins.textmate.TextMateService - Missing builtin bundles, checked:
C:/Users/Cast/.AndroidStudio4.0/config/plugins/textmate/lib/bundles
C:/Program Files/Android/Android Studio/plugins/textmate/lib/bundles
2020-06-03 21:23:51,129 [ 6978] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 162ms; general responsiveness: ok; EDT responsiveness: ok
2020-06-03 21:23:51,527 [ 7376] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.highlighter.KotlinDefaultHighlightingSettingsProvider
2020-06-03 21:23:52,853 [ 8702] INFO - ngd.lsp.ClangDaemonContextImpl - Using clangd from: C:\Program Files\Android\Android Studio\bin\clang\win\clangd.exe
2020-06-03 21:23:52,925 [ 8774] INFO - .diagnostic.PerformanceWatcher - Post-startup activities under progress took 2120ms; general responsiveness: ok; EDT responsiveness: 1/2 sluggish
2020-06-03 21:23:53,024 [ 8873] INFO - tartup.impl.StartupManagerImpl - C:/WSs/FireStoreDemos/AppFirestore/.idea case-sensitivity: expected=false actual=false
2020-06-03 21:23:53,172 [ 9021] INFO - tor.impl.FileEditorManagerImpl - Project opening took 5355 ms
2020-06-03 21:23:53,191 [ 9040] INFO - #git4idea.commands.GitHandler - [.] git version
2020-06-03 21:23:53,286 [ 9135] INFO - roid.tools.idea.adb.AdbService - Initializing adb using: C:\Users\Cast\AppData\Local\Android\Sdk\platform-tools\adb.exe
2020-06-03 21:23:53,958 [ 9807] INFO - #git4idea.commands.GitHandler - git version 2.13.3.windows.1
2020-06-03 21:23:54,041 [ 9890] INFO - ea.config.GitExecutableManager - Git version for C:\Program Files\Git\cmd\git.exe : 2.13.3
2020-06-03 21:23:54,860 [ 10709] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 3730ms; general responsiveness: ok; EDT responsiveness: 1/3 sluggish
2020-06-03 21:23:54,877 [ 10726] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 4 ms
2020-06-03 21:23:54,884 [ 10733] INFO - #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files
2020-06-03 21:23:55,107 [ 10956] INFO - #com.jetbrains.cidr.lang - Loading symbols finished in 230 ms
2020-06-03 21:23:55,111 [ 10960] INFO - #com.jetbrains.cidr.lang - Loading Header Maps finished in 4 ms
2020-06-03 21:23:55,134 [ 10983] INFO - #com.jetbrains.cidr.lang - Loading Module Maps finished in 22 ms
2020-06-03 21:23:55,135 [ 10984] INFO - #com.jetbrains.cidr.lang - Loaded 0 module maps in 0 packs for 0 search roots
2020-06-03 21:23:55,136 [ 10985] INFO - #com.jetbrains.cidr.lang - Saved 0 module maps in 0 packs
2020-06-03 21:23:55,136 [ 10985] INFO - #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 ms
2020-06-03 21:23:55,136 [ 10985] INFO - #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files)
2020-06-03 21:23:55,138 [ 10987] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 source files
2020-06-03 21:23:55,145 [ 10994] INFO - #com.jetbrains.cidr.lang - Updating Symbols finished in 4 ms
2020-06-03 21:23:55,145 [ 10994] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 unused headers
2020-06-03 21:23:55,149 [ 10998] INFO - #com.jetbrains.cidr.lang - Updating Symbols finished in 2 ms
2020-06-03 21:23:55,149 [ 10998] INFO - #com.jetbrains.cidr.lang - Updating Symbols finished in 2 ms
2020-06-03 21:23:55,149 [ 10998] INFO - #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0)
2020-06-03 21:23:55,152 [ 11001] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 3 ms
2020-06-03 21:23:55,523 [ 11372] INFO - ge.ExternalProjectsDataStorage - Load external projects data in 339 millis (read time: 323)
2020-06-03 21:23:56,008 [ 11857] INFO - e.project.sync.GradleSyncState - Started single-variant sync with Gradle for project 'AppFirestore'.
2020-06-03 21:23:56,126 [ 11975] INFO - e.project.sync.GradleSyncState - Started setup of project 'AppFirestore'.
2020-06-03 21:23:56,455 [ 12304] WARN - #com.android.ddmlib - * daemon not running; starting now at tcp:5038
2020-06-03 21:23:56,524 [ 12373] WARN - #com.android.ddmlib - * daemon started successfully
2020-06-03 21:23:56,540 [ 12389] INFO - #com.android.ddmlib - Connected to adb for device monitoring
2020-06-03 21:23:56,742 [ 12591] INFO - roid.tools.idea.adb.AdbService - Successfully connected to adb
2020-06-03 21:23:56,993 [ 12842] INFO - rationStore.ComponentStoreImpl - Saving appJavaCodeFoldingSettings took 16 ms
2020-06-03 21:23:57,061 [ 12910] INFO - ge.ExternalProjectsDataStorage - Save external projects data in 33 ms
2020-06-03 21:23:57,156 [ 13005] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptInputsWatcher$Storage
2020-06-03 21:23:57,203 [ 13052] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.core.script.configuration.utils.ScriptClassRootsStorage
2020-06-03 21:23:57,240 [ 13089] INFO - rationStore.ComponentStoreImpl - Saving Project (name=AppFirestore, containerState=ACTIVE, componentStore=C:\WSs\FireStoreDemos\AppFirestore) CompilerConfiguration took 15 ms, GradleMigrationSettings took 16 ms, ProjectCodeStyleConfiguration took 31 ms, ProjectView took 16 ms, libraryTable took 16 ms, navEditor-manualLayoutAlgorithm2 took 15 ms
2020-06-03 21:23:57,810 [ 13659] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 29 Platform' (C:/Users/Cast/AppData/Local/Android/Sdk) to module 'app'
2020-06-03 21:23:58,263 [ 14112] INFO - pl.ProjectRootManagerComponent - project roots have changed
2020-06-03 21:23:58,347 [ 14196] INFO - pl.ProjectRootManagerComponent - project roots have changed
2020-06-03 21:23:58,363 [ 14212] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 0ms; general responsiveness: ok; EDT responsiveness: ok
2020-06-03 21:23:58,394 [ 14243] INFO - testKnownPluginVersionProvider - 'gradle' plugin missing from the offline Maven repo, will use default 4.0.0
2020-06-03 21:23:58,394 [ 14243] INFO - .MemorySettingsPostSyncChecker - 64bits? : true, current: 1280, available RAM: 16238
2020-06-03 21:23:58,410 [ 14259] INFO - s.MemorySettingsRecommendation - recommendation based on machine: 3072, on project: 1280
2020-06-03 21:23:58,494 [ 14343] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 131ms; general responsiveness: ok; EDT responsiveness: ok
2020-06-03 21:23:58,510 [ 14359] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2020-06-03 21:23:58,610 [ 14459] INFO - pl.ProjectRootManagerComponent - project roots have changed
2020-06-03 21:23:58,626 [ 14475] INFO - e.project.sync.GradleSyncState - Gradle sync finished in 2 s 618 ms (from cached state)
2020-06-03 21:23:58,711 [ 14560] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 16ms; general responsiveness: ok; EDT responsiveness: ok
2020-06-03 21:23:58,711 [ 14560] INFO - roid.tools.ndk.GradleWorkspace - Updating model took 0.063s
2020-06-03 21:23:58,811 [ 14660] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 100ms; general responsiveness: ok; EDT responsiveness: ok
2020-06-03 21:24:00,152 [ 16001] INFO - CompilerWorkspaceConfiguration - Available processors: 8
2020-06-03 21:24:16,176 [ 32025] INFO - rationStore.ComponentStoreImpl - Saving Module: 'app'FacetManager took 22 ms
2020-06-03 21:24:16,207 [ 32056] INFO - rationStore.ComponentStoreImpl - Saving Project (name=AppFirestore, containerState=ACTIVE, componentStore=C:\WSs\FireStoreDemos\AppFirestore) libraryTable took 15 ms
2020-06-03 21:26:00,091 [ 135940] INFO - rationStore.ComponentStoreImpl - Saving Project (name=AppFirestore, containerState=ACTIVE, componentStore=C:\WSs\FireStoreDemos\AppFirestore) ProjectCodeStyleConfiguration took 19 ms, libraryTable took 15 ms
2020-06-03 21:34:43,881 [ 659730] INFO - rationStore.ComponentStoreImpl - Saving Project (name=AppFirestore, containerState=ACTIVE, componentStore=C:\WSs\FireStoreDemos\AppFirestore) GradleSettings took 16 ms, libraryTable took 15 ms
And my gradle builds
build.gradle (project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
defaultConfig {
applicationId "com.mycomp.appfirestore"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// Firebase Libraries
implementation 'com.google.firebase:firebase-core:17.4.2'
implementation 'com.google.firebase:firebase-auth:19.3.1'
implementation 'com.google.firebase:firebase-database:19.3.0'
implementation 'com.google.firebase:firebase-storage:19.1.1'
//Firestore Libraries
implementation 'com.google.firebase:firebase-firestore:21.2.1'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
//https://stackoverflow.com/a/49645970/4148175
implementation 'com.android.support:multidex:1.0.3'
}
*** edited
C:\Users\Cast\AppData\Local\Android\Sdk\platform-tools>netstat -ano | findstr "5038"
TCP 127.0.0.1:5038 0.0.0.0:0 LISTENING 19440
TCP 127.0.0.1:5038 127.0.0.1:63707 ESTABLISHED 19440
TCP 127.0.0.1:63707 127.0.0.1:5038 ESTABLISHED 14520
C:\Users\Cast\AppData\Local\Android\Sdk\platform-tools>taskkill /pid 19440 /f
and then in Android Studio
04/06/2020
05:43 * daemon not running; starting now at tcp:5038
05:43 * daemon started successfully
05:43 Gradle sync started
05:43 Gradle sync finished in 1 s 749 ms (from cached state)
05:44 Adb connection Error:Foi forçado o cancelamento de uma conexão existente pelo host remoto
05:44 Cannot reach ADB server, attempting to reconnect.
05:44 * daemon not running; starting now at tcp:5038
05:44 * daemon started successfully
I followed the android developer website instructions for enabling MultiDex. But gradle sync fails when I add those lines. This is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.vvaezian.multilingovocabularypractice"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true // <----- added ------
}
buildTypes {
debug {
buildConfigField 'String', "ApiKey", MultiLingo_ApiKey
}
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField 'String', "ApiKey", MultiLingo_ApiKey
}
}
packagingOptions {
exclude 'project.properties'
exclude 'META-INF/INDEX.LIST'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2')
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.mcxiaoke.volley:library:1.0.19'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation('com.google.cloud:google-cloud-translate:1.3.1') {
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.json', module: 'json'
}
annotationProcessor 'com.google.cloud:google-cloud-translate:1.3.1'
implementation 'com.android.support:multidex:1.0.3' // <----- added ----
}
Also when I add android:name="android.support.multidex.MultiDexApplication to manifest.xml it says unresolved class 'MultiDexApplication', which I guess is because gradle sync failed.
I couldn't find the cause of failure of gradle sync in the logs:
2018-07-28 19:25:09,721 [e-1024-b01] INFO - e.project.sync.GradleSyncState - Started sync with Gradle for project 'MultiLingoVocabularyPractice'.
2018-07-28 19:25:09,723 [e-1024-b01] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SYNC_STARTED
2018-07-28 19:25:09,723 [e-1024-b01] INFO - idea.project.IndexingSuspender - Starting batch update for project: Project '/local-scratch/vvaezian/AndroidStudioProjects/MultiLingoVocabularyPractice' MultiLingoVocabularyPractice
2018-07-28 19:25:09,732 [ thread 26] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /local-scratch/vvaezian/android-studio/jre
2018-07-28 19:25:09,734 [ thread 26] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /local-scratch/vvaezian/android-studio/jre
2018-07-28 19:25:09,746 [ thread 26] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=3.1 -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.model.only.versioned=3 -Pandroid.injected.studio.version=3.1.3.0 -Pandroid.builder.sdkDownload=false --init-script /tmp/ijinit.gradle
2018-07-28 19:25:12,471 [ thread 26] INFO - e.project.sync.GradleSyncState - Started setup of project 'MultiLingoVocabularyPractice'.
2018-07-28 19:25:12,472 [e-1024-b01] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SETUP_STARTED
2018-07-28 19:25:12,494 [ thread 36] INFO - idea.project.IndexingSuspender - Indexing suspended (context: Project Setup)
2018-07-28 19:25:12,907 [e-1024-b01] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 26 Platform (1)' (/local-scratch/vvaezian/SDK) to module 'app'
2018-07-28 19:25:12,925 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/build-tools/26.0.1/package.xml
2018-07-28 19:25:12,933 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/build-tools/27.0.3/package.xml
2018-07-28 19:25:12,941 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/emulator/package.xml
2018-07-28 19:25:12,947 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/android/m2repository/package.xml
2018-07-28 19:25:12,954 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/google/m2repository/package.xml
2018-07-28 19:25:12,960 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.2/package.xml
2018-07-28 19:25:12,967 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/extras/m2repository/com/android/support/constraint/constraint-layout/1.0.2/package.xml
2018-07-28 19:25:12,974 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/patcher/v4/package.xml
2018-07-28 19:25:12,980 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platform-tools/package.xml
2018-07-28 19:25:12,989 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-23/package.xml
2018-07-28 19:25:12,995 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-24/package.xml
2018-07-28 19:25:13,001 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-25/package.xml
2018-07-28 19:25:13,007 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/platforms/android-26/package.xml
2018-07-28 19:25:13,012 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/sources/android-26/package.xml
2018-07-28 19:25:13,017 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/system-images/android-24/google_apis_playstore/x86/package.xml
2018-07-28 19:25:13,022 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/system-images/android-26/google_apis/x86/package.xml
2018-07-28 19:25:13,033 [ thread 37] INFO - s.RepoProgressIndicatorAdapter - Parsing /local-scratch/vvaezian/SDK/tools/package.xml
2018-07-28 19:25:13,157 [ thread 35] INFO - e.project.sync.GradleSyncState - Gradle sync failed (3s 435ms)
2018-07-28 19:25:13,167 [e-1024-b01] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED
2018-07-28 19:25:13,167 [e-1024-b01] INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project '/local-scratch/vvaezian/AndroidStudioProjects/MultiLingoVocabularyPractice' MultiLingoVocabularyPractice
2018-07-28 19:25:13,173 [e-1024-b01] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-07-28 19:25:13,242 [ thread 36] INFO - idea.project.IndexingSuspender - Indexing released (context: Project Setup)
2018-07-28 19:25:13,246 [e-1024-b01] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-07-28 19:25:13,371 [ thread 36] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2018-07-28 19:25:13,371 [ thread 36] INFO - #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files
2018-07-28 19:25:13,413 [ thread 36] INFO - #com.jetbrains.cidr.lang - Loading Module Maps finished in 0 s.
2018-07-28 19:25:13,416 [ thread 36] INFO - #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-07-28 19:25:13,416 [ thread 36] INFO - #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-07-28 19:25:13,416 [ thread 36] INFO - #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files)
2018-07-28 19:25:13,418 [ thread 36] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 source files
2018-07-28 19:25:13,422 [ thread 36] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 unused headers
2018-07-28 19:25:13,434 [ thread 36] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2018-07-28 19:25:13,434 [ thread 36] INFO - #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0)
2018-07-28 19:25:13,435 [ thread 36] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
2018-07-28 19:25:13,505 [ thread 36] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 6ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-28 19:25:13,521 [ thread 36] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 15ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-28 19:25:13,521 [ thread 36] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 2 files to update
2018-07-28 19:25:13,571 [ thread 36] INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 50ms; general responsiveness: ok; EDT responsiveness: ok
Any help would be appreciated.
Seems your gradle file is OK. You have to include Multidex in your Application class:
public class YourApplicationClass extends Application {
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
And In AndroidManifest.xml file
<application
android:name=".YourApplicationClass"
android:allowBackup="true"
android:debuggable="true"
android:icon="#drawable/ic_launcher"
android:label="xyz"
android:theme="#style/AppTheme">
I have created an android app using firebase database, messages and storage. The app is running fine on emulator but creating a release build throws error
Error: java.util.concurrent.ExecutionException:
com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error:
check logs for details
I searched on the web about the error and found a few fixes. Here are a few things i have tried
rebuild and clean project
Invalidate cache and restart
Relocating project to counter the 256 character address limit
Checking all xml files for any silly mistake
Verifying all resouces and file names in res folder
I am stuck here for 2-3 days now and don't see any solution. My other project builds are working fine so i don't think it is a gradle related issue.
Here is my build.gradle project module
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is my build.gradle app module
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "infidev.wallpaperhd"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.commit451:PhotoView:1.2.4'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
}
apply plugin: 'com.google.gms.google-services'
Here is the error message shown in the Build tab
com.android.build.gradle.tasks.ResourceException: Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:296)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.java:332)
at com.android.ide.common.res2.DataMerger.mergeData(DataMerger.java:301)
at com.android.ide.common.res2.ResourceMerger.mergeData(ResourceMerger.java:412)
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:285)
... 48 more
Suppressed: java.lang.RuntimeException: Some file processing failed, see logs for details
at com.android.builder.internal.aapt.QueuedResourceProcessor.waitForAll(QueuedResourceProcessor.java:121)
at com.android.builder.internal.aapt.QueuedResourceProcessor.end(QueuedResourceProcessor.java:141)
at com.android.builder.internal.aapt.v2.QueueableAapt2.close(QueueableAapt2.java:104)
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:293)
... 48 more
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.java:327)
... 51 more
Caused by: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:462)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
at com.android.builder.internal.aapt.v2.QueueableAapt2.lambda$compile$0(QueueableAapt2.java:136)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
... 1 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details
at com.android.builder.png.AaptProcess$NotifierProcessOutput.handleOutput(AaptProcess.java:443)
at com.android.builder.png.AaptProcess$NotifierProcessOutput.err(AaptProcess.java:395)
at com.android.builder.png.AaptProcess$ProcessOutputFacade.err(AaptProcess.java:312)
at com.android.utils.GrabProcessOutput$1.run(GrabProcessOutput.java:104)
Any help will be appreciated.
Edit:
Here is the idea log after the failed build
2018-07-23 15:45:40,209 [ thread 36] INFO - e.project.sync.GradleSyncState - Started setup of project 'WallpapersHD'.
2018-07-23 15:45:40,209 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SETUP_STARTED
2018-07-23 15:45:40,272 [ thread 33] INFO - idea.project.IndexingSuspender - Indexing suspended (context: Project Setup)
2018-07-23 15:45:41,381 [e-1024-b02] INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 27 Platform' (C:\Users\Arun\AppData\Local\Android\Sdk) to module 'app'
2018-07-23 15:45:42,710 [ thread 36] INFO - etup.post.PluginVersionUpgrade - Gradle model version: 3.1.3, recommended version for IDE: 3.1.3
2018-07-23 15:45:42,803 [ thread 36] INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: [:app:generateDebugSources]
2018-07-23 15:45:42,850 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: BUILD_EXECUTOR_CREATED
2018-07-23 15:45:42,850 [ thread 36] INFO - e.project.sync.GradleSyncState - Gradle sync finished in 1m 45s 199ms
2018-07-23 15:45:42,866 [ thread 39] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2018-07-23 15:45:42,881 [ thread 39] INFO - ild.invoker.GradleBuildInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.generateSourcesOnly=true]
2018-07-23 15:45:42,881 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: BUILD_STARTED
2018-07-23 15:45:42,881 [ thread 33] INFO - idea.project.IndexingSuspender - Indexing released (context: Project Setup)
2018-07-23 15:45:42,897 [ thread 39] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: --configure-on-demand -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.generateSourcesOnly=true
2018-07-23 15:45:43,038 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED
2018-07-23 15:45:43,038 [e-1024-b02] INFO - idea.project.IndexingSuspender - IndexingSuspender deactivation event received and ignored: SYNC_FINISHED
2018-07-23 15:45:43,210 [ thread 40] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2018-07-23 15:45:43,210 [ thread 40] INFO - #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files
2018-07-23 15:45:43,210 [ thread 40] INFO - #com.jetbrains.cidr.lang - Loading Module Maps finished in 0 s.
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files)
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 source files
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Building symbols for 0 unused headers
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0)
2018-07-23 15:45:43,225 [ thread 40] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
2018-07-23 15:46:27,578 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: BUILD_FINISHED
2018-07-23 15:46:27,578 [e-1024-b02] INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'E:\WallpapersHD' WallpapersHD
2018-07-23 15:46:27,578 [e-1024-b02] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-07-23 15:46:28,068 [e-1024-b02] INFO - ild.invoker.GradleBuildInvoker - Gradle build finished in 45s 205ms
2018-07-23 15:46:28,083 [e-1024-b02] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-07-23 15:46:28,693 [e-1024-b02] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-07-23 15:46:29,568 [ thread 40] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 31ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-23 15:46:29,646 [ thread 40] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 78ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-23 15:46:29,646 [ thread 40] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 52 files to update
2018-07-23 15:46:30,912 [ thread 40] INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 1266ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-23 15:46:30,912 [ thread 40] INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 1 to update, calculated in 0ms
2018-07-23 15:46:30,943 [ thread 40] INFO - .diagnostic.PerformanceWatcher - Reindexing refreshed files took 31ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-23 15:46:58,921 [e-1024-b02] INFO - ide.actions.ShowFilePathAction - 'explorer' is not recognized as an internal or external command,
operable program or batch file.
Exit code 1
2018-07-23 16:02:02,723 [ thread 47] INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: [:app:assembleRelease]
2018-07-23 16:02:02,723 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: BUILD_EXECUTOR_CREATED
2018-07-23 16:02:02,738 [ thread 47] INFO - kage.ExportSignedPackageWizard - Export APK command: :app:assembleRelease, destination: -Pandroid.injected.apk.location=E:\WallpapersHD\app
2018-07-23 16:02:02,754 [ thread 44] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2018-07-23 16:02:02,754 [ thread 44] INFO - ild.invoker.GradleBuildInvoker - [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.signing.store.file=C:\Users\Arun\Desktop\current\android\keys\wallpapersHD.jks, -Pandroid.injected.signing.store.password=*********, -Pandroid.injected.signing.key.alias=key0, -Pandroid.injected.signing.key.password=*********, -Pandroid.injected.apk.location=E:\WallpapersHD\app, -Pandroid.injected.signing.v1-enabled=true, -Pandroid.injected.signing.v2-enabled=true]
2018-07-23 16:02:02,770 [ thread 44] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: --configure-on-demand -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.signing.store.file=C:\Users\Arun\Desktop\current\android\keys\wallpapersHD.jks -Pandroid.injected.signing.store.password=********* -Pandroid.injected.signing.key.alias=key0 -Pandroid.injected.signing.key.password=********* -Pandroid.injected.apk.location=E:\WallpapersHD\app -Pandroid.injected.signing.v1-enabled=true -Pandroid.injected.signing.v2-enabled=true
2018-07-23 16:02:02,785 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: BUILD_STARTED
2018-07-23 16:02:02,785 [e-1024-b02] INFO - idea.project.IndexingSuspender - Starting batch update for project: Project 'E:\WallpapersHD' WallpapersHD
2018-07-23 16:02:02,973 [ thread 47] INFO - #git4idea.commands.GitHandler - [WallpapersHD] git -c core.quotepath=false -c log.showSignature=false rm --ignore-unmatch --cached -- .idea/libraries/Gradle__com_google_firebase_firebase_ads_15_0_1.xml
2018-07-23 16:02:22,345 [e-1024-b02] INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: BUILD_FINISHED
2018-07-23 16:02:22,345 [e-1024-b02] INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'E:\WallpapersHD' WallpapersHD
2018-07-23 16:02:22,408 [e-1024-b02] INFO - ild.invoker.GradleBuildInvoker - Gradle build finished in 19s 665ms
2018-07-23 16:02:22,439 [e-1024-b02] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-07-23 16:02:22,830 [e-1024-b02] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-07-23 16:02:23,111 [ thread 47] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 16ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-23 16:02:23,189 [ thread 47] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 78ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-23 16:02:23,189 [ thread 47] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 8 files to update
2018-07-23 16:02:23,283 [ thread 47] INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 94ms; general responsiveness: ok; EDT responsiveness: ok
2018-07-23 16:02:47,515 [e-1024-b02] INFO - ide.actions.ShowFilePathAction - 'explorer' is not recognized as an internal or external command,
operable program or batch file.
Exit code 1
I am trying to use DataBinding in my Android project where I code in Kotlin. First of all, I'm use DataBindingUtil.setContentView(layoutResId) method, it can run. Then I try to encapsulate DataBinding to BaseActivity, gradle build failed, I don't know why.
Here is my code.
BaseActivity.kt
class BaseActivity<B : ViewDataBinding>
: AppCompatActivity(){
protected lateinit var mContext: AppCompatActivity
protected lateinit var mBinding: B
override fun onCreate(savedInstanceState: Bundle?) {
// Dagger2 注入
AndroidInjection.inject(this)
super.onCreate(savedInstanceState)
// 保存当前 Context 对象
mContext = this
// 添加到 AppManager 应用管理
AppManager.INSTANCE.addActivity(this)
}
override fun onDestroy() {
// 从应用管理移除当前 Activity 对象
AppManager.INSTANCE.removeActivity(this)
super.onDestroy()
}
override fun setContentView(layoutResID: Int) {
// 加载布局,初始化 DataBinding
mBinding = DataBindingUtil.inflate(
LayoutInflater.from(mContext),
layoutResID, null, false
)
super.setContentView(mBinding.root)
}
}
MainActivity.kt
class MainActivity : BaseActivity<ActivityMainBinding>() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
Messages Gradle Build
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
idea.log
2017-10-17 13:10:33,992 [se-915-b01] INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: [:SwipToLoad:generateDebugSources, :SwipToLoad:generateDebugAndroidTestSources, :SwipToLoad:mockableAndroidJar, :SwipToLoad:compileDebugAndroidTestSources, :SwipToLoad:compileDebugUnitTestSources, :SwipToLoad:compileDebugSources, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources, :app:compileDebugSources]
2017-10-17 13:10:33,998 [thread 138] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_101
2017-10-17 13:10:34,086 [thread 138] INFO - oject.common.GradleInitScripts - init script file sync.local.repo contents "allprojects {\n buildscript {\n repositories {\n maven { url 'D:\\\\android-studio3.0\\\\gradle\\\\m2repository'}\n }\n }\n repositories {\n maven { url 'D:\\\\android-studio3.0\\\\gradle\\\\m2repository'}\n }\n}\n"
2017-10-17 13:10:34,087 [thread 138] INFO - ild.invoker.GradleBuildInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, --init-script, C:\Users\Administrator\AppData\Local\Temp\sync.local.repo43033.gradle]
2017-10-17 13:10:34,087 [thread 138] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: --configure-on-demand -Pandroid.injected.invoked.from.ide=true --init-script C:\Users\Administrator\AppData\Local\Temp\sync.local.repo43033.gradle
2017-10-17 13:10:35,800 [se-915-b01] INFO - ild.invoker.GradleBuildInvoker - Gradle build finished with 1 error(s) in 1s 783ms
2017-10-17 13:10:35,835 [se-915-b01] INFO - pl.ProjectRootManagerComponent - project roots have changed
2017-10-17 13:10:35,860 [thread 138] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 1ms; general responsiveness: ok; EDT responsiveness: ok
2017-10-17 13:10:35,910 [thread 138] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 50ms; general responsiveness: ok; EDT responsiveness: ok
2017-10-17 13:10:36,405 [J pool 2/4] WARN - hes.resolve.KotlinCacheService - Could not find correct module information.
Reason: Analyzing element of type class com.android.tools.idea.databinding.LightGeneratedComponentClass with no containing file
Text:
null
2017-10-17 13:10:36,405 [J pool 2/4] WARN - .resolve.jvm.JvmAnalyzerFacade - Java referenced null from LibraryInfo(libraryName=library-1.3.1)
Referenced class was: JavaClassImpl: DATA binding component class
2017-10-17 13:10:36,405 [J pool 2/4] WARN - hes.resolve.KotlinCacheService - Could not find correct module information.
Reason: Analyzing element of type class com.android.tools.idea.databinding.LightGeneratedComponentClass with no containing file
Text:
null
2017-10-17 13:10:36,405 [J pool 2/4] WARN - .resolve.jvm.JvmAnalyzerFacade - Java referenced null from LibraryInfo(libraryName=library-1.3.1)
Referenced class was: JavaClassImpl: DATA binding component class
I don't know how to solve this problem, all my code is in KotlinTest, thanks for your help!
I had the same issue. If you use Dagger2, try not to use generics like <B: ViewDataBinding> as it can conflict with it. See my answer here.
I was unable to build the 'Hello World' project with a fresh install of android studio. It consumes a huge amount of RAM (up to 10GB) when building and throws the following error in the end:
Error:The first result from the daemon was empty. Most likely the process died immediately after connection.'
A large number of threads like the following one are continuously created when building:
/usr/lib/jvm/default/bin/java -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /home/wisatbff/.gradle/wrapper/dists/gradle-2.10-all/a4w5fzrkeut1ox71xslb49gst/gradle-2.10/lib/gradle-launcher-2.10.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 2.10
I have no idea about what is going on. Any suggestions?
UPDATE: Running ./gradlew build from command line builds successfully.
Environment
OS: Arch Linux, kernel version 4.5.1
Android Studio: 2.1
jdk: 1.8.0_92
gradle daemon log
[org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=baa60fb9-2eee-4be9-b120-a0e0c330dbae,javaHome=/usr/lib/jvm/java-8-jdk,daemonRegistryDir=/home/wisatbff/.gradle/daemon,pid=21023,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
[org.gradle.launcher.daemon.server.DaemonStateCoordinator] updating lastActivityAt to 1462006862641
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface eth0
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /fe80:0:0:0:325a:3aff:fe05:9727%eth0
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface eth0
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface ppp0
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? false
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? true
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote address /10.170.52.241
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding remote multicast interface ppp0
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding IP addresses for network interface lo
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a loopback interface? true
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Is this a multicast interface? false
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /0:0:0:0:0:0:0:1%lo
[org.gradle.messaging.remote.internal.inet.InetAddressFactory] Adding loopback address /127.0.0.1
[org.gradle.messaging.remote.internal.inet.TcpIncomingConnector] Listening on [4955d895-4319-4666-9fb0-4bfe4f133b0f port:40185, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]].
[org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Sat Apr 30 17:01:02 CST 2016, with address: [4955d895-4319-4666-9fb0-4bfe4f133b0f port:40185, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
[org.gradle.launcher.daemon.server.DomainRegistryUpdater] Advertising the daemon address to the clients: [4955d895-4319-4666-9fb0-4bfe4f133b0f port:40185, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
[org.gradle.launcher.daemon.server.DomainRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=baa60fb9-2eee-4be9-b120-a0e0c330dbae,javaHome=/usr/lib/jvm/java-8-jdk,daemonRegistryDir=/home/wisatbff/.gradle/daemon,pid=21023,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
[org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [4955d895-4319-4666-9fb0-4bfe4f133b0f port:40185, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], context: DefaultDaemonContext[uid=baa60fb9-2eee-4be9-b120-a0e0c330dbae,javaHome=/usr/lib/jvm/java-8-jdk,daemonRegistryDir=/home/wisatbff/.gradle/daemon,pid=21023,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
[org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
[org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
[org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
[org.gradle.launcher.daemon.server.Daemon] Daemon server started.
[org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
[org.gradle.launcher.daemon.server.Daemon] requestStopOnIdleTimeout(10800000 MILLISECONDS) called on daemon
[org.gradle.launcher.daemon.server.DaemonStateCoordinator] Idle timeout: waiting for daemon to stop or be idle for 10800000ms
[org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon is idle, sleeping until state change or idle timeout at Sat Apr 30 20:01:02 CST 2016
Android Studio log
2016-04-30 17:45:58,067 [ 128] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
2016-04-30 17:45:58,075 [ 136] INFO - #com.intellij.idea.Main - IDE: Android Studio (build #AI-143.2790544, 22 Apr 2016 00:00)
2016-04-30 17:45:58,076 [ 137] INFO - #com.intellij.idea.Main - OS: Linux (4.5.1-1-arch, amd64)
2016-04-30 17:45:58,076 [ 137] INFO - #com.intellij.idea.Main - JRE: 1.8.0_92-b14 (Oracle Corporation)
2016-04-30 17:45:58,076 [ 137] INFO - #com.intellij.idea.Main - JVM: 25.92-b14 (Java HotSpot(TM) 64-Bit Server VM)
2016-04-30 17:45:58,077 [ 138] INFO - #com.intellij.idea.Main - JVM Args: -Xbootclasspath/a:/home/wisatbff/android-studio/bin/../lib/boot.jar -Xms256m -Xmx1280m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -da -Djna.nosys=true -Djna.boot.library.path= -Djna.debug_load=true -Djna.debug_load.jna=true -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -Dawt.useSystemAAFontSettings=lcd -Djb.vmOptionsFile=/home/wisatbff/android-studio/bin/studio64.vmoptions -XX:ErrorFile=/home/wisatbff/java_error_in_STUDIO_%p.log -Djb.restart.code=88 -Didea.paths.selector=AndroidStudio2.1 -Didea.platform.prefix=AndroidStudio
2016-04-30 17:45:58,077 [ 138] INFO - #com.intellij.idea.Main - ext: /usr/lib/jvm/java-8-jdk/jre/lib/ext: [cldrdata.jar, sunjce_provider.jar, meta-index, localedata.jar, dnsns.jar, sunec.jar, zipfs.jar, nashorn.jar, jaccess.jar, sunpkcs11.jar, jfxrt.jar]
2016-04-30 17:45:58,089 [ 150] INFO - #com.intellij.idea.Main - JNA library loaded (64-bit) in 12 ms
2016-04-30 17:45:58,178 [ 239] INFO - .intellij.idea.IdeaApplication - WM detected: awesome
2016-04-30 17:45:58,187 [ 248] INFO - llij.openapi.wm.impl.X11UiUtil - impersonated WM: SAWFISH_WM
2016-04-30 17:45:58,363 [ 424] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor duplicates-groovy.xml
2016-04-30 17:45:58,606 [ 667] INFO - llij.ide.plugins.PluginManager - 30 plugins initialized in 326 ms
2016-04-30 17:45:58,607 [ 668] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: Android NDK Support (1.0), Android Support (10.2.1), Copyright (8.1), Coverage (143.SNAPSHOT), EditorConfig (1.0), Google Analytics Uploader (1.0), Google App Indexing (0.1), Google Login (1.0), Google Services (0.1), Gradle (143.SNAPSHOT), Groovy (9.0), I18n for Java (143.SNAPSHOT), IDEA CORE (143.SNAPSHOT), IntelliLang (8.0), JUnit (1.0), Java Bytecode Decompiler (0.1), Properties Support (143.SNAPSHOT), SDK Updater (1.0), Settings Repository (143.SNAPSHOT), Task Management (1.0), Terminal (0.1), TestNG-J (8.0)
2016-04-30 17:45:58,607 [ 668] INFO - llij.ide.plugins.PluginManager - Disabled plugins: CVS Integration (11), Git Integration (8.1), GitHub (143.SNAPSHOT), Google Cloud Testing (1.0), Google Cloud Tools Core (0.2.8), Google Cloud Tools For Android Studio (0.2.8), Subversion Integration (1.1), hg4idea (10.0)
2016-04-30 17:45:58,914 [ 975] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=1286340608
2016-04-30 17:45:58,942 [ 1003] INFO - pl.local.NativeFileWatcherImpl - Starting file watcher: /home/wisatbff/android-studio/bin/fsnotifier64
2016-04-30 17:45:58,947 [ 1008] INFO - pl.local.NativeFileWatcherImpl - Native file watcher is operational.
2016-04-30 17:45:59,418 [ 1479] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342
2016-04-30 17:45:59,846 [ 1907] INFO - ins.android.sdk.AndroidSdkData - Parsing /home/wisatbff/Android/Sdk/sources/android-23/package.xml
2016-04-30 17:46:00,047 [ 2108] INFO - ins.android.sdk.AndroidSdkData - Parsing /home/wisatbff/Android/Sdk/tools/package.xml
2016-04-30 17:46:00,054 [ 2115] INFO - ins.android.sdk.AndroidSdkData - Parsing /home/wisatbff/Android/Sdk/platform-tools/package.xml
2016-04-30 17:46:00,060 [ 2121] INFO - ins.android.sdk.AndroidSdkData - Parsing /home/wisatbff/Android/Sdk/platforms/android-23/package.xml
2016-04-30 17:46:00,065 [ 2126] INFO - ins.android.sdk.AndroidSdkData - Parsing /home/wisatbff/Android/Sdk/extras/google/m2repository/package.xml
2016-04-30 17:46:00,071 [ 2132] INFO - ins.android.sdk.AndroidSdkData - Parsing /home/wisatbff/Android/Sdk/extras/android/m2repository/package.xml
2016-04-30 17:46:00,076 [ 2137] INFO - ins.android.sdk.AndroidSdkData - Parsing /home/wisatbff/Android/Sdk/build-tools/23.0.3/package.xml
2016-04-30 17:46:00,245 [ 2306] INFO - plication.impl.ApplicationImpl - 82 application components initialized in 1966 ms
2016-04-30 17:46:00,260 [ 2321] INFO - .intellij.idea.IdeaApplication - App initialization took 3010 ms
2016-04-30 17:46:00,990 [ 3051] INFO - CompilerWorkspaceConfiguration - Available processors: 4
2016-04-30 17:46:01,496 [ 3557] INFO - ellij.project.impl.ProjectImpl - 136 project components initialized in 797 ms
2016-04-30 17:46:01,496 [ 3557] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2016-04-30 17:46:01,654 [ 3715] INFO - android.tools.idea.sdk.IdeSdks - Parsing /home/wisatbff/Android/Sdk/sources/android-23/package.xml
2016-04-30 17:46:01,659 [ 3720] INFO - android.tools.idea.sdk.IdeSdks - Parsing /home/wisatbff/Android/Sdk/tools/package.xml
2016-04-30 17:46:01,663 [ 3724] INFO - android.tools.idea.sdk.IdeSdks - Parsing /home/wisatbff/Android/Sdk/platform-tools/package.xml
2016-04-30 17:46:01,667 [ 3728] INFO - android.tools.idea.sdk.IdeSdks - Parsing /home/wisatbff/Android/Sdk/platforms/android-23/package.xml
2016-04-30 17:46:01,671 [ 3732] INFO - android.tools.idea.sdk.IdeSdks - Parsing /home/wisatbff/Android/Sdk/extras/google/m2repository/package.xml
2016-04-30 17:46:01,681 [ 3742] INFO - android.tools.idea.sdk.IdeSdks - Parsing /home/wisatbff/Android/Sdk/extras/android/m2repository/package.xml
2016-04-30 17:46:01,686 [ 3747] INFO - android.tools.idea.sdk.IdeSdks - Parsing /home/wisatbff/Android/Sdk/build-tools/23.0.3/package.xml
2016-04-30 17:46:01,696 [ 3757] INFO - dea.updater.SdkComponentSource - Parsing /home/wisatbff/Android/Sdk/sources/android-23/package.xml
2016-04-30 17:46:01,712 [ 3773] INFO - dea.updater.SdkComponentSource - Parsing /home/wisatbff/Android/Sdk/tools/package.xml
2016-04-30 17:46:01,723 [ 3784] INFO - dea.updater.SdkComponentSource - Parsing /home/wisatbff/Android/Sdk/platform-tools/package.xml
2016-04-30 17:46:01,728 [ 3789] INFO - ls.idea.gradle.GradleSyncState - Started sync with Gradle for project 'My First App'.
2016-04-30 17:46:01,733 [ 3794] INFO - dea.updater.SdkComponentSource - Parsing /home/wisatbff/Android/Sdk/platforms/android-23/package.xml
2016-04-30 17:46:01,741 [ 3802] INFO - dea.updater.SdkComponentSource - Parsing /home/wisatbff/Android/Sdk/extras/google/m2repository/package.xml
2016-04-30 17:46:01,746 [ 3807] INFO - dea.updater.SdkComponentSource - Parsing /home/wisatbff/Android/Sdk/extras/android/m2repository/package.xml
2016-04-30 17:46:01,752 [ 3813] INFO - dea.updater.SdkComponentSource - Parsing /home/wisatbff/Android/Sdk/build-tools/23.0.3/package.xml
2016-04-30 17:46:01,784 [ 3845] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/addons_list-3.xml
2016-04-30 17:46:01,897 [ 3958] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /usr/lib/jvm/default
2016-04-30 17:46:01,898 [ 3959] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /usr/lib/jvm/default
2016-04-30 17:46:01,930 [ 3991] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at '/home/wisatbff/android-studio/gradle/m2repository'
2016-04-30 17:46:02,052 [ 4113] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/android/sys-img2-1.xml
2016-04-30 17:46:02,094 [ 4155] INFO - tartup.impl.StartupManagerImpl - /home/wisatbff/AndroidStudioProjects/MyFirstApp/.idea/misc.xml case-sensitivity: true
2016-04-30 17:46:02,577 [ 4638] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/android-wear/sys-img2-1.xml
2016-04-30 17:46:02,645 [ 4706] INFO - .project.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [-Pandroid.injected.build.model.only=true, -Pandroid.injected.build.model.only.advanced=true, -Pandroid.injected.invoked.from.ide=true, --init-script, /tmp/asLocalRepo7.gradle, --init-script, /tmp/ijinit7.gradle]
2016-04-30 17:46:02,878 [ 4939] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 0ms; general responsiveness: ok; EDT responsiveness: ok
2016-04-30 17:46:02,916 [ 4977] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/android-tv/sys-img2-1.xml
2016-04-30 17:46:02,929 [ 4990] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 50ms; general responsiveness: ok; EDT responsiveness: ok
2016-04-30 17:46:03,021 [ 5082] INFO - tor.impl.FileEditorManagerImpl - Project opening took 2369 ms
2016-04-30 17:46:03,030 [ 5091] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2016-04-30 17:46:03,033 [ 5094] INFO - #com.jetbrains.cidr.lang - Loading symbols finished in 0 s.
2016-04-30 17:46:03,037 [ 5098] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2016-04-30 17:46:03,039 [ 5100] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
2016-04-30 17:46:03,141 [ 5202] INFO - lij.tasks.impl.TaskManagerImpl - Updating issues cache (every 20 min)
2016-04-30 17:46:03,217 [ 5278] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/google_apis/sys-img2-1.xml
2016-04-30 17:46:03,509 [ 5570] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/addon2-1.xml
2016-04-30 17:46:03,858 [ 5919] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/glass/addon2-1.xml
2016-04-30 17:46:04,324 [ 6385] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/x86/addon2-1-x86.xml
2016-04-30 17:46:04,595 [ 6656] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/addon.xml
2016-04-30 17:46:04,971 [ 7032] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/glass/addon.xml
2016-04-30 17:46:05,263 [ 7324] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/extras/intel/addon.xml
2016-04-30 17:46:05,551 [ 7612] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/android/sys-img.xml
2016-04-30 17:46:05,867 [ 7928] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
2016-04-30 17:46:06,144 [ 8205] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
2016-04-30 17:46:06,422 [ 8483] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
2016-04-30 17:46:06,886 [ 8947] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
2016-04-30 17:46:07,169 [ 9230] WARN - dea.updater.SdkComponentSource - File /home/wisatbff/.android/repositories.cfg could not be loaded.
2016-04-30 17:46:07,169 [ 9230] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/repository-12.xml
2016-04-30 17:46:07,490 [ 9551] INFO - dea.updater.SdkComponentSource - Downloading https://dl.google.com/android/repository/repository2-1.xml
2016-04-30 17:47:31,825 [ 93886] INFO - .project.GradleProjectResolver - Gradle project resolve error
org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle installation '/home/wisatbff/android-studio/gradle/gradle-2.10'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:59)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:46)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:188)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$300(GradleProjectResolver.java:65)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:367)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:339)
at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:230)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:97)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:65)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:419)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:500)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
Caused by: org.gradle.launcher.daemon.client.NoUsableDaemonFoundException: Unable to find a usable idle daemon. I have connected to 100 different daemons but I could not use any of them to run build: Build{id=acdc7e86-d815-4916-b4b6-ccb3e714b458.1, currentDir=/home/wisatbff/AndroidStudioProjects/MyFirstApp}. BuildActionParameters were DefaultBuildActionParameters{, currentDir=/home/wisatbff/AndroidStudioProjects/MyFirstApp, systemProperties size=90, envVariables size=38, logLevel=LIFECYCLE, daemonUsage=IMPLICITLY_DISABLED, continuous=false, interactive=false, injectedPluginClasspath=[]}.
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:135)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:80)
at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:58)
at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:40)
at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:60)
at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:34)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:132)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:117)
at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:190)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerConnection$CancellableActionRunner.run(CancellableConsumerConnection.java:105)
at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:60)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:57)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:83)
at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.launcher.daemon.client.DaemonInitialConnectException: The first result from the daemon was empty. Most likely the process died immediately after connection.
at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:154)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:125)
... 19 more
I fixed this by removing a masquerade rule from my postrouting NAT table.
[root#me]: iptables -t nat -L
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- anywhere anywhere
[root#me]: iptables -t nat -D POSTROUTING 1
I still have other MASQUERADING rules in that table but they have specific source address masks rather than source "anywhere".
Finally I found the problem. Since I'm behind the GFW, I need to use a proxy in order to download things like Android SDK. I used proxychains and maybe I got the configuration for localnet exclusion wrong which stops gradle from connecting to the daemon.
Had the same issue after Android Studio closed unexpectedly. Solved it by doing File | Invalidate Caches/Restart
I was facing the same problem in Android Studio 3.However, none of the solutions mentioned here worked for me.With only 4 GB of RAM available ,the only thing worked for me was just changing the value specified for JVM args which is related to RAM in gradle.properties file like the following:
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
to:
org.gradle.jvmargs=-Xmx512m
then File | Invalidate Caches/Restart--> Invalidate and Restart
This really did the trick.