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

Unexpected identifier 'str' #22675

Closed
3 tasks
JacquesBonet opened this issue Dec 17, 2018 · 14 comments
Closed
3 tasks

Unexpected identifier 'str' #22675

JacquesBonet opened this issue Dec 17, 2018 · 14 comments
Labels
Bug Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@JacquesBonet
Copy link

JacquesBonet commented Dec 17, 2018

Environment

Run react-native info in your terminal and paste its contents here.

native info

React Native Environment Info:
System:
OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
CPU: (4) x64 Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz
Memory: 151.05 MB / 7.60 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 8.12.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
SDKs:
Android SDK:
API Levels: 27, 28
Build Tools: 27.0.3, 28.0.3
System Images: android-27 | Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8

Description

Describe your issue in detail. Include screenshots if needed. If this is a regression, let us know.

  • I start the android emulator
  • I create a new react-native project with the command "react-native init myReactNative"
  • I start cd to the project and launch the command "react-native run-android"
  • The android application start on the android emulator, but I get a red screen with the message : "Unexpected identifier 'str'"

PS: I dont have error in debug mod

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

@JacquesBonet
Copy link
Author

I have no problem on another computer.

I will check tonight what is the problem

@JacquesBonet
Copy link
Author

What is curious, I have a node_modules directory which is created on the parent directory of the project when I do react-native run-android

@sryze
Copy link
Contributor

sryze commented Dec 18, 2018

Can you show the output of the red screen? at which file & line does it point?

@firemuzzy
Copy link

firemuzzy commented Dec 31, 2018

I am having the exact same issue on a newly created android app with react-native init ..., same set up but on on Mac OS

Here is the stack trace from adb

image

there is also rows of "Could not find generated setter for class", not sure if that is related

image

@brendan-roche
Copy link

@firemuzzy @JacquesBonet I was having this issue, with same errors as described by @firemuzzy on both on the a pixel 2 simulator and trying to install on my Galaxy S6.

I tried a number of steps to resolve the issue, such as updating to latest java, update to latest gradle and android studio plugin, and setting up a new project. But I believe what ended up solving it for me was upgrading via react-native git command line tool react-native-git-upgrade as described here:

https://facebook.github.io/react-native/docs/upgrading

I was running my project based off react native 0.57.0 and had been upgrading the patch releases just by changing version in package.json and then running yarn , but without running the upgrader.

OSX 10.14.2
React Native 0.57.8

Give it a try and let me know if it solves it for both of you too.

@GospelHW
Copy link

I am having the exact same issue on a newly created android app with react-native run-android, same set up but on on Mac OS
Uploading 屏幕快照 2019-01-30 上午10.14.19.png…
and red screen is
device-2019-01-30-101750
OSX 10.13.4
React Native 0.57.8

Who can help me please

@GospelHW
Copy link

who tried to Version downgrade with RN?

@GospelHW
Copy link

@firemuzzy Is your problem solved?

@kelset
Copy link
Contributor

kelset commented Jan 30, 2019

Can we please migrate this issue, if still existent, to a new issue that follows the template AND has a repro? It's not possible to help without information, and the original poster literally left the template with the placeholders & only the react-native info 😓

@GospelHW
Copy link

I don't know what you mean?
please look those questions,can you help me ?
and issues num is #23224 and #23223

@GospelHW
Copy link

I have no way.@kelset

@pedro
Copy link

pedro commented Feb 5, 2019

Same issue here, after upgrading from 0.55.4 to 0.57.8.

Finally got through by launching the packager manually, eg: yarn start --reset-cache. This way I was able to see some import errors that were not showing before, when the packager was initiated by react-native run-android 🤔

@ShaubertIlya
Copy link

Good day to all. Have someone managed this issue? I've got simular this morning and I've already

  1. cleaned all yarn cache
  2. removed node_modules and reinstalled it
  3. rolled back changes on 3 git branches
  4. checked my system variables like ANDROID_HOME and JAVA
    and it still appearing.

Could someone help, please. I'm starting run out of options

@alloy
Copy link
Contributor

alloy commented Mar 19, 2019

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting) nor did it follow the steps outlined in the issue template, as already asked about previously by @kelset. Unfortunately, we have no way of helping you in a meaningful way – there is no easy way to recreate the situation and check that the issue reported is still there when changing the code.

Because of this, we are going to close this issue - but if a repro is shared in a new issue, we are happy to investigate it further 🤗

@alloy alloy closed this as completed Mar 19, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests