java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string; java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string; android android

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string;


If you are using Realm plugin in your app, then you could try upgrading your plugin as it was one of the reason why app crashed while running.


Steps to update realm plugin:

  • Open build.gradle(Project: Project_name_here) file.
  • Replace classpath of realm gradle plugin with the latest stable version as follows:
  • classpath "io.realm:realm-gradle-plugin:7.0.0"


Also, please check for any outdated plugins within build.gradle file as it may be one of the reason why the app crashes.


OR

I faced similar issue after updating Android Studio to 3.6 with Gradle 3.6.0.

I downgraded my Gradle to 3.5.3 in-order to resolve this issue until it gets fixed in future.


Steps:

  • Open build.gradle(Project: Project_name_here) file.
  • Replace classpath of android tools build gradle under dependencies with the following:
  • classpath 'com.android.tools.build:gradle:3.5.3'



Please Note: This is a temporary fix. It may get fixed in future, so until then downgrade and continue with app development.


If you have just updated your project to Gradle 3.6.0 and are using Realm there is a very high chance that this issue was caused by the Realm plugin.Accordingly to this comment, this issue happens for older Realm plugin versions, less than 5.13.1.So just updating to the latest Realm version will most likely solve the problem.

As of the time of writing it was:classpath "io.realm:realm-gradle-plugin:6.1.0"


You have to update your REALM-PLUGIN and you need to write this in Top-Level Gradle (Project:Gradle), copy paste below "classpath" line:

buildscript {  ...   dependencies {    classpath 'io.realm:realm-gradle-plugin:7.0.0' //<--Your answer.  }}