Solution of adding ButterKnife to Android to report error Error: of 2 0 Cannot add extension with name 'android'

  • 2021-10-25 08:02:01
  • OfStack

In adding ButterKnife According to its Readme Error report after configuration:

Error:(2, 0) Cannot add extension with name 'android', as there is an extension already registered with that name.

The solution is as follows:

By default, we are in our own module The following is added as follows:

apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
apply plugin: 'com.jakewharton.butterknife'

At this point, we just need to delete

apply plugin: 'com.android.library'

This 1 line will do, because it follows com.android.application Conflict.

Summarize


Related articles: