@OnClick method from Butterknife crashes app with java.lang.BootstrapMethodError












4















I am using Butterknife to simplify my code.
I have a TextView in the activity_main.xml file.
I want to display a toast by clicking on this TextView
But when I use @OnClick annotation from Butterknife library my app crashes



MainActivity.java



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
}

@OnClick(R.id.clickme) void clicked() {
Toast.makeText(MainActivity.this, "Clicked", Toast.LENGTH_SHORT).show();
}


activity_main.xml



<TextView
android:id="@+id/clickme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="click me"/>


Normally it should display a toast but the app crashes with the following stack trace.



2019-01-02 15:26:42.617 3909-3909/com.realestate.app.realestate E/AndroidRuntime: FATAL EXCEPTION: main
**Process: com.realestate.app.realestate, PID: 3909
java.lang.BootstrapMethodError: Exception from call site #1 bootstrap method
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12)
at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)**
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at butterknife.ButterKnife.bind(ButterKnife.java:171)
at butterknife.ButterKnife.bind(ButterKnife.java:100)
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6680)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassCastException: Bootstrap method returned null
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12) 
**at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)** 
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
at butterknife.ButterKnife.bind(ButterKnife.java:171) 
at butterknife.ButterKnife.bind(ButterKnife.java:100) 
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25) 
at android.app.Activity.performCreate(Activity.java:7136) 
at android.app.Activity.performCreate(Activity.java:7127) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6680) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 


My gradle dependency for Butterknife



implementation 'com.jakewharton:butterknife:9.0.0-rc3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'









share|improve this question

























  • Have you implemented ButterKnife.bind(this); in your onCreate method?

    – Nero
    Jan 2 at 10:28











  • Yes sir, I have added that statement. But the error still seem to exist

    – Nishat sAyyed
    Jan 2 at 10:29











  • Please see the new edit. Thank you

    – Nishat sAyyed
    Jan 2 at 10:32











  • Try cleaning your project (maybe few attempts i.e. 3 to 5 times) as I can't spot anything wrong with your code.

    – Nero
    Jan 2 at 10:45











  • Downgrade your butterKnife version once, nothing wrong with your code

    – Ulug Toprak
    Jan 2 at 11:19
















4















I am using Butterknife to simplify my code.
I have a TextView in the activity_main.xml file.
I want to display a toast by clicking on this TextView
But when I use @OnClick annotation from Butterknife library my app crashes



MainActivity.java



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
}

@OnClick(R.id.clickme) void clicked() {
Toast.makeText(MainActivity.this, "Clicked", Toast.LENGTH_SHORT).show();
}


activity_main.xml



<TextView
android:id="@+id/clickme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="click me"/>


Normally it should display a toast but the app crashes with the following stack trace.



2019-01-02 15:26:42.617 3909-3909/com.realestate.app.realestate E/AndroidRuntime: FATAL EXCEPTION: main
**Process: com.realestate.app.realestate, PID: 3909
java.lang.BootstrapMethodError: Exception from call site #1 bootstrap method
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12)
at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)**
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at butterknife.ButterKnife.bind(ButterKnife.java:171)
at butterknife.ButterKnife.bind(ButterKnife.java:100)
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6680)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassCastException: Bootstrap method returned null
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12) 
**at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)** 
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
at butterknife.ButterKnife.bind(ButterKnife.java:171) 
at butterknife.ButterKnife.bind(ButterKnife.java:100) 
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25) 
at android.app.Activity.performCreate(Activity.java:7136) 
at android.app.Activity.performCreate(Activity.java:7127) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6680) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 


My gradle dependency for Butterknife



implementation 'com.jakewharton:butterknife:9.0.0-rc3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'









share|improve this question

























  • Have you implemented ButterKnife.bind(this); in your onCreate method?

    – Nero
    Jan 2 at 10:28











  • Yes sir, I have added that statement. But the error still seem to exist

    – Nishat sAyyed
    Jan 2 at 10:29











  • Please see the new edit. Thank you

    – Nishat sAyyed
    Jan 2 at 10:32











  • Try cleaning your project (maybe few attempts i.e. 3 to 5 times) as I can't spot anything wrong with your code.

    – Nero
    Jan 2 at 10:45











  • Downgrade your butterKnife version once, nothing wrong with your code

    – Ulug Toprak
    Jan 2 at 11:19














4












4








4








I am using Butterknife to simplify my code.
I have a TextView in the activity_main.xml file.
I want to display a toast by clicking on this TextView
But when I use @OnClick annotation from Butterknife library my app crashes



MainActivity.java



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
}

@OnClick(R.id.clickme) void clicked() {
Toast.makeText(MainActivity.this, "Clicked", Toast.LENGTH_SHORT).show();
}


activity_main.xml



<TextView
android:id="@+id/clickme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="click me"/>


Normally it should display a toast but the app crashes with the following stack trace.



2019-01-02 15:26:42.617 3909-3909/com.realestate.app.realestate E/AndroidRuntime: FATAL EXCEPTION: main
**Process: com.realestate.app.realestate, PID: 3909
java.lang.BootstrapMethodError: Exception from call site #1 bootstrap method
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12)
at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)**
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at butterknife.ButterKnife.bind(ButterKnife.java:171)
at butterknife.ButterKnife.bind(ButterKnife.java:100)
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6680)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassCastException: Bootstrap method returned null
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12) 
**at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)** 
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
at butterknife.ButterKnife.bind(ButterKnife.java:171) 
at butterknife.ButterKnife.bind(ButterKnife.java:100) 
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25) 
at android.app.Activity.performCreate(Activity.java:7136) 
at android.app.Activity.performCreate(Activity.java:7127) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6680) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 


My gradle dependency for Butterknife



implementation 'com.jakewharton:butterknife:9.0.0-rc3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'









share|improve this question
















I am using Butterknife to simplify my code.
I have a TextView in the activity_main.xml file.
I want to display a toast by clicking on this TextView
But when I use @OnClick annotation from Butterknife library my app crashes



MainActivity.java



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
}

@OnClick(R.id.clickme) void clicked() {
Toast.makeText(MainActivity.this, "Clicked", Toast.LENGTH_SHORT).show();
}


activity_main.xml



<TextView
android:id="@+id/clickme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="click me"/>


Normally it should display a toast but the app crashes with the following stack trace.



2019-01-02 15:26:42.617 3909-3909/com.realestate.app.realestate E/AndroidRuntime: FATAL EXCEPTION: main
**Process: com.realestate.app.realestate, PID: 3909
java.lang.BootstrapMethodError: Exception from call site #1 bootstrap method
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12)
at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)**
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at butterknife.ButterKnife.bind(ButterKnife.java:171)
at butterknife.ButterKnife.bind(ButterKnife.java:100)
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6680)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassCastException: Bootstrap method returned null
at butterknife.internal.DebouncingOnClickListener.<clinit>(DebouncingOnClickListener.java:12) 
**at com.realestate.app.realestate.realestate.MainActivity_ViewBinding.<init>(MainActivity_ViewBinding.java:34)** 
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
at butterknife.ButterKnife.bind(ButterKnife.java:171) 
at butterknife.ButterKnife.bind(ButterKnife.java:100) 
at com.realestate.app.realestate.realestate.MainActivity.onCreate(MainActivity.java:25) 
at android.app.Activity.performCreate(Activity.java:7136) 
at android.app.Activity.performCreate(Activity.java:7127) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2894) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3049) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1809) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6680) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 


My gradle dependency for Butterknife



implementation 'com.jakewharton:butterknife:9.0.0-rc3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'






java android butterknife






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 11:09









Gayan Mettananda

1,102713




1,102713










asked Jan 2 at 10:23









Nishat sAyyedNishat sAyyed

366




366













  • Have you implemented ButterKnife.bind(this); in your onCreate method?

    – Nero
    Jan 2 at 10:28











  • Yes sir, I have added that statement. But the error still seem to exist

    – Nishat sAyyed
    Jan 2 at 10:29











  • Please see the new edit. Thank you

    – Nishat sAyyed
    Jan 2 at 10:32











  • Try cleaning your project (maybe few attempts i.e. 3 to 5 times) as I can't spot anything wrong with your code.

    – Nero
    Jan 2 at 10:45











  • Downgrade your butterKnife version once, nothing wrong with your code

    – Ulug Toprak
    Jan 2 at 11:19



















  • Have you implemented ButterKnife.bind(this); in your onCreate method?

    – Nero
    Jan 2 at 10:28











  • Yes sir, I have added that statement. But the error still seem to exist

    – Nishat sAyyed
    Jan 2 at 10:29











  • Please see the new edit. Thank you

    – Nishat sAyyed
    Jan 2 at 10:32











  • Try cleaning your project (maybe few attempts i.e. 3 to 5 times) as I can't spot anything wrong with your code.

    – Nero
    Jan 2 at 10:45











  • Downgrade your butterKnife version once, nothing wrong with your code

    – Ulug Toprak
    Jan 2 at 11:19

















Have you implemented ButterKnife.bind(this); in your onCreate method?

– Nero
Jan 2 at 10:28





Have you implemented ButterKnife.bind(this); in your onCreate method?

– Nero
Jan 2 at 10:28













Yes sir, I have added that statement. But the error still seem to exist

– Nishat sAyyed
Jan 2 at 10:29





Yes sir, I have added that statement. But the error still seem to exist

– Nishat sAyyed
Jan 2 at 10:29













Please see the new edit. Thank you

– Nishat sAyyed
Jan 2 at 10:32





Please see the new edit. Thank you

– Nishat sAyyed
Jan 2 at 10:32













Try cleaning your project (maybe few attempts i.e. 3 to 5 times) as I can't spot anything wrong with your code.

– Nero
Jan 2 at 10:45





Try cleaning your project (maybe few attempts i.e. 3 to 5 times) as I can't spot anything wrong with your code.

– Nero
Jan 2 at 10:45













Downgrade your butterKnife version once, nothing wrong with your code

– Ulug Toprak
Jan 2 at 11:19





Downgrade your butterKnife version once, nothing wrong with your code

– Ulug Toprak
Jan 2 at 11:19












2 Answers
2






active

oldest

votes


















1














I solved it by downgrading the library version.



I replaced the following



implementation 'com.jakewharton:butterknife:9.0.0-rc3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'


with



implementation 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'





share|improve this answer































    0














    Maybe there is some other dependency in your build.gradle that transitively pulls in a different version of ButterKnife. Check your dependency tree with gradlew dependencies, and look for different versions of ButterKnife.



    If you find that e.g. the com.example:foo dependency pulls in a ButterKnife version different from yours, you can exclude the other ButterKnife version by adding an exclude rule to the foo library:



    implementation('com.example:foo:1.2.3') {
    exclude group: 'com.jakewharton', module: 'butterknife'
    }


    Hopefully this will solve the runtime exception.






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54004624%2fonclick-method-from-butterknife-crashes-app-with-java-lang-bootstrapmethoderror%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      I solved it by downgrading the library version.



      I replaced the following



      implementation 'com.jakewharton:butterknife:9.0.0-rc3'
      annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'


      with



      implementation 'com.jakewharton:butterknife:9.0.0-rc1'
      annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'





      share|improve this answer




























        1














        I solved it by downgrading the library version.



        I replaced the following



        implementation 'com.jakewharton:butterknife:9.0.0-rc3'
        annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'


        with



        implementation 'com.jakewharton:butterknife:9.0.0-rc1'
        annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'





        share|improve this answer


























          1












          1








          1







          I solved it by downgrading the library version.



          I replaced the following



          implementation 'com.jakewharton:butterknife:9.0.0-rc3'
          annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'


          with



          implementation 'com.jakewharton:butterknife:9.0.0-rc1'
          annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'





          share|improve this answer













          I solved it by downgrading the library version.



          I replaced the following



          implementation 'com.jakewharton:butterknife:9.0.0-rc3'
          annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc3'


          with



          implementation 'com.jakewharton:butterknife:9.0.0-rc1'
          annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 7 at 5:48









          Nishat sAyyedNishat sAyyed

          366




          366

























              0














              Maybe there is some other dependency in your build.gradle that transitively pulls in a different version of ButterKnife. Check your dependency tree with gradlew dependencies, and look for different versions of ButterKnife.



              If you find that e.g. the com.example:foo dependency pulls in a ButterKnife version different from yours, you can exclude the other ButterKnife version by adding an exclude rule to the foo library:



              implementation('com.example:foo:1.2.3') {
              exclude group: 'com.jakewharton', module: 'butterknife'
              }


              Hopefully this will solve the runtime exception.






              share|improve this answer




























                0














                Maybe there is some other dependency in your build.gradle that transitively pulls in a different version of ButterKnife. Check your dependency tree with gradlew dependencies, and look for different versions of ButterKnife.



                If you find that e.g. the com.example:foo dependency pulls in a ButterKnife version different from yours, you can exclude the other ButterKnife version by adding an exclude rule to the foo library:



                implementation('com.example:foo:1.2.3') {
                exclude group: 'com.jakewharton', module: 'butterknife'
                }


                Hopefully this will solve the runtime exception.






                share|improve this answer


























                  0












                  0








                  0







                  Maybe there is some other dependency in your build.gradle that transitively pulls in a different version of ButterKnife. Check your dependency tree with gradlew dependencies, and look for different versions of ButterKnife.



                  If you find that e.g. the com.example:foo dependency pulls in a ButterKnife version different from yours, you can exclude the other ButterKnife version by adding an exclude rule to the foo library:



                  implementation('com.example:foo:1.2.3') {
                  exclude group: 'com.jakewharton', module: 'butterknife'
                  }


                  Hopefully this will solve the runtime exception.






                  share|improve this answer













                  Maybe there is some other dependency in your build.gradle that transitively pulls in a different version of ButterKnife. Check your dependency tree with gradlew dependencies, and look for different versions of ButterKnife.



                  If you find that e.g. the com.example:foo dependency pulls in a ButterKnife version different from yours, you can exclude the other ButterKnife version by adding an exclude rule to the foo library:



                  implementation('com.example:foo:1.2.3') {
                  exclude group: 'com.jakewharton', module: 'butterknife'
                  }


                  Hopefully this will solve the runtime exception.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 2 at 14:22









                  Janos BreuerJanos Breuer

                  36115




                  36115






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54004624%2fonclick-method-from-butterknife-crashes-app-with-java-lang-bootstrapmethoderror%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Monofisismo

                      Angular Downloading a file using contenturl with Basic Authentication

                      Olmecas