react-native-zeroconf icon indicating copy to clipboard operation
react-native-zeroconf copied to clipboard

Error in react-native-zeroconf when trying to assembleRelease

Open thehellmaker opened this issue 5 years ago • 7 comments

I am trying to release my app to the play store and I followed the steps in https://facebook.github.io/react-native/docs/signed-apk-android

when i run ./gradlew assembleRelease I get the following error. I believe its a mismatch in gradle and library versions.

Execution failed for task ':react-native-zeroconf:verifyReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found. error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2714: error: resource android:attr/fontStyle not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2715: error: resource android:attr/font not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2716: error: resource android:attr/fontWeight not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2717: error: resource android:attr/fontVariationSettings not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2718: error: resource android:attr/ttcIndex not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2799: error: resource android:attr/startX not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2802: error: resource android:attr/startY not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2805: error: resource android:attr/endX not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2808: error: resource android:attr/endY not found. /Users/thehellmaker/test/testapp/node_modules/react-native-zeroconf/android/build/intermediates/res/merged/release/values/values.xml:2816: error: resource android:attr/offset not found. error: failed linking references.

Here is my build.gradle versions

buildscript { ext { buildToolsVersion = "28.0.2" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 27 supportLibVersion = "28.0.0" } }

thehellmaker avatar Apr 13 '19 16:04 thehellmaker

Most of these disappear when compileSdkVersion is downgraded to 26 from 28

thehellmaker avatar Apr 13 '19 17:04 thehellmaker

@thehellmaker I cannot reproduce this anymore, but I think we had the same problem before setting the compileSdkVersion and buildToolsVersion for subprojects.

You can try to use the following in your build.gradle (put it at the end):

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28
                buildToolsVersion "28.0.3"
            }
        }
    }
}

westcode avatar Apr 18 '19 09:04 westcode

Hello, any news on this? Cannot assembleRelease, no matter what compileSdkVersion or targetSdkVersion I use...

sergioatzori avatar May 02 '19 08:05 sergioatzori

I also can't build with RN 0.59

tavrez avatar May 28 '19 10:05 tavrez

Anyone knows a solution for this? I really need this to work, I downgraded RN to 0.57 and SDK to 23 but still no luck, please help

tavrez avatar Jul 02 '19 08:07 tavrez

Solution from @westcode worked for me...

mtzfactory avatar Aug 23 '19 10:08 mtzfactory

I found out that the steps which produces error is after bundling, meaning you will get your app compiled and you have apk even if this error occurs, you can also use ‘’’gradle app:assembleRelease’’’ instead of ‘’’gradle assembleRelease ’’’ to supress error

tavrez avatar Aug 23 '19 12:08 tavrez