You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.NoClassDefFoundError: Failed resolution of: <class_name> (class is inside native android sdk wrapped in react native lib built using bob)
#388
I have an android sdk that i'm trying to create a react native wrapper for so I can use the wrapper in react native apps.
I used bob to build the wrapper project, added the android sdk as a dependency, created my bridge and package classes and inside the bridge class I am calling classes & methods from the android sdk.
The wrapper project builds fine on android studio and on VS code when i run npm run prepack I am able to get the aar, common js, module and typescript folders created and each folder is populated with the files it is supposed to include.
I got the aar file that was created in the aar folder, and put it in the android/app/libs folder of the react native application i want to use the wrapper in.
Here is the issue; if I put a method in the bridge class that does NOT use any of the classes or methods from the native android sdk that I was wrapping and use call that method from my react native application, that method works fine. But whenever I try to to use any of the classes or methods that are inside the native sdk, it tells me that it can't find said class on the dex path list of the app.
Am I missing something here? Should I not be using the aar file created from the wrapper? The react native application can see the bridge and package classes inside the wrapper, but it can't see into the native sdk itself to find any of its classes.
I am not using proguard in the wrapper.
Can anyone point me in the right direction? I have looked through all the issues in this repo and could not find anything to help me. I am not really experienced with react native and building libraries with it is proving to be quite difficult. Any help would be much appreciated.
Thank you.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have an android sdk that i'm trying to create a react native wrapper for so I can use the wrapper in react native apps.
I used bob to build the wrapper project, added the android sdk as a dependency, created my bridge and package classes and inside the bridge class I am calling classes & methods from the android sdk.
The wrapper project builds fine on android studio and on VS code when i run npm run prepack I am able to get the aar, common js, module and typescript folders created and each folder is populated with the files it is supposed to include.
I got the aar file that was created in the aar folder, and put it in the android/app/libs folder of the react native application i want to use the wrapper in.
Here is the issue; if I put a method in the bridge class that does NOT use any of the classes or methods from the native android sdk that I was wrapping and use call that method from my react native application, that method works fine. But whenever I try to to use any of the classes or methods that are inside the native sdk, it tells me that it can't find said class on the dex path list of the app.
Am I missing something here? Should I not be using the aar file created from the wrapper? The react native application can see the bridge and package classes inside the wrapper, but it can't see into the native sdk itself to find any of its classes.
I am not using proguard in the wrapper.
Can anyone point me in the right direction? I have looked through all the issues in this repo and could not find anything to help me. I am not really experienced with react native and building libraries with it is proving to be quite difficult. Any help would be much appreciated.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions