Jobeso / react-native-whatsapp-stickers

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

App crash after installing module #4

Closed techacorntest1 closed 5 years ago

techacorntest1 commented 5 years ago

it gives error java.lang.RuntimeException: Unable to get provider com.jobeso.RNWhatsAppStickers.StickerContentProvider: java.lang.RuntimeException: contents.json file has some issues: Use JsonReader.setLenient(true) to accept malformed JSON at line 26 column 10

please,help me..

Jobeso commented 5 years ago

Hey @techacorntest1 , sorry to hear that you are having trouble using the module. Can you please paste the content of your contents.json file and also the output of react-native info here.

techacorntest1 commented 5 years ago

The content of my contens.json is as below:

{
  "android_play_store_link": "https://play.google.com/store/apps/details?id=com.myapp",
  "ios_app_store_link": "https://itunes.apple.com/app/myapp/id123456",
  "sticker_packs": [
    {
      "identifier": "myprojectstickers",
      "name": "MyProject Stickers",
      "publisher": "John Doe",
      "tray_image_file": "tray_icon.png",
      "publisher_email": "contact@myproject.com",
      "publisher_website": "https://myproject.com",
      "privacy_policy_website": "https://myproject.com/legal",
      "license_agreement_website": "https://myproject.com/license",
      "stickers": [
        {
          "image_file": "sticker1.webp",
          "emojis": ["✌️"]
        },
        {
          "image_file": "sticker2.webp",
          "emojis": ["😍","😻"]
        },
        {
          "image_file": "sticker3.webp",
          "emojis": ["😎"],
        },
      ]
    }
  ]
}

and Output of react-native info is:

 React Native Environment Info:
    System:
      OS: Linux 4.4 Linux Mint 18.1 (Serena)
      CPU: (2) x64 Intel(R) Pentium(R) CPU G4400 @ 3.30GHz
      Memory: 103.86 MB / 3.75 GB
      Shell: 4.3.46 - /bin/bash
    Binaries:
      Node: 10.6.0 - /usr/local/bin/node
      npm: 6.1.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      Android SDK:
        API Levels: 16, 23, 24, 25, 26, 27, 28
        Build Tools: 22.0.1, 23.0.1, 23.0.2, 23.0.3, 24.0.1, 25.0.0, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.3, 27.0.0, 27.0.1, 27.0.3, 28.0.1
        System Images: android-25 | Android TV Intel x86 Atom
    npmPackages:
      react: 16.6.1 => 16.6.1 
      react-native: 0.57.5 => 0.57.5 
    npmGlobalPackages:
      react-native-cli: 2.0.1
Jobeso commented 5 years ago

Hey @techacorntest1, I see that you are pretty new on github so I edited your comment with better formatting. Here is some information on how to format your infos on github.

To your problem: The last entry in the stickers array has a comma that doesn't belong there (line 26). You also see that hint in your error description. So just remove the comma and the comma in the line above you are good to go. You probably copied it from the Readme. I will update it accordingly. So it should look like this:

{
  "android_play_store_link": "https://play.google.com/store/apps/details?id=com.myapp",
  "ios_app_store_link": "https://itunes.apple.com/app/myapp/id123456",
  "sticker_packs": [
    {
      "identifier": "myprojectstickers",
      "name": "MyProject Stickers",
      "publisher": "John Doe",
      "tray_image_file": "tray_icon.png",
      "publisher_email": "contact@myproject.com",
      "publisher_website": "https://myproject.com",
      "privacy_policy_website": "https://myproject.com/legal",
      "license_agreement_website": "https://myproject.com/license",
      "stickers": [
        {
          "image_file": "sticker1.webp",
          "emojis": ["✌️"]
        },
        {
          "image_file": "sticker2.webp",
          "emojis": ["😍","😻"]
        },
        {
          "image_file": "sticker3.webp",
          "emojis": ["😎"]
        }
      ]
    }
  ]
}