butterknife

Google material design library error Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Whenever i add implemntation 'com.google.android.material:material:1.0.0-alpha1' when i try to build my project Android Studio says: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy Message{kind=ERROR, text=Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown source file], tool name=Optional.of(D8)} This is my gradle script: apply plugin: 'com.android.application' android { compileSdkVersion 'android-P' defaultConfig { applicationId "it.smart.bab3"

butterknife zelezny can't show in generate menu for AndroidStudio1.3.1

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My Android studio version is 1.3.1, When I add the plugin of butterknife zelezny 1.3.2 by the step: download it and install via Preferences → Plugins → Install plugin from disk. but, failed to show the button of "Generate ButterKnife Injections" in the menu of generate. what's reason of this issue? How can resolve it? Thanks. 回答1: restart your AS right click on R.layout.my_layout choose generate(or click Alt+Insert) you may see "generate Butterknife injections" item in the menu 回答2: I also faced the same .So if am correct you have not added

Butterknife 8.4.0 - Plugin with id 'android-apt' not found

匿名 (未验证) 提交于 2019-12-03 00:48:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I keep getting the error Plugin with id 'android-apt' not found . What's going wrong here? plugins { id "me.tatarka.retrolambda" version "3.2.5" } apply plugin: 'com.android.application' apply plugin: 'android-apt' android { compileSdkVersion 24 buildToolsVersion '23.0.3' dexOptions { javaMaxHeapSize "6g" } defaultConfig { applicationId "com.yitter.android" minSdkVersion 15 targetSdkVersion 24 multiDexEnabled true // Enabling multidex support. renderscriptTargetApi 23 renderscriptSupportModeEnabled true } buildTypes { release { minifyEnabled

常用的Android Studio插件

匿名 (未验证) 提交于 2019-12-03 00:18:01
今天来介绍几款Android Studio常用的插件。 ButterKnifeZeleny 如果你的代码中使用了ButterKnife,那么你一定不能错过 ButterKnifeZeleny 这款插件。这款插件的作用是帮助开发者快速生成诸如 @BindView 、 @onClick 等代码,减少重复劳动。 要使用该插件,打开Android Studio的plugins,在搜索框中搜索并安装即可,安装后重启Studio。插件使用起来非常简单,在你需要使用的 R.layout.xxx 布局文件,鼠标选中布局文件名称,点击右键,选择Generate…,可以看到出现了Generate ButterKnife injections,点击该选项(或者你可以使用快捷键)。在出现的页面选择你要生成的变量,在这里可以修改变量名,选择是否绑定点击时间,是否创建ViewHolder等等。当然,别忘了,使用这个插件的前提是你已经在代码中集成了ButterKnife。 示例如下: RoboPOJOGenerator Android开发中很多情况下会用到JSON,JSON解析我们通常会使用Gson、fastJson、Jackson等工具,但是将json解析成我们本地使用的Bean时如果一个一个变量去写,太low。 RoboPOJOGenerator 可以方便的解决上述的问题。 安装完成重启studio后

butterknife10.1.0遇到的坑

匿名 (未验证) 提交于 2019-12-03 00:02:01
一、使用步骤 1.在app或者model的build.gradle中: apply plugin : 'com.jakewharton.butterknife' android { compileOptions { //指定Java的版本 targetCompatibility JavaVersion . VERSION_1_8 sourceCompatibility JavaVersion . VERSION_1_8 } } dependencies { //添加依赖 implementation "com.jakewharton:butterknife:10.1.0" annotationProcessor "com.jakewharton:butterknife-compiler:10.1.0" } 2.在工程的build.gradle中: dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:10.1.0" classpath "com.jakewharton:butterknife-gradle-plugin:10.1.0" } 二、遇到的坑 1.butterknife10.1.0版本需要配合androidx使用 //替换android.support包 implementation

Kotlin Android View Binding: findViewById vs Butterknife vs Kotlin Android Extension

南笙酒味 提交于 2019-12-02 22:23:10
I'm trying to figure out the best way to do Android View Binding in Kotlin. It seems like there are a few of options out there: findViewById val button: Button by lazy { findViewById<Button>(R.id.button) } Butterknife https://github.com/JakeWharton/butterknife @BindView(R.id.button) lateinit var button: Button Kotlin Android Extensions https://kotlinlang.org/docs/tutorials/android-plugin.html import kotlinx.android.synthetic.main.activity_main.* I'm pretty familiar with findViewById and Butterknife in java land, but what are the pros and cons of each view binding approach in Kotlin? Does

Android: Kotlin with Butterknife

假装没事ソ 提交于 2019-12-02 17:52:54
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 kotterknife, however I have seen an example with pure Butterknife. What am I doing wrong? Nikhil

AndroidX了解一下

十年热恋 提交于 2019-12-02 17:42:19
推荐阅读: Android 开发高手课 温故知新篇 1.说明 官方原文如下 : We hope the division between android.* and androidx.* makes it more obvious which APIs are bundled with the platform, and which are static libraries for app developers that work across different versions of Android. 简单地说就是新的库可以在不同的Android版本上使用。比如之前我们如果使用 support 为27.1.1的相关依赖库时。可能需要所有相关的 support 库都为27.1.1。如果其中有bug的话,可能需要所有的都去升级,存在一个绑定关系,而且正式版的发布周期也很长。 通过AndroidX,我们可以看到实时实现的特性和bug修复。升级个别依赖,不需要对使用的所有其他库进行更新。这就和我们使用Github上的开源库一样的,出了问题,我们可以提出bug和意见。作者修复后,发布新版本,我们就可以直接替换使用了。更加的透明便捷。 2.变化 我选取了几个常用依赖库,我们可以看看变化: Old build artifact AndroidX build artifact com

Android ButterKnife

拟墨画扇 提交于 2019-12-02 16:08:19
问题 I've installed ButterKnife my build.gradle looks like this: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.jakewharton:butterknife:8.4.0' } My loginActivity looks like this: package com.example.egen.forum; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Toast; import butterknife.ButterKnife; import butterknife.OnClick; public class

View null inside fragment

只谈情不闲聊 提交于 2019-12-02 12:30:49
I've been working on this for hours now. Can't find any reason. I can't post the entire fragment here but the following should make it clear. @BindView(R.id.acService) AutoCompleteTextView autocompleteService; @BindView(R.id.acAddress) AutoCompleteTextView autocompleteAddress; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_home, container, false); unbinder = ButterKnife.bind(this, view); initialize(); loadSkillsData(); return view; } private void initialize() { context = getActivity();