My problem was resolved by adding "multiDexEnabled true" as shown in the build.gradle module.
android { ... defaultConfig { ... multiDexEnabled true
Update
Using the code above, I was able to create and run on debugging devices (below the version of "marshmallow"), but on "marshmallow" devices I found the following error.
: 6: error: android.support.multidex package does not exist. import android.support.multidex.MultiDexApplication;
To solve the problem, I have to use the following command in the build.gradle module of the project.
compile 'com.android.support:multidex:1.0.1'
source share