# "Indirectly used type is defined in an unreferenced assembly"

**URL:** https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250
**Category:** EBuild
**Tags:** android
**Created:** [February 23, 2021, 7:49pm UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250 "2021-02-23T19:49:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![zmattr](https://talk.remobjects.com/user_avatar/talk.remobjects.com/zmattr/32/7989_2.png) [@zmattr](https://talk.remobjects.com/u/zmattr)
#### Post date: [February 23, 2021, 7:49pm UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/1 "2021-02-23T19:49:16Z")

</div>

I’m getting a strange build error when calling the method `openDrawer()` on an Android `DrawerLayout`:

```auto
E: Indirectly used type "androidx.customview.widget.Openable" is defined in an unreferenced assembly ()

```

You can find the code for the [open source DrawerLayout on Github](https://github.com/androidx/androidx/blob/androidx-main/drawerlayout/drawerlayout/src/main/java/androidx/drawerlayout/widget/DrawerLayout.java) and see that it implements `Openable`, which is defined in a DrawerLayout dependency available in `androidx.customview:customview`

```auto
public class DrawerLayout extends ViewGroup implements Openable

```

Even if I include `androidx.customview:customview` in my project as CopyLocal, I still get the same error. I also am getting this error anywhere from .2587 to .2606.

Here’s a sample test case:  
[org.gradletest.zip](https://talk.remobjects.com/uploads/short-url/vi4eJ3dAzGli9FuSDnW78yr0bz8.zip) (44.6 KB)

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 23, 2021, 7:57pm UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/2 "2021-02-23T19:57:28Z")

</div>

This happens when your code uses a.jar and a.jar uses a type from b.jar, but you domino have a reference to b.jar in your own project. Could this be the case here?

---

<div class="post-metadata">

### Author: ![zmattr](https://talk.remobjects.com/user_avatar/talk.remobjects.com/zmattr/32/7989_2.png) [@zmattr](https://talk.remobjects.com/u/zmattr)
#### Post date: [February 23, 2021, 8:01pm UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/3 "2021-02-23T20:01:58Z")

</div>

> [@mh](#):
>
> This happens when your code uses a.jar and a.jar uses a type from b.jar, but you domino have a reference to b.jar in your own project. Could this be the case here?

Ah ok. Well _my_ code isn’t using it here. This is the code for `Openable`, just the 3 methods.

```
public interface Openable {
    boolean isOpen();
    void open();
    void close();
}

```

I’m getting the error trying to use `openDrawer()` on `DrawerLayout`.

And again, even if I include the library that defines `Openable` (which surely I shouldn’t have to?) then I still get the error.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 23, 2021, 8:06pm UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/5 "2021-02-23T20:06:12Z")

</div>

@ck, any thoughts?

---

<div class="post-metadata">

### Author: ![zmattr](https://talk.remobjects.com/user_avatar/talk.remobjects.com/zmattr/32/7989_2.png) [@zmattr](https://talk.remobjects.com/u/zmattr)
#### Post date: [February 23, 2021, 8:29pm UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/6 "2021-02-23T20:29:45Z")

</div>

> [@zmattr](#):
>
> I’m getting the error trying to use `openDrawer()` on `DrawerLayout`.

fwiw I just noticed that in the sample project I uploaded, I’m calling `open()`. But it also happens calling `openDrawer()`

---

<div class="post-metadata">

### Author: ![zmattr](https://talk.remobjects.com/user_avatar/talk.remobjects.com/zmattr/32/7989_2.png) [@zmattr](https://talk.remobjects.com/u/zmattr)
#### Post date: [February 23, 2021, 8:36pm UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/7 "2021-02-23T20:36:22Z")

</div>

Ah ok I found something. If I remove the reference to `appcompat` from the sample project then it builds correctly. AppCompat shows that it depends on `androidx.drawerlayout` but does not show `androidx.customview` as a dependency within that. Perhaps the error is resulting from seeing `androidx.customview` missing as a dependency in the version of `drawerlayout` that is inside of `appcompat`?

 ![Screen Shot 2021-02-23 at 2.35.35 PM](https://talk.remobjects.com/uploads/default/original/2X/4/482c71975b2f90c79d31da4defa0b32c3d82001c.png)

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [February 24, 2021, 5:45am UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/8 "2021-02-24T05:45:26Z")

</div>

Thanks, logged as [bugs://85628](https://www.remobjects.com/portal/bugs/?id=85628)

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [March 10, 2021, 8:06am UTC](https://talk.remobjects.com/t/indirectly-used-type-is-defined-in-an-unreferenced-assembly/24250/9 "2021-03-10T08:06:21Z")

</div>

[bugs://85628](https://www.remobjects.com/portal/bugs/?id=85628) got closed with status fixed.
