Android Studio - Failed to apply plugin [id 'com.android.application']

后端 未结 17 1988
故里飘歌
故里飘歌 2020-12-08 12:38

I am working on an app. In my app there is no error in code but when I try to run my project it gives following errors.

Error:(1, 1) A problem occurred e

相关标签:
17条回答
  • 2020-12-08 13:37

    delete C:\Users\username\caches folder.

    0 讨论(0)
  • 2020-12-08 13:38

    Open the project on Android Studio and let it solve the problems for you

    It immediately shows at the left bottom:

    Then click that link, and it will fix the right files for you.

    This ended up fixing the Gradle version as mentioned at: https://stackoverflow.com/a/37091489/895245 but it also fixed further errors, so it is the easiest thing to do.

    Tested on https://github.com/googlesamples/android-vulkan-tutorials/tree/7ba478ac2e0d9006c9e2e261446003a4449b8aa3/tutorial05_triangle , Android Studio 2.3, Ubuntu 14.04.

    0 讨论(0)
  • 2020-12-08 13:39

    Whenever you update your Gradle files do not forget to check the compatible Gradle wrapper distibutionUrl, in your case it happened because of the same.

    distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip

    0 讨论(0)
  • 2020-12-08 13:39

    In my case delete your gradle file and then again import your file again it will work

    0 讨论(0)
  • 2020-12-08 13:39

    First of all, before trying the most complicated things you should make the step easier, in my case this bug just happened on my way until the project contained 'spaces' for example:

    Replace:

    C://Users/Silva Neto/OneDrive/Work space/project
    

    With:

    C://Users/SilvaNeto/OneDrive/Workspace/project
    

    Notice that we replaced spaces with camelCase but you can choose any naming scheme you like, and hopefully this could solve your issue.

    I hope this will help.

    0 讨论(0)
提交回复
热议问题