HeligPfleigh / react-native-thermal-receipt-printer

A RN library for thermal printer
166 stars 103 forks source link

Android: Failed when try to build #10

Closed alanyong91 closed 4 years ago

alanyong91 commented 4 years ago

I got this error message when I tried to build.

Compatible side by side NDK version was not found.

> Task :react-native-thermal-receipt-printer:verifyReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-thermal-receipt-printer:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed

It can use when I run react-native run-android. But return error when I tried to build.

HeligPfleigh commented 4 years ago

It seems to fail to link the resource cause the SDK version of library is 23 and the latest SDK of a RN project now is 29. I've updated it (v1.0.9), you can take a try.

Btw, in this situation, you can also force the submodules of your project to use specific SDK build tool by adding to allprojects of android/build.gradle

    subprojects {
        afterEvaluate {
            project ->
                if (project.hasProperty("android")) {
                    android {
                        compileSdkVersion = 29
                        buildToolsVersion = "29.0.2"
                    }
                }
        }
    }
alanyong91 commented 4 years ago

The app crash after build. Probably not related to this package.

But I manage to fixed it by adding the code below in /android/app/build.gradle.

configurations.all {
    resolutionStrategy {
        force "com.facebook.soloader:soloader:0.8.2"
    }
}
Gyanprakash73 commented 1 year ago

I got this error message when I tried to build.

Compatible side by side NDK version was not found.

> Task :react-native-thermal-receipt-printer:verifyReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-thermal-receipt-printer:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed

It can use when I run react-native run-android. But return error when I tried to build.

Because some point mismatch from node_modules/react-native-thermal-receipt-printer/android/build.gradle to android/build.gradle You need to change node_modules/react-native-thermal-receipt-printer/android/build.gradle according to android/build.gradle

Step 1:- change parameters value compileSdkVersion buildToolsVersion minSdkVersion targetSdkVersion

Step 2:- change dir cd android and Run ./gradlew clean

Step 3:- now you can build Run ./gradlew assembleRelease

Alos you can check here