一,R程序包找不到
原因:猜測可能是因爲AS版本與根目錄下build.gradle中 classpath 'com.android.tools.build:gradle:3.2.1(version值)', 以及gradle-wrapper.properties下distributionUrl的值不匹配導致的。我的AS是3.2.1,將classpath設置爲3.2.1,並將distributionUrl設置爲gradle-4.6-all.zip後,重新build就ok了。
二,各種類似問題
Android dependency 'androidx.media:media' has different version for the compile (1.0.0-rc01) and runtime (1.0.0) classpath. 除了androidx.media:media之外,還有androidx.fragment***、androidx.vectordrawable:vectordrawable***、androidx.arch.core***等等一系列的問題。我遇到這個問題的原因是,由於我把compat、recyclerview、legacy-support-v4、material等放在依賴庫中了,但是卻是通過Implementation來引用的,導致app裏面其實是引用不到的,所以出現了前面的各種問題。