Jobeso / react-native-whatsapp-stickers

Integrate sticker packs for WhatsApp with your react-native app
Other
81 stars 30 forks source link

Error when generating signed APK #21

Closed Carlosarturo28 closed 5 years ago

Carlosarturo28 commented 5 years ago

Environment

    System:
      OS: macOS High Sierra 10.13.6
      CPU: (2) x64 Intel(R) Core(TM)2 Duo CPU     P8800  @ 2.66GHz
      Memory: 1.10 GB / 8.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 26.0.1, 26.0.2, 27.0.1, 27.0.3, 28.0.3
        System Images: android-23 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.0 AI-171.4443003
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.5 => 0.59.5

Description

When trying to release a signed apk I get this message related to react-native-whatsapp-stickers


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-whatsapp-stickers: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/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values-v26/values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2711: error: resource android:attr/fontStyle not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2712: error: resource android:attr/font not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2713: error: resource android:attr/fontWeight not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2714: error: resource android:attr/fontVariationSettings not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2715: error: resource android:attr/ttcIndex not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2796: error: resource android:attr/startX not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2799: error: resource android:attr/startY not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2802: error: resource android:attr/endX not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2805: error: resource android:attr/endY not found.
  /Users/admin/Documents/StickersApp/stickersyco/node_modules/react-native-whatsapp-stickers/android/build/intermediates/res/merged/release/values/values.xml:2813: error: resource android:attr/offset not found.
  error: failed linking references.

I read the solutions proposed here: Android Production Build error #9 but changing the react-native version didn't solved the problem.

All help is appreciated. Thank you!

Jobeso commented 5 years ago

Hey @Carlosarturo28, you may need to upgrade your compileSdkVersion and buildToolsVersion. It could also be related to packages not having the right version. Maybe this issue can help.

You also find an example project in this repo. Try to diff your integration to that one. This might point you into a direction where this error is coming from.

Carlosarturo28 commented 5 years ago

Hey! I change this line from node_modules/react-native-whatsapp-stickers/android/build.gradle

compileSdkVersion 23
buildToolsVersion "23.0.1"

to

compileSdkVersion 28

(Yes, I deleted buildToolsVersion since that is not necessary anymore) and everything was OK.

I don't know if this should be like this for everyone or just me due to my config.

As this solution solved my problem, I'm closing this issue.

Thank you man!