java.lang.NoClassDefFoundError: com.google.android.gms.R$string
I look into my code many time, and I look at each library I am using and I was able to fix it.
First, like @BrainMiz said mutiDexEnabled should set it off. I just comment it instead of set it as false.
defaultConfig {
applicationId "com.package.name"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
//multiDexEnabled true
}
Second, it is the dependencies. Since I don't have any jar in my libs folder I remove
compile fileTree(dir: 'libs', include: ['*.jar'])
also remove all not being used gms library, only add the one that being used. I have to give some credits to @Radix because I did found some error in my code regarding to the code that where I check if the device has google play store.
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'org.twitter4j:twitter4j-core:4.0.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.1.1'
//compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:design:23.1.1'
compile 'com.squareup.okhttp:okhttp:2.5.0'
//compile 'com.android.support:support-v4:23.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.isseiaoki:simplecropview:1.0.8'
compile 'com.qozix:tileview:2.0.7'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
}
I believe you should try turning multiDexEnabled false and get rid of the compile 'com.google.android.gms:play-services-gcm:8.4.0' . You have two play-services which forces you to turn multiDexEnabled to true