前言
我们在Android Studio的开发中总是会出现一些错误,那也是很正常的,那么我们就要去解决它,可能有时一个很小的错误能让我们花费很多的时间去解决,那么下面我就来说下我遇到的一些问题,当然这只是我记下来的错误,其实在开发过程中还遇到了很多错误,当时没有去写下来,先这些吧,以后遇到了新的错误,我会更新,希望能帮助到有需要的小伙伴们。
Error:Execution failed for task ':app:transformClassesWithDexForRelease'. >
解决办法:引入了两个相同的包或依赖导致
Error:Failed to find Build Tools revision 26.0.2
解决办法:在SDK中下载个SDK Tools revision 26.0.2即可
Error:This Gradle plugin requires Studio 3.0 minimum
或Error:This Gradle plugin requires a newer IDE able to request IDE model level 3
解决办法:在gradle.properties中加入下面这一行代码
android.injected.build.model.only.versioned=3
继上面的错误后,你会发现运行后会出现一个弹窗,不管你点取消还是ok都提示安装不成功,
Installation failed with message INSTALL_FAILED_TEST_ONLY.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
解决办法:在gradle.properties中加入下面这一行代码
android.injected.testOnly=false
Rendering Problems:Failed to load platform rendering library