Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React-native Android crash in Release only #87

Open
ishigamii opened this issue Oct 27, 2018 · 2 comments
Open

React-native Android crash in Release only #87

ishigamii opened this issue Oct 27, 2018 · 2 comments

Comments

@ishigamii
Copy link

ishigamii commented Oct 27, 2018

I don't know if react-native issues are in your scope but as it is in the documentation talking about react-native so hope it will still be interesting 👍

Issue Type

  • [X ] Bug

Description

On Android, only in Release, when I use wakana in the first appearing view, the app just crash.

I tried using it in :

  constructor(props: Props) { }

or in

  componentDidMount() { }

Also tried to add a delay (I thought it was a problem of initialisation cause it is working perfectly in further view of my app) but got the same crash.

Thanks to Crashlytics I could get the error :

Fatal Exception: com.facebook.react.common.JavascriptException
TypeError: TypeError: Invalid attempt to spread non-iterable instance

capture d ecran 2018-10-27 a 12 58 33

Steps to reproduce

  1. Create a new project with react : react-native init testWakanaka
  2. Go into folder cd testWakanaka
  3. yarn add wanakana
  4. In the App.js add the import and use it in the componentDidMount :
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import * as wanakana from 'wanakana'; <-- added this

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {

// Added the methode
  componentDidMount() {
    alert(wanakana.toHiragana("kakoki"))
  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Welcome to React Native!</Text>
        <Text style={styles.instructions}>To get started, edit App.js</Text>
        <Text style={styles.instructions}>{instructions}</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});
  1. Do the process to be able to sign the app (https://facebook.github.io/react-native/docs/signed-apk-android)
  2. Launch app in release : react-native run-android --variant=release
  3. Wait and crash 👍

Versions

  • React-Native:
    "react": "16.5.0",
    "react-native": "0.57.1",
    "wanakana": "^4.0.2"
  • OS/Device: Android Simulator and Devices (One Plus One)
  • Keyboard/Input Method: none

Thanks a lot

@DJTB
Copy link
Collaborator

DJTB commented Oct 27, 2018

I don't have any experience with react-native yet but you could keep an eye on this issue which looks to be the exact same problem (since we use [...someString] syntax in wanakana):
facebook/react-native#21734

You could try an older version of react-native (maybe RN 55.4) to confirm that it is actually the same issue 👍

@ishigamii
Copy link
Author

@DJTB I am not sure it's link as I am not mapping from string but could be linked anyways so I will keep an eyes on it 👍Thanks for your reply I will keep you updated. For the moment I used a bypass to make it work another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants