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

A Carbon app is not inspectable with the Layout Inspector #439

Open
jlauridsen opened this issue Nov 22, 2022 · 0 comments
Open

A Carbon app is not inspectable with the Layout Inspector #439

jlauridsen opened this issue Nov 22, 2022 · 0 comments

Comments

@jlauridsen
Copy link

Steps to reproduce:

  1. Run the sample Carbon application on an API 33 emulator
  2. In Android Studio: Open the Layout Inspector and connect to the app
  3. Select LinearLayout in the component tree of the Layout Inspector

Exception seen in logcat:
tk.zielony.carbonsamples E Inspector layoutinspector.view.inspection crashed
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.res.ColorStateList.getDefaultColor()' on a null object reference
at carbon.widget.LinearLayout.getOutlineAmbientShadowColor(LinearLayout.java:788)
at android.view.View$InspectionCompanion.readProperties(View$InspectionCompanion.java:768)
at android.view.View$InspectionCompanion.readProperties(View$InspectionCompanion.java:18)
at com.android.tools.agent.appinspection.proto.property.PropertyCache$Data.readProperties(PropertyCache.kt:44)
at com.android.tools.agent.appinspection.proto.ViewExtensionsKt.createPropertyGroupImpl(ViewExtensions.kt:223)
at com.android.tools.agent.appinspection.proto.ViewExtensionsKt.createPropertyGroup(ViewExtensions.kt:191)
at com.android.tools.agent.appinspection.proto.ViewExtensionsKt.createGetPropertiesResponse(ViewExtensions.kt:181)
at com.android.tools.agent.appinspection.ViewLayoutInspector$handleGetProperties$1$1.run(ViewLayoutInspector.kt:788)
at com.android.tools.agent.app.inspection.concurrent.HandlerThreadExecutor$SafeHandler.dispatchMessage(HandlerThreadExecutor.java:71)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.os.HandlerThread.run(HandlerThread.java:67)

This is because carbon.widget.LinearLayout.getOutlineAmbientShadowColor is dereferencing the ambitneShadowColor unconditionally when it is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant