本文介紹了升級 Android Studio 3.0 之后遇到的一些問題及解決方案化漆。
本文首發(fā):http://yuweiguocn.github.io/
《將進酒》
君不見积担,黃河之水天上來,奔流到海不復回。
君不見,高堂明鏡悲白發(fā),朝如青絲暮成雪械念!
人生得意須盡歡,莫使金樽空對月运悲。
天生我材必有用龄减,千金散盡還復來。
烹羊宰牛且為樂扇苞,會須一飲三百杯欺殿。
岑夫子寄纵,丹丘生,將進酒脖苏,杯莫停程拭。
與君歌一曲,請君為我傾耳聽棍潘。
鐘鼓饌玉不足貴恃鞋,但愿長醉不復醒。
古來圣賢皆寂寞亦歉,惟有飲者留其名恤浪。
陳王昔時宴平樂,斗酒十千恣歡謔肴楷。
主人何為言少錢水由,徑須沽取對君酌。
五花馬赛蔫、千金裘砂客,呼兒將出換美酒,與爾同銷萬古愁呵恢!
-唐鞠值,李白
針對Flavor添加dimension
提示錯誤:
Error:All flavors must now belong to a named flavor dimension.
The flavor 'flavor_name' is not assigned to a flavor dimension.
解決方案:添加一個dimension即可。
flavorDimensions "api"
圖 官方網(wǎng)站提供的解決方案
9Path圖片編譯錯誤
提示錯誤:
Error:layout bounds on right border must start at edge
解決方案:執(zhí)行命令 gradlew --info assembleDebug 按照錯誤提示修改出錯的 9 path 圖片文件渗钉。
參考鏈接:https://stackoverflow.com/questions/46947961/errorlayout-bounds-on-right-border-must-start-at-edge
解決style錯誤
提示錯誤:
error: style attribute '@android:attr/windowEnterAnimation' not found.
解決方案:刪除@符號即可彤恶。
注解處理器必須顯式聲明
提示錯誤:
Execution failed for task ':app:javaPreCompileDevDebug'.
> Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- tinker-android-anno-1.7.9.jar (com.tencent.tinker:tinker-android-anno:1.7.9)
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
解決方案,顯示添加注解處理器依賴:
annotationProcessor 'com.tencent.tinker:tinker-android-anno:1.7.9'
compileOnly 'com.tencent.tinker:tinker-android-anno:1.7.9'
圖 官方網(wǎng)站提供的解決方案
圖 依賴配置說明