Android开发中的一些错误

作者: Zarriam | 来源:发表于2019-05-04 22:51 被阅读27次

    前言

    我们在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

    API26,太高了不适配你的代码 换成更小的API即可解决

    相关文章

      网友评论

        本文标题:Android开发中的一些错误

        本文链接:https://www.haomeiwen.com/subject/jeqqoqtx.html