Butterknife: Cannot add extension with name 'android'

Created on 15 Mar 2017  路  4Comments  路  Source: JakeWharton/butterknife

The readme says to add the following in the module:

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

But if I add it to the already present plugins, i have:

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

This however gives me the following error:

Cannot add extension with name 'android', as there is an extension already registered with that name.

Most helpful comment

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

add one of these two, not both.

All 4 comments

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

add one of these two, not both.

Only the one with "application" works, if I try to add only the library, it gives the error:

Error:Library projects cannot set applicationId. applicationId is set to XXX in default config.

@JakeWharton I think the README.MD needs to be updated

@JakeWharton I think the README.MD needs to be updated

apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
BECAUSE NOBODY KNOWS add one of these two, not both.

Was this page helpful?
0 / 5 - 0 ratings