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

Alert work well on Debug but not showing in Release mode on Android #29041

Closed
cinzianicoletti opened this issue Jun 3, 2020 · 6 comments
Closed
Labels
API: Alert Platform: Android Android applications.

Comments

@cinzianicoletti
Copy link

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

The application correctly displays all the alerts and toast messages in the debugging phase. The moment the build is built all the messages disappear.

React Native version:

System:
  OS: macOS 10.15.5
  CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
  Memory: 267.94 MB / 8.00 GB
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 13.8.0 - /usr/local/bin/node
  Yarn: 1.22.4 - ~/.yarn/bin/yarn
  npm: 6.13.7 - /usr/local/bin/npm
  Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
  iOS SDK:
    Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
  Android Studio: 3.6 AI-192.7142.36.36.6392135
  Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild
npmPackages:
  react: 16.8.3 => 16.8.3 
  react-native: 0.59.9 => 0.59.9 
npmGlobalPackages:
  react-native-cli: 2.0.1
  react-native: 0.61.5

Expected Results

That alerts are shown in build mode.

I attach the package.json to see if there are any known incompatibilities:

{
  "name": "myapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "android": "react-native run-android",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.11.0",
    "axios": "^0.18.0",
    "haversine": "^1.1.0",
    "jetifier": "^1.6.5",
    "moment": "^2.22.2",
    "react": "16.8.3",
    "react-native": "0.59.9",
    "react-native-actionsheet": "^2.4.2",
    "react-native-android-location-services-dialog-box": "^2.8.2",
    "react-native-auto-height-image": "^1.1.0",
    "react-native-cached-image": "^1.4.3",
    "react-native-cli": "1.3.0",
    "react-native-fbsdk": "1.0.4",
    "react-native-gesture-handler": "^1.6.0",
    "react-native-global-font": "^1.0.2",
    "react-native-google-places": "3.1.2",
    "react-native-image-crop-picker": "^0.24.1",
    "react-native-image-pan-zoom": "^2.1.10",
    "react-native-image-placeholder": "^1.0.14",
    "react-native-iphone-x-helper": "^1.2.0",
    "react-native-keyboard-manager": "^4.0.13-10",
    "react-native-maps": "0.25.0",
    "react-native-maps-super-cluster": "^1.4.1",
    "react-native-modal-datetime-picker": "^5.1.0",
    "react-native-open-maps": "^0.3.3",
    "react-native-progress": "^3.4.0",
    "react-native-push-notification": "3.1.3",
    "react-native-reanimated": "^1.7.0",
    "react-native-router-flux": "^4.0.6",
    "react-native-screens": "^2.0.0-beta.8",
    "react-native-share": "^1.2.1",
    "react-native-snap-carousel": "^3.7.4",
    "react-native-swiper": "^1.5.13",
    "react-native-vector-icons": "^4.6.0",
    "react-native-view-shot": "^2.5.0",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "redux-persist": "^4.10.1",
    "redux-persist-transform-filter": "0.0.15",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./src/fonts"
    ]
  }
}

Thanks in advance to those who want to help me.

@cinzianicoletti cinzianicoletti changed the title Alert work well on debug but not in release mode on Android Alert work well on Debug but not showing in Release mode on Android Jun 3, 2020
@navin-d97
Copy link

Can you share more information. Which alert are you using? Is it react native's alert or javascript's alert method?

@ivarchand
Copy link

ivarchand commented Jul 12, 2020

Facing the same issue, javascript alert & Alert.alert("title", "message") both are not working on release mode of iOS

Used versions on package.json is below

"dependencies": {
.....
"react": "16.9.0",
"react-native": "0.61.1",
"typescript": "2.9.2"
.....
}
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"@types/chai": "^3.5.2",
"@types/jest": "^24.0.14",
"@types/react": "^16.4.14",
"@types/react-addons-test-utils": "0.14.21",
"@types/react-native": "0.60.23",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"ts-jest": "24.0.2",
"ts-node": "3.3.0",
"tslint": "5.7.0",
"tslint-eslint-rules": "4.1.1",
"babel-jest": "^24.9.0"
}

Please help to go-ahead
Thanks in Advance

@cinzianicoletti
Copy link
Author

The problem disappeared when I switched from version 59.9 of React Native to 60.0. 🎉 But I couldn't find any solution.

@ivarchand
Copy link

Hi Folks,
unupdated .main.jsbundle in bundle copy resources caused this issue.
ref: #29356
it got fixed & works fine!!

@fabOnReact
Copy link
Contributor

The problem disappeared when I switched from version 59.9 of React Native to 60.0. tada But I couldn't find any solution.

@nicolettinzia if the problem disappeared, then could you please close this issue? We have 1.1k open issues and contributors invest months to read, triage, troubleshoot and then publish fixes for each issue...because there are very large amount of discussions...

Closing the issue if does not reproduce anymore on latest release really helps. Thanks

@juliushuck
Copy link

I had the same problem, but my error was my fault. I passed an empty object {} to the buttons parameter of the Alert.alert() function. I changed it to undefined and now it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: Alert Platform: Android Android applications.
Projects
None yet
Development

No branches or pull requests

7 participants