From 28185e928f6f04cb6d3a6ae747a0f94a49b18593 Mon Sep 17 00:00:00 2001 From: Dylanc Date: Tue, 29 Mar 2022 18:10:00 +0800 Subject: [PATCH] Fix #45 --- viewbinding-base/build.gradle | 5 ++--- .../java/com/dylanc/viewbinding/base/ViewBindingUtil.kt | 6 +++++- viewbinding-brvah/build.gradle | 3 +-- viewbinding-ktx/build.gradle | 3 +-- viewbinding-nonreflection-ktx/build.gradle | 3 +-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/viewbinding-base/build.gradle b/viewbinding-base/build.gradle index f7bc13b..2e0e6d0 100644 --- a/viewbinding-base/build.gradle +++ b/viewbinding-base/build.gradle @@ -6,7 +6,6 @@ plugins { android { compileSdkVersion 30 - buildToolsVersion "30.0.2" defaultConfig { minSdkVersion buildConfig.minSdkVersion @@ -34,8 +33,8 @@ android { } buildFeatures { - viewBinding = true - dataBinding = true + viewBinding true + dataBinding true } } diff --git a/viewbinding-base/src/main/java/com/dylanc/viewbinding/base/ViewBindingUtil.kt b/viewbinding-base/src/main/java/com/dylanc/viewbinding/base/ViewBindingUtil.kt index 634bb73..3c27095 100644 --- a/viewbinding-base/src/main/java/com/dylanc/viewbinding/base/ViewBindingUtil.kt +++ b/viewbinding-base/src/main/java/com/dylanc/viewbinding/base/ViewBindingUtil.kt @@ -76,7 +76,11 @@ object ViewBindingUtil { } catch (e: NoSuchMethodException) { } catch (e: ClassCastException) { } catch (e: InvocationTargetException) { - throw e.targetException + var tagException: Throwable? = e + while (tagException is InvocationTargetException) { + tagException = e.cause + } + throw tagException ?: IllegalArgumentException("ViewBinding generic was found, but creation failed.") } } } diff --git a/viewbinding-brvah/build.gradle b/viewbinding-brvah/build.gradle index a19d7dc..35fbc45 100644 --- a/viewbinding-brvah/build.gradle +++ b/viewbinding-brvah/build.gradle @@ -5,7 +5,6 @@ plugins { android { compileSdkVersion 30 - buildToolsVersion "30.0.2" defaultConfig { minSdkVersion buildConfig.minSdkVersion @@ -33,7 +32,7 @@ android { } buildFeatures { - viewBinding = true + viewBinding true } } diff --git a/viewbinding-ktx/build.gradle b/viewbinding-ktx/build.gradle index e6cf7ec..42e7660 100644 --- a/viewbinding-ktx/build.gradle +++ b/viewbinding-ktx/build.gradle @@ -6,7 +6,6 @@ plugins { android { compileSdkVersion 30 - buildToolsVersion "30.0.2" defaultConfig { minSdkVersion buildConfig.minSdkVersion @@ -40,7 +39,7 @@ android { } dependencies { - implementation 'com.google.android.material:material:1.4.0' + implementation 'com.google.android.material:material:1.3.0' implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0-alpha03" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' diff --git a/viewbinding-nonreflection-ktx/build.gradle b/viewbinding-nonreflection-ktx/build.gradle index 30ae350..fe0b2ec 100644 --- a/viewbinding-nonreflection-ktx/build.gradle +++ b/viewbinding-nonreflection-ktx/build.gradle @@ -6,7 +6,6 @@ plugins { android { compileSdkVersion 30 - buildToolsVersion "30.0.2" defaultConfig { minSdkVersion buildConfig.minSdkVersion @@ -40,7 +39,7 @@ android { } dependencies { - implementation 'com.google.android.material:material:1.4.0' + implementation 'com.google.android.material:material:1.3.0' implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0-alpha03" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3'