前言
現(xiàn)在在Canary更新渠道可以下載這一版本了,喜歡嘗鮮的朋友肯定早已動(dòng)手了,還等什么,一起下載吧!
“金絲雀版”?!
Canary(金絲雀版) :Google之所以稱之為“金絲雀版”,是因?yàn)榻鸾z雀曾在礦井中被用于早期預(yù)警,金絲雀版采集到的反饋數(shù)據(jù)可以幫助Google更快的找到并修復(fù)問(wèn)題。
解壓與運(yùn)行
對(duì)于已經(jīng)安裝了穩(wěn)定版的朋友,下載好android-studio-ide-171.4010489-linux.zip
后,直接解壓并運(yùn)行就好了,環(huán)境配置和個(gè)性化設(shè)置可以沿用穩(wěn)定版。
linux環(huán)境下可以執(zhí)行如下操作:
unzip android-studio-ide-171.4010489-linux.zip //解壓
./bin/studio.sh //運(yùn)行
亮點(diǎn)1:多了一個(gè)
Profile or debug APK
選項(xiàng),是將之前tools下的apk分析功能單獨(dú)拎出來(lái)了,操作更加直接了。
亮點(diǎn)2:
Include Kotlin support
,無(wú)疑這是3.0最大的改變,扶正Kotlin,Google火速推進(jìn),實(shí)在是服。勾選后會(huì)自動(dòng)加入Kotlin相關(guān)的build.gradle配置。
亮點(diǎn)3:最下面多了Android Things,可以直接勾選后創(chuàng)建Android Things應(yīng)用。
亮點(diǎn)4:圖標(biāo)換了,個(gè)人覺(jué)得現(xiàn)在的更簡(jiǎn)潔(騷氣),也挺符合Kotlin語(yǔ)言的風(fēng)格。
亮點(diǎn)5:
項(xiàng)目下的build.gradle的dependencies
ext.kotlin_version = '1.1.2-4'
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
app下的build.gradle:
插件和依賴
apply plugin: 'kotlin-android'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
gradle版本:gradle-4.0-milestone-1-all
遠(yuǎn)程倉(cāng)庫(kù)增加google:maven { url 'https://maven.google.com' }
亮點(diǎn)6:
全新的Android Profiler性能分析和Device File Explorer設(shè)備文件瀏覽面板。
還有一些小圖標(biāo)的更改就不多說(shuō)了。
問(wèn)題發(fā)現(xiàn)
不知道你們遇到?jīng)]有,我遇到了這樣的問(wèn)題:
Error:Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'. Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
查了下stackoverflow,發(fā)現(xiàn)是kotlin版本不對(duì),將
ext.kotlin_version = '1.1.2-3'
修改成
ext.kotlin_version = '1.1.2-4'
再同步一下就ok了。
最后
技術(shù)的發(fā)展是在不斷變化的,找準(zhǔn)方向,擼起袖子就是干。