LoginSignup
0
0

More than 5 years have passed since last update.

Android Studioで「the number of method references cannot exceed 64k」が表示された時の対処法

Posted at

はじめに

Android Studioでビルドを実行時に以下のようなエラーが表示され、ビルドが通らなく問題が発生しました。

errorメッセージ
the number of method references cannot exceed 64k

今回のエントリではこの問題を解決する方法を説明していきます。

1. multiDexEnabled true を追加

私の場合、app/build.gradle に multiDexEnabled true を追加しただけで解決しました。
詳しい解説は、公式サイトこちらのサイトに書いていましたので確認してみてください。
私も時間があるときにもう少し詳細を調べてまとめてみたいと思います。
具体的に追加する内容は以下の通りです。

app/build.gradle
    .
    .
    .
    defaultConfig {
        applicationId "org.example.samplecode"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 10001
        versionName "1.0.1"
        multiDexEnabled true  // ここを追加
    }
    .
    .
    .

参考文献

  1. Configure Apps with Over 64K Methods _ Android Studio, https://developer.android.com/studio/build/multidex.html?hl=ja, Online; accessed 5-December-2016.
  2. Gradle DSL method not found multiDexEnabled() -でじうぃき, http://onlineconsultant.jp/pukiwiki/?Gradle%20DSL%20method%20not%20found%20%20multiDexEnabled(), Online; accessed 5-December-2016.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0