# java.lang.IllegalStateException: DeepAR not yet initialized! Can't call this method before the DeepAR is initialized

**URL:** <https://forum.deepar.ai/t/java-lang-illegalstateexception-deepar-not-yet-initialized-cant-call-this-method-before-the-deepar-is-initialized/694>\
**Category:** Bugs\
**Created:** [May 30, 2024, 1:53pm UTC](https://forum.deepar.ai/t/java-lang-illegalstateexception-deepar-not-yet-initialized-cant-call-this-method-before-the-deepar-is-initialized/694 "2024-05-30T13:53:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashank\_Singh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/shashank_singh/32/881_2.png) [@Shashank\_Singh](https://forum.deepar.ai/u/Shashank_Singh)\
**Post date:** [May 30, 2024, 1:53pm UTC](https://forum.deepar.ai/t/java-lang-illegalstateexception-deepar-not-yet-initialized-cant-call-this-method-before-the-deepar-is-initialized/694/1 "2024-05-30T13:53:33Z")

</div>

Hi , i was encountering this error  
java.lang.IllegalStateException: DeepAR not yet initialized! Can’t call this method before the DeepAR is initialized.

i have initialised my deep Ar instance inside onviewCreated and the code looks like this  
if (context!=null){  
deepAr = DeepAR(requireContext())  
deepAr?.setLicenseKey(“my\_key”)  
deepAr?.initialize(requireContext(), this)  
}

then i am having a log statement inside initialised callback of ArEventlistener callback , but the log never prints  
i have added code inside manifest

```auto
<uses-native-library
            android:name="libOpenCL.so"
            android:required="false" />
 <uses-native-library
            android:name="libOpenCL-pixel.so"
            android:required="false" />

```

i have added required code inside my build gradle. can anyone help me with this issue ?

---

<div class="post-metadata">

**Author:** ![Sid](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/sid/32/882_2.png) [@Sid](https://forum.deepar.ai/u/Sid)\
**Post date:** [May 31, 2024, 6:33am UTC](https://forum.deepar.ai/t/java-lang-illegalstateexception-deepar-not-yet-initialized-cant-call-this-method-before-the-deepar-is-initialized/694/2 "2024-05-31T06:33:44Z")

</div>

I am facing the same issue? @jelena request your help here please.

---

<div class="post-metadata">

**Author:** ![Sid](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/sid/32/882_2.png) [@Sid](https://forum.deepar.ai/u/Sid)\
**Post date:** [June 1, 2024, 5:54am UTC](https://forum.deepar.ai/t/java-lang-illegalstateexception-deepar-not-yet-initialized-cant-call-this-method-before-the-deepar-is-initialized/694/3 "2024-06-01T05:54:07Z")

</div>

Hey DeepAR community, hoping to find a solution here

---

<div class="post-metadata">

**Author:** ![igor](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/igor/32/547_2.png) [@igor](https://forum.deepar.ai/u/igor)\
**Post date:** [June 4, 2024, 11:15am UTC](https://forum.deepar.ai/t/java-lang-illegalstateexception-deepar-not-yet-initialized-cant-call-this-method-before-the-deepar-is-initialized/694/4 "2024-06-04T11:15:30Z")

</div>

Hi!

Could you try reproducing it on our [Android quickstart example](https://github.com/DeepARSDK/quickstart-android-java)?
