1

For example I would like to try out android.widget.Space. After including it in my layout like this

<Space
    app:layout_constraintTop_toBottomOf="@id/theoneabove"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:background="@color/colorPrimaryDark"/>

I get the error

Didn't find class "android.support.v7.widget.Space" 

How can I work out what library and which version apart from the API version to include in my gradle dependencies?

There doesn't seem to be any pointers on the documentation page or on these pages which at least removes some of the guesswork for some other things.

nsandersen
  • 896
  • 2
  • 16
  • 41
  • I don't see where there is such a widget in the SDK. I assume that you are using this in a layout. Can you post the layout? And, are you using that layout in an `AppCompatActivity`? Or, based on a search on that fully-qualified class name, change it to `v4`: https://stackoverflow.com/a/42517231/115145 https://stackoverflow.com/q/42895981/115145 – CommonsWare Jul 04 '19 at 22:32
  • I use it in a ConstraintLayout for an android.app.Activity. v4.Space is deprecated though(?) – nsandersen Jul 04 '19 at 22:52
  • "I use it in a ConstraintLayout for an android.app.Activity" -- OK, that's stranger yet. Usually, this sort of class substitution is done by a custom `LayoutInflater`, such as the one AppCompat uses. Have you tried fully-qualifying the element to be `android.widget.Space` instead of just `Space`? – CommonsWare Jul 04 '19 at 22:57
  • Yes, both resolve to android.support.v7.widget.Space. – nsandersen Jul 05 '19 at 20:27
  • This feels like a bug. If you are in position to create a reproducible test case, you might consider filing a bug report. On the whole, I don't know what to tell you in terms of getting past the problem. Personally, I don't think that I have ever used `Space`. – CommonsWare Jul 05 '19 at 20:39

0 Answers0