AndroidStudio第一次构建出现Buiding 'Project Name' Gradle project info长时间等待

时间:2023-01-17 11:38:02

AndroidStudio第一次构建出现Buiding 'Project Name' Gradle project info长时间等待

AndroidStudio第一次构建出现Buiding 'Project Name' Gradle project info长时间等待

网上很多教程是自己下载Gradle,可是通过测试发现根本不是这个原因,Gradle在国内根本没有被墙,是可以正常访问的。你要做的就是等,这段时间都是在maven*仓库下载jar包,等待时间取决于向maven*仓库下载的时间

查看日志:C:\Users\[用户名]\.AndroidStudio1.3\system\log\idea.log可以发现问题

这个是构建一段时间之后用进程结束掉的部分

2015-09-27 20:36:16,010 [1185333]   INFO -                  TestNG Runner - Create TestNG Template Configuration 
2015-09-27 20:36:17,322 [1186645] INFO - ellij.project.impl.ProjectImpl - 142 project components initialized in 3062 ms
2015-09-27 20:36:17,323 [1186646] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2015-09-27 20:36:33,761 [1203084] INFO - nject.config.XPathSupportProxy - XPath Support is not available
2015-09-27 20:36:35,281 [1204604] INFO - TestNG Runner - Create TestNG Template Configuration
2015-09-27 20:36:35,420 [1204743] INFO - ellij.project.impl.ProjectImpl - 142 project components initialized in 373 ms
2015-09-27 20:36:35,420 [1204743] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2015-09-27 20:36:35,670 [1204993] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy
2015-09-27 20:36:35,670 [1204993] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy in original object too
2015-09-27 20:36:35,934 [1205257] INFO - util.EmbeddedDistributionPaths - Looking for embedded Gradle distribution at 'D:\Program Files\Android\Android Studio\gradle\gradle-2.4'
2015-09-27 20:36:35,934 [1205257] INFO - util.EmbeddedDistributionPaths - Found embedded Gradle 2.4
2015-09-27 20:36:36,126 [1205449] INFO - ls.idea.gradle.GradleSyncState - Started sync with Gradle for project 'My Application'.
2015-09-27 20:36:36,413 [1205736] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from D:/Program Files/Java/jdk1.7.0_71
2015-09-27 20:36:36,549 [1205872] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'D:\Program Files\Android\Android Studio\gradle\m2repository'
2015-09-27 20:36:41,782 [1211105] 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, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo0.gradle, --init-script, C:\Users\LENOVO\AppData\Local\Temp\ijinit0.gradle]
2015-09-27 20:37:06,114 [1235437] INFO - ellij.concurrency.JobScheduler - 50 ms execution limit failed for: com.intellij.openapi.progress.impl.CoreProgressManager$1@1c138b77; elapsed time was 60ms
2015-09-27 20:54:22,946 [ 0] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
下面这个是等待Gradle构建完成的日志,注意22:17~22:27

2015-09-27 22:15:56,039 [      1]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ 
2015-09-27 22:15:56,191 [ 153] INFO - #com.intellij.idea.Main - IDE: Android Studio (build #AI-141.2178183, 19 Aug 2015 00:00)
2015-09-27 22:15:56,191 [ 153] INFO - #com.intellij.idea.Main - OS: Windows 8 (6.2, amd64)
2015-09-27 22:15:56,191 [ 153] INFO - #com.intellij.idea.Main - JRE: 1.7.0_71-b14 (Oracle Corporation)
2015-09-27 22:15:56,191 [ 153] INFO - #com.intellij.idea.Main - JVM: 24.71-b01 (Java HotSpot(TM) 64-Bit Server VM)
2015-09-27 22:15:56,195 [ 157] INFO - #com.intellij.idea.Main - JVM Args: -Xms256m -Xmx1280m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=225m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Djna.nosys=true -Djna.boot.library.path= -Djna.debug_load=true -Djna.debug_load.jna=true -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Didea.paths.selector=AndroidStudio1.3 -Didea.platform.prefix=AndroidStudio -Djb.vmOptions=D:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions -Xbootclasspath/a:D:\Program Files\Android\Android Studio\lib\boot.jar -Didea.jre.check=false
2015-09-27 22:16:40,634 [ 44596] INFO - #com.intellij.idea.Main - JNA library loaded (64-bit) in 44439 ms
2015-09-27 22:16:40,645 [ 44607] INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational
2015-09-27 22:16:40,646 [ 44608] INFO - #com.intellij.idea.Main - Using "FocusKiller" library to prevent focus stealing.
2015-09-27 22:16:46,556 [ 50518] INFO - llij.ide.plugins.PluginManager - 28 plugins initialized in 4168 ms
2015-09-27 22:16:46,574 [ 50536] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: Android NDK Support (1.0), Android Support (10.1.3.2), CVS Integration (11), Copyright (8.1), Coverage, EditorConfig (1.0), Git Integration (8.1), GitHub, Google Cloud Testing (1.0), Google Cloud Tools For Android Studio (0.2.8), Google Login (1.0), Google Services (0.1), Gradle, Groovy (9.0), I18n for Java, IDEA CORE, IntelliLang (8.0), JUnit (1.0), Java Bytecode Decompiler (0.1), JavaFX (1.0), Maven Integration, Properties Support, SDK Updater (1.0), Subversion Integration (1.1), Task Management (1.0), Terminal (0.1), TestNG-J (8.0), hg4idea (10.0)
2015-09-27 22:16:48,409 [ 52371] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=200; buffer=10; max=1303773184
2015-09-27 22:16:48,502 [ 52464] INFO - api.vfs.impl.local.FileWatcher - Starting file watcher: D:\Program Files\Android\Android Studio\bin\fsnotifier.exe
2015-09-27 22:16:48,568 [ 52530] INFO - api.vfs.impl.local.FileWatcher - Native file watcher is operational.
2015-09-27 22:16:50,153 [ 54115] INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: []
2015-09-27 22:16:54,095 [ 58057] INFO - TestNG Runner - Create TestNG Template Configuration
2015-09-27 22:16:54,365 [ 58327] INFO - ellij.project.impl.ProjectImpl - 21 project components initialized in 1260 ms
2015-09-27 22:16:54,365 [ 58327] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2015-09-27 22:16:56,779 [ 60741] INFO - pl.stores.ApplicationStoreImpl - 88 application components initialized in 10126 ms
2015-09-27 22:16:57,568 [ 61530] INFO - .intellij.idea.IdeaApplication - App initialization took 63117 ms
2015-09-27 22:17:16,167 [ 80129] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342
2015-09-27 22:17:27,017 [ 90979] INFO - TestNG Runner - Create TestNG Template Configuration
2015-09-27 22:17:28,870 [ 92832] INFO - ellij.project.impl.ProjectImpl - 142 project components initialized in 4459 ms
2015-09-27 22:17:28,871 [ 92833] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2015-09-27 22:17:43,896 [ 107858] INFO - nject.config.XPathSupportProxy - XPath Support is not available
2015-09-27 22:17:48,821 [ 112783] INFO - TestNG Runner - Create TestNG Template Configuration
2015-09-27 22:17:49,899 [ 113861] INFO - ellij.project.impl.ProjectImpl - 142 project components initialized in 1330 ms
2015-09-27 22:17:49,899 [ 113861] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2015-09-27 22:17:50,013 [ 113975] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy
2015-09-27 22:17:50,013 [ 113975] INFO - i.vcs.changes.ChangeListWorker - default list not found when copy in original object too
2015-09-27 22:17:51,810 [ 115772] INFO - util.EmbeddedDistributionPaths - Looking for embedded Gradle distribution at 'D:\Program Files\Android\Android Studio\gradle\gradle-2.4'
2015-09-27 22:17:51,810 [ 115772] INFO - util.EmbeddedDistributionPaths - Found embedded Gradle 2.4
2015-09-27 22:17:51,913 [ 115875] INFO - ls.idea.gradle.GradleSyncState - Started sync with Gradle for project 'My Application2'.
2015-09-27 22:17:52,298 [ 116260] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from D:/Program Files/Java/jdk1.7.0_71
2015-09-27 22:17:53,311 [ 117273] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'D:\Program Files\Android\Android Studio\gradle\m2repository'
2015-09-27 22:17:58,472 [ 122434] 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, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo6.gradle, --init-script, C:\Users\LENOVO\AppData\Local\Temp\ijinit6.gradle, --offline]
2015-09-27 22:27:06,444 [ 670406] INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 476 ms
2015-09-27 22:27:06,451 [ 670413] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 218 files to update
2015-09-27 22:27:06,558 [ 670520] INFO - tartup.impl.StartupManagerImpl - D:\AndroidStudioProjects\MyApplication2\.idea\misc.xml case-sensitivity: false
2015-09-27 22:27:10,227 [ 674189] INFO - tor.impl.FileEditorManagerImpl - Project opening took 561869 ms
2015-09-27 22:28:20,580 [ 744542] INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 74129 ms
2015-09-27 22:28:23,268 [ 747230] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2015-09-27 22:28:23,275 [ 747237] INFO - #com.jetbrains.cidr.lang - Loading symbols finished in 0 s.
2015-09-27 22:28:23,292 [ 747254] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2015-09-27 22:28:23,300 [ 747262] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
2015-09-27 22:28:25,320 [ 749282] INFO - r.impl.FileDocumentManagerImpl - reload AndroidManifest.xml from disk?
2015-09-27 22:28:25,320 [ 749282] INFO - r.impl.FileDocumentManagerImpl - documentStamp:179
2015-09-27 22:28:25,320 [ 749282] INFO - r.impl.FileDocumentManagerImpl - oldFileStamp:0
2015-09-27 22:28:30,466 [ 754428] INFO - ls.idea.gradle.GradleSyncState - Sync with Gradle successful for project 'My Application2'.
2015-09-27 22:28:30,530 [ 754492] INFO - a.gradle.invoker.GradleInvoker - About to execute Gradle tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources]
2015-09-27 22:28:30,576 [ 754538] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from D:/Program Files/Java/jdk1.7.0_71
2015-09-27 22:28:31,130 [ 755092] INFO - lij.tasks.impl.TaskManagerImpl - Updating issues cache (every 20 min)
2015-09-27 22:28:31,250 [ 755212] INFO - CompilerWorkspaceConfiguration - Available processors: 2
2015-09-27 22:28:33,029 [ 756991] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'D:\Program Files\Android\Android Studio\gradle\m2repository'
2015-09-27 22:28:33,313 [ 757275] INFO - util.EmbeddedDistributionPaths - Looking for embedded Gradle distribution at 'D:\Program Files\Android\Android Studio\gradle\gradle-2.4'
2015-09-27 22:28:33,313 [ 757275] INFO - util.EmbeddedDistributionPaths - Found embedded Gradle 2.4
2015-09-27 22:28:33,313 [ 757275] INFO - a.gradle.invoker.GradleInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, --init-script, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo7.gradle]
2015-09-27 22:28:33,368 [ 757330] INFO - .project.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, --init-script, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo7.gradle, --offline]
2015-09-27 22:28:34,761 [ 758723] INFO - indexing.UnindexedFilesUpdater - Unindexed files update canceled
2015-09-27 22:28:34,782 [ 758744] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2015-09-27 22:28:34,825 [ 758787] INFO - #com.jetbrains.cidr.lang - Loading symbols finished in 0 s.
2015-09-27 22:28:35,090 [ 759052] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2015-09-27 22:28:35,099 [ 759061] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
2015-09-27 22:28:50,050 [ 774012] INFO - indexing.UnindexedFilesUpdater - Unindexed files update canceled
2015-09-27 22:29:11,143 [ 795105] INFO - indexing.UnindexedFilesUpdater - Unindexed files update canceled
2015-09-27 22:29:35,561 [ 819523] INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 22626 ms
2015-09-27 22:29:35,561 [ 819523] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 60345 files to update
2015-09-27 22:31:53,620 [ 957582] INFO - ellij.vfs.persistent.FSRecords - Contents:16384 of 151130693, reuses:142 of 166958 for 2370
2015-09-27 22:34:22,919 [1106881] INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 287358 ms
2015-09-27 22:34:32,248 [1116210] INFO - attrs.AttributeDefinitionsImpl - Found tag with unknown parent: AndroidManifest.AndroidManifestCompatibleScreens
2015-09-27 22:34:32,248 [1116210] INFO - attrs.AttributeDefinitionsImpl - Found tag with unknown parent: AndroidManifest.AndroidManifestSupportsInput
2015-09-27 22:35:11,122 [1155084] INFO - tools.idea.ddms.adb.AdbService - Initializing adb using: D:\AndroidSdk\sdk\platform-tools\adb.exe, client support = true
2015-09-27 22:35:12,018 [1155980] INFO - tools.idea.ddms.adb.AdbService - Successfully connected to adb
2015-09-27 22:35:12,136 [1156098] INFO - a.gradle.invoker.GradleInvoker - About to execute Gradle tasks: [:app:assembleDebug]
2015-09-27 22:35:12,163 [1156125] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from D:/Program Files/Java/jdk1.7.0_71
2015-09-27 22:35:12,285 [1156247] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'D:\Program Files\Android\Android Studio\gradle\m2repository'
2015-09-27 22:35:12,295 [1156257] INFO - util.EmbeddedDistributionPaths - Looking for embedded Gradle distribution at 'D:\Program Files\Android\Android Studio\gradle\gradle-2.4'
2015-09-27 22:35:12,295 [1156257] INFO - util.EmbeddedDistributionPaths - Found embedded Gradle 2.4
2015-09-27 22:35:12,296 [1156258] INFO - a.gradle.invoker.GradleInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, --init-script, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo8.gradle]
2015-09-27 22:35:12,296 [1156258] INFO - .project.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, --init-script, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo8.gradle, --offline]
2015-09-27 22:35:55,644 [1199606] INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 15969 ms
2015-09-27 22:36:02,430 [1206392] INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 45 ms
2015-09-27 22:36:02,430 [1206392] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 1 files to update
2015-09-27 22:36:02,447 [1206409] INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 17 ms
2015-09-27 22:36:45,266 [1249228] INFO - a.gradle.invoker.GradleInvoker - About to execute Gradle tasks: [:app:assembleDebug]
2015-09-27 22:36:45,282 [1249244] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from D:/Program Files/Java/jdk1.7.0_71
2015-09-27 22:36:45,282 [1249244] INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at 'D:\Program Files\Android\Android Studio\gradle\m2repository'
2015-09-27 22:36:45,282 [1249244] INFO - util.EmbeddedDistributionPaths - Looking for embedded Gradle distribution at 'D:\Program Files\Android\Android Studio\gradle\gradle-2.4'
2015-09-27 22:36:45,282 [1249244] INFO - util.EmbeddedDistributionPaths - Found embedded Gradle 2.4
2015-09-27 22:36:45,282 [1249244] INFO - a.gradle.invoker.GradleInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, --init-script, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo9.gradle]
2015-09-27 22:36:45,282 [1249244] INFO - .project.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, --init-script, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo9.gradle, --offline]
2015-09-27 22:36:52,511 [1256473] INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 38 ms
2015-09-27 22:41:37,048 [1541010] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from D:/Program Files/Java/jdk1.7.0_71
2015-09-27 22:41:52,051 [1556013] INFO - org.jetbrains.io.BuiltInServer - web server stopped
2015-09-27 22:41:52,058 [1556020] INFO - Types.impl.FileTypeManagerImpl - FileTypeManager: 205 auto-detected files
Elapsed time on auto-detect: 1498 ms
2015-09-27 22:41:52,235 [1556197] INFO - il.indexing.FileBasedIndexImpl - START INDEX SHUTDOWN
2015-09-27 22:41:52,708 [1556670] INFO - il.indexing.FileBasedIndexImpl - END INDEX SHUTDOWN
2015-09-27 22:41:52,708 [1556670] INFO - stubs.SerializationManagerImpl - START StubSerializationManager SHUTDOWN
2015-09-27 22:41:52,708 [1556670] INFO - stubs.SerializationManagerImpl - END StubSerializationManager SHUTDOWN
2015-09-27 22:41:52,942 [1556904] WARN - api.vfs.impl.local.FileWatcher - Watcher terminated with exit code 0
2015-09-27 22:41:52,942 [1556904] INFO - newvfs.persistent.PersistentFS - VFS dispose started
2015-09-27 22:41:53,067 [1557029] INFO - newvfs.persistent.PersistentFS - VFS dispose completed
2015-09-27 22:41:53,082 [1557044] ERROR - l.messages.impl.MessageBusImpl - Already disposed: Application
可以看到,Gradle buiding的时候,Gradle是下载好的,并且也已经找到了Gradle的路径,那么构建的时间花在了下面这句上

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, C:\Users\LENOVO\AppData\Local\Temp\asLocalRepo6.gradle, --init-script, C:\Users\LENOVO\AppData\Local\Temp\ijinit6.gradle, --offline]
看来大量的时间浪费在执行asLocalRepo6.gradle和ijinit6.gradle初始化脚本上了,根据上下文推断,应该是向maven*仓库下载所需要的jar

首先AndroidStudio会强制更新Android SDK,这些xml文件在几次构建时被强制更新

AndroidStudio第一次构建出现Buiding 'Project Name' Gradle project info长时间等待

在构建的后几分钟里,根据gradle的缓存目录D:\Program Files\Android\Android Studio\gradle\gradle-2.4\caches

在D:\Program Files\Android\Android Studio\gradle\gradle-2.4\caches\jars-1目录下载了一些jar,如下

D:\Program Files\Android\Android Studio\gradle\gradle-2.4\caches\jars-1>tree /F
卷 软件 的文件夹 PATH 列表
卷序列号为 0000004B 0003:3FE2
D:.
│ cache.properties
│ cache.properties.lock

├─87eo0lrvp84r6dbxjq018wy66es2era
│ guava-jdk5-17.0.jar

├─8l94hdzg80p7kctffdd05tje3oxkl3u
│ openapi.jar

├─ddb3xo63sk87376y3m4i33byir38fre
│ builder-model-1.3.0.jar

├─dg22azhabc6tsc1i8xni15giz1bnssh
│ gradle-appengine-builder-model-0.1.0.jar

├─ltkluv74baem3ersp41z8rutm6he5v5
│ gradle-tooling-api-2.2.jar

├─p1m0o3vtexgwvybv096m7y02fw18s8w
│ gradle-tooling-extension-api.jar

└─qlb402qqdb9mu9614i3hr843cfch7zw
gradle-base-services-2.2.jar
登记的时间(文件:"D:\Program Files\Android\Android Studio\gradle\gradle-2.4\caches\jars-1\cache.properties")

#Sun Sep 27 22:25:38 CST 2015
执行asLocalRepo6.gradle(文件"D:\Program Files\Android\Android Studio\gradle\gradle-2.4\caches\2.4\scripts\asLocalRepo6_1643d3yap2oz5se9ucb8jnf97\InitScript\initscript\cache.properties")

#Sun Sep 27 22:25:41 CST 2015
source.hash=dwkz06mk9dtvw0ol6bvwm00bw
source.filename=C\:\\Users\\LENOVO\\AppData\\Local\\Temp\\asLocalRepo6.gradle
之后执行build.gradle(文件"D:\Program Files\Android\Android Studio\gradle\gradle-2.4\caches\2.4\scripts\build_8ra893kw2s53lwt2nb3ue4acj\ProjectScript\buildscript\cache.properties")

#Sun Sep 27 22:26:28 CST 2015
source.hash=6559w1otlk2wk0t5iqzog93v1
source.filename=D\:\\AndroidStudioProjects\\MyApplication2\\app\\build.gradle
之后执行ijinit6.gradle(文件"D:\Program Files\Android\Android Studio\gradle\gradle-2.4\caches\2.4\scripts\ijinit6_9k54e9nn2my23tikcf0gvfymi\InitScript\initscript\cache.properties")

#Sun Sep 27 23:30:08 CST 2015
source.hash=81hgmt6rmtk82dtgcoym9zie7
source.filename=C\:\\Users\\LENOVO\\AppData\\Local\\Temp\\ijinit6.gradle

第一次所有构建完成后会产生"C:\Users\[用户名]\.gradle\daemon\x.y\registry.bin.lock"文件,其中x.y是版本号

AndroidStudio第一次构建出现Buiding 'Project Name' Gradle project info长时间等待


asLocalRepoX.gradle(asLocalRepo0.gradle,asLocalRepo1.gradle,...)的内容

allprojects {
buildscript {
repositories {
maven { url 'C:\\Program Files\\Android\\Android Studio\\gradle\\m2repository'}
}
}
}
ijinitX.gradle(ijinit0.gradle,ijinit1.gradle,...)的内容
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry

@SuppressWarnings("GrPackage")
class JetGradlePlugin implements Plugin<Project> {
private final ToolingModelBuilderRegistry registry

@javax.inject.Inject
public JetGradlePlugin(ToolingModelBuilderRegistry registry) {
this.registry = registry
}

public void apply(Project project) {
registry.register(project.jetExtraModelBuilderClass.newInstance())
}
}

try {
String[] paths = ["C:/Program Files/Android/Android Studio/lib/openapi.jar","C:/Program Files/Android/Android Studio/plugins/gradle/lib/gradle-tooling-extension-impl.jar","C:/Program Files/Android/Android Studio/lib/groovy-all-2.3.9.jar","C:/Program Files/Android/Android Studio/lib/gson-2.3.jar","C:/Program Files/Android/Android Studio/plugins/gradle/lib/gradle-tooling-extension-api.jar"]
URL[] urls = paths.collect{ new File(it).toURI().toURL() }
URLClassLoader classLoader = new URLClassLoader(urls, getClass().classLoader)
Class modelClass = classLoader.loadClass('org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder')
allprojects {
ext.jetExtraModelBuilderClass = modelClass
apply plugin: JetGradlePlugin
}
}
catch (all) {
}