summaryrefslogtreecommitdiff
path: root/android/src/org
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-07-22 12:01:24 -0700
committerDeepanshu Gupta <deepanshu@google.com>2015-07-22 12:42:40 -0700
commit4fe38acb3ddb3c955f64406516de576d1f1e1b3b (patch)
tree90884465b4a7c68b5a3ba0c43c7105ee5dc2d27e /android/src/org
parent3b9ca9a62a55254113ddfb39f0c14b3e021c3d63 (diff)
downloadidea-4fe38acb3ddb3c955f64406516de576d1f1e1b3b.tar.gz
Fix NoClassDefFoundError during rendering.
Bug: http://b.android.com/180719 Change-Id: I20fad7a231db194596e8b3750787a6da9a287f02
Diffstat (limited to 'android/src/org')
-rw-r--r--android/src/org/jetbrains/android/uipreview/ViewLoader.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/android/src/org/jetbrains/android/uipreview/ViewLoader.java b/android/src/org/jetbrains/android/uipreview/ViewLoader.java
index b03c92c0144..5ce1c3b4b25 100644
--- a/android/src/org/jetbrains/android/uipreview/ViewLoader.java
+++ b/android/src/org/jetbrains/android/uipreview/ViewLoader.java
@@ -497,6 +497,12 @@ public class ViewLoader {
catch (ClassNotFoundException e) {
myLogger.setMissingResourceClass(true);
}
+ catch (NoClassDefFoundError e) {
+ // ClassNotFoundException is thrown when no R class was found. But if the R class was found, but not the inner classes (like R$id or
+ // R$styleable), NoClassDefFoundError is thrown. This is likely because R class was generated by AarResourceClassGenerator but the
+ // inner classes weren't needed and hence not generated.
+ myLogger.setMissingResourceClass(true);
+ }
catch (InconvertibleClassError e) {
assert rClassName != null;
myLogger.addIncorrectFormatClass(rClassName, e);