-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error:(38, 21) The method bind(LoginActivity) is undefined for the type ButterKnife #990
Comments
Does it work when Jack is disabled?
…On Sun, Jun 25, 2017, 1:04 AM MojoJojo ***@***.***> wrote:
I am using Butterknife for the first time and I am not sure what I am
doing wrong. I am getting the following error:
Error:(38, 21) The method bind(LoginActivity) is undefined for the type ButterKnife
Error:(36, 21) The method bind(SignupActivity) is undefined for the type ButterKnife
Error:Execution failed for task ':app:transformJackWithJackForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack compilation exception
This is what my activities look like:
import com.myapp.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class LoginActivity extends Activity {
private static final String TAG = "LoginActivity";
private static final int REQUEST_SIGNUP = 0;
@BindView(R.id.input_email) EditText _emailText;
@BindView(R.id.input_password) EditText _passwordText;
@BindView(R.id.btn_login) Button _loginButton;
@BindView(R.id.link_signup) TextView _signupLink;
@OverRide
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login_main);
ButterKnife.bind(this);
...
And
import com.myapp.R;
import butterknife.ButterKnife;
import butterknife.BindView;
public class SignupActivity extends Activity {
private static final String TAG = "SignupActivity";
@BindView(R.id.input_name) EditText _nameText;
@BindView(R.id.input_email) EditText _emailText;
@BindView(R.id.input_password) EditText _passwordText;
@BindView(R.id.btn_signup) Button _signupButton;
@BindView(R.id.link_login) TextView _loginLink;
@OverRide
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.signup_main);
ButterKnife.bind(this);
...
I have this in my gradle.properties:
org.gradle.jvmargs=-Xmx1536m
These are my dependencies for butterknife:
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
Here's my gradle's main settings:
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#990>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAEEEcvEDaCunsMca_aCuiYDzjswpo6aks5sHfh8gaJpZM4OEhnb>
.
|
Great suggestion! I just tried it and it did work. I am wondering if there's a workaround to keep jack on and still be able to use butterknife? |
Jack is deprecated so you should migrate away from it. We have no plans to
support it moving forward.
…On Sun, Jun 25, 2017, 5:05 PM MojoJojo ***@***.***> wrote:
Great suggestion! I just tried it and it did work. I am wondering if
there's a workaround to keep jack on and still be able to use butterknife?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#990 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEfBI54MObOk6H3paWfFSwEv43Rceks5sHtnGgaJpZM4OEhnb>
.
|
Thanks for letting me know, Jack. I wasn't aware of that. I'll definitely try to migrate away from it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using Butterknife for the first time and I am not sure what I am doing wrong. I am getting the following error:
This is what my activities look like:
And
I have this in my gradle.properties:
These are my dependencies for butterknife:
Here's my gradle's main settings:
The text was updated successfully, but these errors were encountered: