Savan-ITDEV / react-native-savanitdev-thermal-printer

19 stars 4 forks source link

Build failed #1

Open mdyamin007 opened 3 weeks ago

mdyamin007 commented 3 weeks ago

I tried to build on and react-native expo project by going to android folder and by running ./gradlew assembleRelease. But it is giving error while building with these error messages:

Task :react-native-savanitdev-thermal-printer:bundleReleaseLocalLintAar FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 5m 24s 999 actionable tasks: 849 executed, 150 up-to-date

mdyamin007 commented 2 weeks ago

I solved it finally by editing and deleting some files in /node_modules/react-native-savanitdev-thermal-printer. Here are the steps by which I followed and resolve the build error:

  1. Go to /node_modules/react-native-savanitdev-thermal-printer/android/libs/ folder and extract the printer-lib-3.1.6.aar file using WinRAR or any other archival software.
  2. You will get a classes.jar file inside the printer-lib-3.1.6.aar file after extraction.
  3. Rename classes.jar file to printer-lib-3.1.6.jar and keep it on /node_modules/react-native-savanitdev-thermal-printer/android/libs/ folder
  4. Remove the printer-lib-3.1.6.aar file and extracted folder.
  5. Edit /node_modules/react-native-savanitdev-thermal-printer/android/build.gradle file:
    dependencies {
    ....
    implementation fileTree(dir: "libs", include: ["*.jar"])   // remove the aar from the list
    ......
    implementation files('libs/zywell.jar')
    implementation files('libs/printer-lib-3.1.6.jar')   //rename the extension with jar
    }
  6. Now build the apk and the error will be gone. Thanks!