I'm following adding library .jar file in android folder in react-native in "https://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library" with second answer. in third step "gradlew assemble", I always encounter the error "Field name '??' cannot be represented in dex format." in Image and there's no information of it. should I install android again? What can I do?enter image description here
Asked
Active
Viewed 448 times
0
-
add your source code to get answer – Mar 22 '21 at 06:07
1 Answers
0
In order to add .jar files to your React Native project , you have to configure android/app/build.gradle
.
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
}
For more options to add .jar file, refer this
Also don't forget to specify the correct dir or create a dir libs under android/app and add your files there.

Rohit Aggarwal
- 1,048
- 1
- 14
- 32