Studio升級後報下邊的錯:
Error while executing: am start -n
"com.boyou.boyou/com.boyou.boyou.activity.LoginActivity"
-a android.intent.action.MAIN
-c android.intent.category.LAUNCHER Starting: Intent { act
1、需要在Gradle中進行升級:
dependencies { classpath 'com.android.tools.build:gradle:3.3.2' }
2、Gradle必須和Studio對應應用4.X以上
gradle\wrapper\gradle-wrapper.properties 配置自動下載的路徑: distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip 如果C:\Users\LENOVO\.gradle\wrapper\dists緩存裏有就不用下載。
3、在AndroidManifest.xml裏application中添加
tools:ignore="GoogleAppIndexingWarning" tools:replace="android:appComponentFactory" android:appComponentFactory="android.support.v4.app.CoreComponentFactory"
4、選擇工程右鍵→Refactor→Migrate to Androidx...,
選中所有需要重命名的目錄,執行Do Refactor,發現已經看不到support庫了,運行成功安裝app。
5、最新官方推薦 implementation 用來代替 compile, implementation 會使AS編譯速度更快