butterknife

Android: Kotlin with Butterknife

筅森魡賤 提交于 2019-12-03 04:43:14
问题 I'm trying to use Kotlin with Butterknife for my Android Application. Here is my build.gradle dependencies { ... compile 'com.jakewharton:butterknife:8.0.1' kapt 'com.jakewharton:butterknife-compiler:8.0.1' } kapt { generateStubs = true } I also has an EditText and I want to show a message using ButterKnife when it is changed: @OnTextChanged(R.id.input) fun test() { toast(1) } However, nothing happens. I put a breakpoint into the function - and it is not even executed. P.S: I have heard about

AndroidStudio disable “Expected resource of type string”

有些话、适合烂在心里 提交于 2019-12-03 04:25:43
I've just tried to generate signed apk for one of my projects (I already did this before), but (maybe since updating Android Studio) I'm getting Error:Error: Expected resource of type string [ResourceType] This is because I'm using Butterknife's @BindString, that is generated into something like that target.settings = res.getString(2131230792); How can I make studio not detect this as error? I've tried searching in settings, but without success. This is reported on the GitHub project . It will be fixed in the next version of ButterKnife. The workaround is indicated there , and is to add a lint

Android Studio - ProGuard IOException Duplicate Zip Entry

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I am trying to set up ProGuard in Gradle for my Android Studio project and I get the following error when building the project: Error:Execution failed for task ':app:proguardDebug'. java.io.IOException: Can't write [C:\Users\Rich\Desktop\WebProjects\AndroidStudioProjects\Roomie\app\build\intermediates\classes-proguard\debug\classes.jar] (Can't read C:\Users\Rich\Desktop\WebProjects\AndroidStudioProjects\Roomie\app\libs\bolts-android-1.1.4.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [a/a.class == bolts-android-1.1.4.jar:bolts

Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: build.gradle buildscript { ext.kotlin_version = '1.1.51' repositories { jcenter() mavenCentral() maven { url "https://jitpack.io" } } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'me.tatarka:gradle-retrolambda:3.6.1' classpath 'com.google.gms:google-services:3.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } app/build.gradle buildscript { repositories { jcenter() } dependencies { classpath 'com.jakewharton:butterknife-gradle-plugin:8.7.0' } } android{ compileSdkVersion = 26

gradle build fails on lint task

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a simple android project that I created with Android Studio 0.4.0. I use Gradle 1.9 and Gradle Android Plugin 0.7. Yesterday I've added Jake Wharton's ButterKnife library in my gradle build script: dependencies { compile 'com.android.support:support-v4:19.0.0' compile 'com.android.support:appcompat-v7:19.0.0' // Butterknife compile 'com.jakewharton:butterknife:4.0.1' } When I run the application from Android Studio, the build runs fine and executes correctly on my devices. But when I try (from the command line) gradle build the build

ButterKnife onclick is not working

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I injected views perfectly using butterknife library. But when I try to implement listeners, for example onclick I'm not able to implement them. Following java code will help you to understand my problem. Java code: public class LoginActivity extends ActionBarActivity { @InjectView ( R . id . toolbar ) Toolbar toolbar ; @InjectView ( R . id . btn_login ) Button login ; @Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . layout . login ); ButterKnife .

Dagger and Butter Knife vs. Android Annotations

♀尐吖头ヾ 提交于 2019-12-03 02:01:58
问题 I am evaluating Dependency Injection (DI) frameworks for an Android app. The top contenders are: Dagger (with Butter Knife) and Android Annotations. I understand that Dagger and ButterKnife are from the same source- square and they complement each other. Here're are the key matrices that I am looking for: Ease of use (our build is based on Gradle and we use Android Studio IDE) Testing support (we use Robotium for functional testing and RoboLectric for unit testing) Performance (DI frameworks

Using ButterKnife library with 2 different views in 1 fragment

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm currently trying to use the ButterKnife library for Android to handle some boilerplate code ( https://github.com/JakeWharton/butterknife ) I've got it set up, and got it semi-working, but i've run into a problem i can't fix :/ I have a Fragment which contains 1 single ListView element, and to this ListView i'm attaching a footer view which contains several elements. This is a code snippet from my fragment using the library: public class UsersFragment extends Fragment { @InjectView(R.id.users_listview_id) AutoUpdatingListView list;

ButterKnife findByID method is deprecated in version 8.8.0

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi I have just updated ButterKnife library version 8.7.0 to 8.8.0 compile 'com.jakewharton:butterknife:8.8.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0' and found that: findById(view, id); is deprecated, why? what method to use instead? but when reverting version to 8.7.0 (or earlier) deprecated warning disappears. compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { applicationId "com.some.app" minSdkVersion 21 targetSdkVersion 25 ... 回答1: Per the change log : findById findViewById Android's findViewById has

How to setup ButterKnife plugin in Android Studio?

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to install the plugin Butter Knife. Where can I download it? I downloaded a .jar plugin (but not if the file is the one I need), I have installed but when I click on the option "generate" not the option to use butterknife appears. following a video tutorial I modified files Gradle build: I have them now as follows: apply plugin: 'android-apt' apply plugin: 'com.android.application' android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { applicationId