butterknife

The import butterknife.InjectView cannot be resolved

一曲冷凌霜 提交于 2019-11-29 03:30:26
问题 I am trying to use this library project, so I tried to run the sample application (in /app/source/main/ in the Github link), and in MainActivity.java , I am getting the error on the import import butterknife.InjectView; and also in MainActivity.java and VerticalLinearRecyclerViewSample.java , at every occurance of @InjectView(...) annotation, I get the following error: InjectView cannot be resolved to a type So what should I do about this? WHAT I TRIED: I have seen this question. Didn't work

ButterKnife使用

a 夏天 提交于 2019-11-29 03:06:45
app中的buider.gradle中的dependencies加入: implementation 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 就可以使用 @BindView(R.id.text1) TextView textView; 代替findviewbyid方法。 下面是个简单实例: 1.在activity中: @BindView(R.id.button) Button button; 2.在activity的onCreat中: setContentView(R.layout.activity_main); ButterKnife.bind(this); 3.还是在activity中: @OnClick(R.id.button) void onClickButton(View v) { //do sth } 就可以实现Button的响应。 来源: CSDN 作者: caz28 链接: https://blog.csdn.net/caz28/article/details/103244716

Why is butterknife 9.0.0-SNAPSHOT not resolving?

蹲街弑〆低调 提交于 2019-11-29 01:35:30
问题 I want using AndroidX library and below is my Gradle setup for Butterknife app:module Dependency implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT' Plugin apply plugin: 'com.jakewharton.butterknife' Project Dependency dependencies { classpath 'com.android.tools.build:gradle:3.3.0-alpha09' classpath 'com.google.gms:google-services:4.0.1' classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT' //

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

五迷三道 提交于 2019-11-29 00:57:24
I upgraded my android studio to 3.4 canary and now I cannot successfully build anymore due to the following error: The given artifact contains a string literal with a package reference 'android.support.v4.content' that cannot be safely rewritten. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. More details: Caused by: java.lang.RuntimeException: Failed to transform '.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife-compiler/9.0.0-SNAPSHOT/732f93940c74cf32a7c5ddcc5ef66e53be052352/butterknife-compiler-9.0.0-SNAPSHOT

Using Butter Knife library for view injection

巧了我就是萌 提交于 2019-11-29 00:15:25
What i am doing :: I am trying to run butter knife library for my simple project I have followed all the steps in documentation, but still i am getting log errors How can i resolve this, am i missing any step I have also added the jar in libs folder MainActivity.java package com.example.butterknife; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import butterknife.ButterKnife; import butterknife.InjectView; public class MainActivity extends Activity { @InjectView(R.id.txtID) TextView title; @Override protected void onCreate(Bundle savedInstanceState) {

Gradle DSL method not found: 'apt()'

我是研究僧i 提交于 2019-11-28 23:35:24
问题 I am trying to add the latest version of butterknife and I get this error from gradle: Error:(31, 0) Gradle DSL method not found: 'apt()' Possible causes: The project 'MyProject' may be using a version of Gradle that does not contain the method. Gradle settings The build file may be missing a Gradle plugin. Apply Gradle plugin Where my gradle mobile build.gradle is: plugins { id "net.ltgt.apt" version "0.6" } apply plugin: 'com.android.application' android { compileSdkVersion 23

Why is butterknife 9.0.0-SNAPSHOT not resolving?

空扰寡人 提交于 2019-11-28 20:51:37
I want using AndroidX library and below is my Gradle setup for Butterknife app:module Dependency implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT' Plugin apply plugin: 'com.jakewharton.butterknife' Project Dependency dependencies { classpath 'com.android.tools.build:gradle:3.3.0-alpha09' classpath 'com.google.gms:google-services:4.0.1' classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT' // NOTE: Do not place your application dependencies here; they belong // in the individual module build

Android进阶之绘制-自定义View完全掌握(三)

て烟熏妆下的殇ゞ 提交于 2019-11-28 15:08:21
自定义View系列的第三篇博客,我们来学习如何实现自定义下拉框。 今天的程序,我们来实现这样的一个效果。 布局非常简单,我们直接开始编码。 修改activity_main.xml文件的代码。 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.itcast.test0430.MainActivity"> <EditText android:id="@+id/et_input" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="middle" android:hint="请输入内容..." android

Android进阶之绘制-自定义View完全掌握(二)

試著忘記壹切 提交于 2019-11-28 15:08:12
这是自定义View系列的第二篇博客,我们继续来学习关于自定义View的知识。 今天我们来实现一下广告条案例。 我们要实现的是这样的一个效果。 要想实现这样的效果,我们可以借助ViewPager控件,然后加上自定义的一些控件即可完成。那么现在就开始吧。 新建一个android项目。 修改activity_main.xml文件。 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.itcast.test0429.MainActivity"> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent"