# Can't access to Java aar archive from C++ (android project)

**URL:** <https://forums.unrealengine.com/t/cant-access-to-java-aar-archive-from-c-android-project/490738>\
**Category:** Mobile\
**Tags:** unreal-engine, Android, java, question, CPP\
**Created:** [November 9, 2021, 8:49am UTC](https://forums.unrealengine.com/t/cant-access-to-java-aar-archive-from-c-android-project/490738 "2021-11-09T08:49:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wab11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wab11](https://forums.unrealengine.com/u/wab11)\
**Post date:** [November 9, 2021, 8:49am UTC](https://forums.unrealengine.com/t/cant-access-to-java-aar-archive-from-c-android-project/490738/1 "2021-11-09T08:49:26Z")

</div>

Hey!

I’ve got a problem with accessing the class inside of the aar file  
The aar archive is correctly attached to the project, but the class is still not visible.

JNIEnv \* env = FAndroidApplication :: GetJavaEnv ();  
// is always valid

jclass cPolarBleApi = env-\> FindClass (“com / polar / sdk / api / PolarBleApi”);  
// is always not valid

if (! cPolarBleApi)  
GEngine-\> AddOnScreenDebugMessage (-1, 15.0f, FColor :: Green, TEXT (“NULL Error”));

Link to the Aar library:  
[https://github.com/polarofficial/polar-ble-sdk/tree/master/polar-sdk-android/libs](https://github.com/polarofficial/polar-ble-sdk/tree/master/polar-sdk-android/libs)

However, if I create a clean project in android studio NDK and include this aar in the  
app / build.gradle with:  
dependencies  
{  
implementation files (‘libs / polar-ble-sdk.aar’)  
}  
It is in the android studio that with C ++ I have access to the code and the line:

jclass cPolarBleApi = env-\> FindClass (“com / polar / sdk / api / PolarBleApi”);

compiles without any problem and the class is always found.  
The same code in ue4 always returns nullptr - it means the class cannot be found.  
The AndroidLib\_UPL.xml file is properly set up.
