Android: Kotlin with Butterknife

There’s no need for butterknife in Kotlin. You can directly use the following: // app:build.gradle file apply plugin: ‘com.android.application’ apply plugin: ‘kotlin-android’ apply plugin: ‘kotlin-android-extensions’ apply plugin: ‘kotlin-kapt’ android { compileSdkVersion 26 buildToolsVersion “26.0.1” defaultConfig { applicationId “com.example.nikhiljadhav.myapplication” minSdkVersion 15 targetSdkVersion 26 versionCode 1 versionName “1.0” testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner” } buildTypes { release { minifyEnabled false … Read more

ButterKnife 8.0.1 not working

Per the readme, you need to include the butterknife-compiler in order for the generated code to be produced automatically: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’ } } apply plugin: ‘com.neenbedankt.android-apt’ dependencies { compile ‘com.jakewharton:butterknife:8.0.1’ apt ‘com.jakewharton:butterknife-compiler:8.0.1’ } Without this there is no generated code to be loaded and thus none of … Read more

Dagger and Butter Knife vs. Android Annotations

AndroidAnnotations uses compile time annotation processing. It generates a sub class with an underscore apppended to the original name (MyActivity_ generated from MyActivity). So to have it work you always have to use the generated class for references instead of your original class. It has a very rich feature set, see the list of available … Read more

Difference between Dagger and ButterKnife Android

ButterKnife is targeted to inject views only. Non-activity injection just means that you can provide your own view root to inject views from (like with manually inflated views, etc.). Dagger is a bit more complicated. It can inject anything you want as long as you specified Module – class which satisfies those dependencies (alternatively you … Read more

The given artifact contains a string literal with a package reference ‘android.support.v4.content’ that cannot be safely rewritten. for androidx

New correct answer: Butterknife 10.0.0 added support for AndroidX. dependencies { implementation ‘com.jakewharton:butterknife:10.0.0’ annotationProcessor ‘com.jakewharton:butterknife-compiler:10.0.0’ } Old answer for Butterknife < 10.0.0: Try blacklisting butterknife from the jetifier: gradle.properties file: android.jetifier.blacklist = butterknife.*\\.jar You need to be on the 3.3.0-rc1 of the AGP and the 1.3.0 version of the Kotlin Gradle plugin: buildscript { repositories … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)