Jobeso / react-native-whatsapp-stickers

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

Android Production Build error #9

Closed grmmph closed 5 years ago

grmmph commented 5 years ago

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
      Memory: 418.91 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.1 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 5.6.0 - /usr/local/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        API Levels: 22, 23, 27, 28
        Build Tools: 27.0.3, 28.0.3
        System Images: android-27 | Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.1 => 16.6.1 
      react-native: 0.57.7 => 0.57.7 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Describtion

Trying to build a release, getting an error. `Execution failed for task ':react-native-whatsapp-stickers:verifyReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed Output: error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.`

This makes me very sad :)

ReactNativeFan commented 5 years ago

The component works fine for both Android and iOS. Therefore, i think the error is not related. I noticed that you are using react-native 0.57.7. This version gave me a headache and several building errors for other react-native components. I suggest to downgrade to 0.55.4 as follows

"react": "16.3.1", "react-native": "0.55.4",

one more thing, try to disable the component and build your project and see if the error is persistent because the error in your post is related to "Button.Borderless.Colored" which i do not think used by this component.

grmmph commented 5 years ago

Nice! It solved it but now the app is crashing when making a release build (works fine on debug) package.json:

"dependencies": {
    "react": "16.3.1",
    "react-native": "^0.55.4",
    "react-native-elements": "^0.19.1",
    "react-native-fcm": "^16.2.0",
    "react-native-google-analytics-bridge": "^6.1.2",
    "react-native-vector-icons": "^6.1.0",
    "react-native-whatsapp-stickers": "^1.2.0",
    "underscore": "^1.9.1"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "babel-preset-react-native": "4.0.1",
    "haul": "^1.0.0-rc.10",
    "jest": "23.6.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }

  Node: 10.13.0
  Yarn: 1.12.3
  npm: 6.4.1
  Watchman: Not Found
  Xcode: Not Found
  Android Studio: 3.2 AI-181.5540.7.32.5056338

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: ^0.55.4 => 0.55.4```
ReactNativeFan commented 5 years ago

Try to remove the stickers component for now and build in release. if the problem persists, then there is something wrong with your project setting. If this is the case, start a new project "react-native init myStickerApp" then integrate the sticker component.

Jobeso commented 5 years ago

I support @ReactNativeFan analysis that this issue may not related to this library because Button.Borderless.Colored isn't used in here. I am using this library with react-native 55.7 so this should also not be the problem. Let's try to isolate the issue. Please try to remove the dependency of this library and the code related to it and try to build again.

grmmph commented 5 years ago

Thanks for that guys.

Well as it seems the Button.Bordereless.Colored issue wan't related, the app crashing issue was related. Tried fresh install in both 0.48.4 0.55.4 and 0.55.7 versions, and for both installing this plugin made the app crash on release variant. Any ideas?

These are my settings in build.gradle:

buildToolsVersion = "27.0.3"
        minSdkVersion = 19
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
ReactNativeFan commented 5 years ago

do not change so many variables at the same time. i.e., 3 react-native versions and probably full code to run stickers. I would totally disable plugin and build only 0.55.4 in release. if success, import the plugin then build. if success, create an empty pack then build, if success, add 3 stickers then build. By the way, for Android, if you do not have emojis per every sticker pack in contents.json, i think the app may crash.

    {
      "image_file": "02_sticker.webp",
      "emojis": ["šŸ˜","šŸ˜»"]  <------
    },
Jobeso commented 5 years ago

Closing this due to inactivity for now. Feel free to open it again anytime.