Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample Application Crashes at runtime #25

Open
BD-SAM opened this issue Aug 22, 2022 · 1 comment
Open

Sample Application Crashes at runtime #25

BD-SAM opened this issue Aug 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@BD-SAM
Copy link

BD-SAM commented Aug 22, 2022

I'm trying to get the sample android application running happily. The only change I've made to the repo is updating build_tools_version to 30.0.3 from 30.0.2 in the WORKSPACE file.

Running: android 8.1.0
Installing with: bazel mobile-install //sample-android:sample-android

The app crashes almost immediately after starting. The stack trace I see immediately is:

2022-08-22 14:10:30.834 31847-31847/com.grab.grazel.android.sample E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.grab.grazel.android.sample, PID: 31847
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.grab.grazel.android.sample/com.grab.grazel.android.sample.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
     Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:699)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
        at com.grab.grazel.android.sample.MainActivity.onCreate(MainActivity.kt:51)
        at android.app.Activity.performCreate(Activity.java:7036)
        at android.app.Activity.performCreate(Activity.java:7027)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/constraintlayout/widget/R$styleable;
        at androidx.constraintlayout.widget.ConstraintLayout.init(ConstraintLayout.java:590)
        at androidx.constraintlayout.widget.ConstraintLayout.<init>(ConstraintLayout.java:567)
        at java.lang.reflect.Constructor.newInstance0(Native Method) 
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:647) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:699) 
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195) 
        at com.grab.grazel.android.sample.MainActivity.onCreate(MainActivity.kt:51) 
        at android.app.Activity.performCreate(Activity.java:7036) 
        at android.app.Activity.performCreate(Activity.java:7027) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6494) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
2022-08-22 14:10:30.835 31847-31847/com.grab.grazel.android.sample E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.constraintlayout.widget.R$styleable" on path: DexPathList[[dex file "/data/local/tmp/incrementaldeployment/com.grab.grazel.android.sample/dex/incremental_classes5.dex", dex file "/data/local/tmp/incrementaldeployment/com.grab.grazel.android.sample/dex/incremental_classes3.dex", dex file "/data/local/tmp/incrementaldeployment/com.grab.grazel.android.sample/dex/incremental_classes4.dex", dex file "/data/local/tmp/incrementaldeployment/com.grab.grazel.android.sample/dex/incremental_classes1.dex", dex file "/data/local/tmp/incrementaldeployment/com.grab.grazel.android.sample/dex/incremental_classes2.dex"],nativeLibraryDirectories=[/data/user/0/com.grab.grazel.android.sample/lib, /system/lib, /vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at com.google.devtools.build.android.incrementaldeployment.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:57)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        	... 26 more

I want to check to see if the sample app is working for others, and if it is, what could I be doing differently.

@BD-SAM
Copy link
Author

BD-SAM commented Aug 22, 2022

Notably, if i just change androidx.constraintlayout.widget.ConstrainLayout to FrameLayout app works fine:

--- a/sample-android/src/main/res/layout/activity_main.xml
+++ b/sample-android/src/main/res/layout/activity_main.xml
@@ -14,7 +14,7 @@
   ~ limitations under the License.
   -->
 
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
@@ -31,4 +31,4 @@
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
+</FrameLayout>
\ No newline at end of file

So issue appears isolated to constraint layout.

@arunkumar9t2 arunkumar9t2 added the bug Something isn't working label Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants