Apple rejected the binary (2.3.1 - Performance) after upgrading to React Native 0.59 - react-native

I have two apps in different accounts, rejected under the topic 2.3.1 - Performance, after upgrading to the React Native 0.59.3. Nothing was changed in this apps, except the RN upgrade.
But, both of apps are not using obfuscated code, selector mangling, or features meant to subvert the App Review process. Both are apps thats change it's contents naturally based on the API data, like many others apps like Facebook, Twitter, Instagram, etc.
Both are simples apps created with react-native init and published more than 1 year ago for Android and iOS. We are not using codepush, test A/B or others technique to change app behaviour in runtime.
Anyone suffering with the same rejection or have any tips to solve this problem?
Apple rejection message:
Guideline 2.3.1 - Performance
We discovered that your app contains obfuscated code, selector
mangling, or features meant to subvert the App Review process by
changing this app's concept after approval to the App Store.
The next submission of this app may require a longer review time, and
this app will not be eligible for an expedited review until this issue
is resolved.
Next Steps
Review the Performance section of the App Store Review Guidelines.
Ensure your app is compliant with all sections of the App Store Review Guidelines and the Terms & Conditions of the Apple Developer
Program.
Once your app is fully compliant, resubmit your app for review.
Submitting apps designed to mislead or harm customers or evade the
review process may result in the termination of your Apple Developer
Program account. Review the Terms & Conditions of the Apple Developer
Program to learn more about our policies regarding termination.
If you believe your app is compliant with the App Store Review
Guidelines, you may submit an appeal. Alternatively, you may provide
additional details about your app by replying directly to this
message.
package.json's:
App A:
{
"name": "app A",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#react-native-community/async-storage": "1.2.2",
"#react-native-community/netinfo": "1.4.1",
"#remobile/react-native-action-sheet": "1.0.2",
"eureka-rn-components": "git+file:../gileade-eureka-rn-components#02c50a043070648205def50940c1282d2b749c89",
"functional-masks": "git+https://github.com/ktabriga/functional-masks.git#d5f5f01fe6731fc1c0879b8afb8f239591a2f984",
"lodash": "4.17.2",
"moment": "2.16.0",
"normalizr": "3.1.0",
"numeral": "1.5.3",
"prop-types": "15.6.2",
"ramda": "0.23.0",
"react": "16.8.3",
"react-native": "0.59.3",
"react-native-action-button": "2.6.2",
"react-native-autocomplete-input": "3.6.0",
"react-native-datepicker": "1.6.0",
"react-native-deprecated-custom-components": "0.1.2",
"react-native-device-info": "0.25.1",
"react-native-dropdownalert": "3.9.1",
"react-native-elements": "0.18.0",
"react-native-fcm": "13.3.3",
"react-native-global-props": "1.1.1",
"react-native-image-crop-picker": "0.18.2",
"react-native-infinite-scroll-view": "0.4.5",
"react-native-masked-text": "1.5.2",
"react-native-modal-selector": "1.0.2",
"react-native-permissions": "1.1.1",
"react-native-progress-circle": "2.0.1",
"react-native-side-menu": "1.1.3",
"react-native-simple-modal": "6.0.0",
"react-native-swiper": "1.5.5",
"react-native-vector-icons": "6.2.0",
"react-redux": "4.4.6",
"redux": "3.6.0",
"redux-logger": "2.7.4",
"redux-persist": "4.0.0-beta1",
"redux-promise-middleware": "4.1.0",
"redux-thunk": "2.1.0",
"reselect": "2.5.4",
"string-mask": "0.3.0",
"url-join": "4.0.0"
},
"jest": {
"preset": "jest-react-native"
},
"devDependencies": {
"#babel/core": "7.4.0",
"#babel/runtime": "7.4.2",
"#react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.5.0",
"eslint": "5.16.0",
"jest": "24.5.0",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "16.8.3"
}
}
App B:
{
"name": "app B",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/async-storage": "1.3.3",
"axios": "0.18.0",
"bluebird": "3.5.1",
"jwt-decode": "2.2.0",
"moment": "2.21.0",
"prop-types": "15.6.1",
"react": "16.8.3",
"react-native": "0.59.3",
"react-native-charts-wrapper": "0.4.2",
"react-native-datepicker": "1.7.2",
"react-native-device-info": "0.25.1",
"react-native-elements": "0.19.0",
"react-native-exit-app": "1.0.0",
"react-native-fcm": "14.1.0",
"react-native-keyboard-manager": "4.0.13-10",
"react-native-simple-dialogs": "1.1.0",
"react-native-splash-screen": "3.1.1",
"react-native-vector-icons": "6.2.0",
"react-navigation": "1.5.2",
"vanilla-masker": "1.2.0",
"wolfy87-eventemitter": "5.2.5"
},
"devDependencies": {
"#babel/core": "7.4.0",
"#babel/runtime": "7.4.2",
"#react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.5.0",
"babel-plugin-transform-remove-console": "6.9.0",
"eslint": "5.16.0",
"jest": "24.5.0",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}

My app also got rejected. However after replying in the resolution centre I have said that I do not use code obfuscating and I have asked for details about the reason for rejection. And just like that, I've got a notification that my app is in review and like 10 seconds later my app was approved and released :-)
To me this seems like either a bug on Apple side, or it was triggered by one of the popular frameworks, like AFNetworking, Realm, etc (where they use NSStringFromSelector, NSStringFromClass etc) but since it was large scale and everyone was explaining the usage in the same way the apps gets approved almost automatically (but you have to reply in the resolution centre in order to trigger the second review process). Hope this helps.

Related

NetInfo has been removed from React Native

Before you try to automatically delete this as a duplicate, hear me out.
I have spent all day googling this and trying everything.
My project is a React Native app using Expo.
Recently, when I was adding some packages to get testing working, I started to get this error:
Invariant Violation: NetInfo has been removed from React Native. It can now be installed and imported from '#react-native-community/netinfo' instead of 'react-native'. See https://github.com/react-native-community/react-native-netinfo
As people suggested, I tried searching through my Node Modules folder for any old style imports of the netInfo package, but there were none.
I have tried rolling back my node modules to a previous state from and older commit by deleting the node_modules folder, replacing package.json with an older setup that I know worked and npm i to reinstall.
I need something else to try.
Here is my package.json that I know worked in the past, but is giving me the error anyway
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#expo/vector-icons": "^12.0.5",
"#fortawesome/fontawesome-svg-core": "^1.2.36",
"#fortawesome/free-regular-svg-icons": "^5.15.4",
"#fortawesome/free-solid-svg-icons": "^5.15.4",
"#fortawesome/react-native-fontawesome": "^0.2.7",
"#react-native-async-storage/async-storage": "^1.15.9",
"#react-navigation/native": "^6.0.2",
"#react-navigation/stack": "^6.0.7",
"#redux-offline/redux-offline": "^2.6.0-expo.0",
"expo": "^42.0.3",
"expo-app-loading": "1.1.2",
"expo-location": "~12.1.2",
"expo-sqlite": "~9.2.1",
"expo-status-bar": "~1.0.4",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
"react-native-get-random-values": "^1.7.0",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~3.4.0",
"react-native-web": "~0.13.12",
"react-redux": "^7.2.5",
"redux": "^4.1.1",
"redux-thunk": "^2.3.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"#babel/core": "^7.9.0",
"eslint": "^8.1.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-native": "^3.11.0",
"redux-devtools-extension": "^2.13.9"
},
"private": true
}
Recently, when I was adding some packages to get testing working
Since NetInfo is not used directly in your code, I imagine that one of the packages you recently added is still attempting to access NetInfo via React Native.
First you'll need to determine which package is causing this. Then either update it to a newer version which imports NetInfo from #react-native-community/netinfo, or remove the package entirely.
TLDR: Remove Redux Offline, and all of it's imports. #redux-offline/redux-offline: "^2.6.0-expo.0",
Wow, this was a day and a half of work duzy. It was weird too, because I tried going way back to an old commit and rebuilding there, but I would still get the error. So on a whim, I downloaded my repo from github, then went to and old commit, installed the packages, and it worked! Still have no idea why my original local repo wouldn't.
So I split the difference between the working commit and the broken commit until I found the source of the problem, and the culprit was #redux-offline/redux-offline: "^2.6.0-expo.0",
No idea why it was causing the issue, maybe I just have it set up wrong, I hand't gotten it working anyway, so I'm removing it for now till I have time to do it right.

React native + expo + Notifications = You must provide `notification.vapidPublicKey` in `app.json` to use push notifications on web

I've been building an app on RN and static stuff are working as intended. Now I'm trying to add Push Notifications and all tries lead me to this error: You must provide 'notification.vapidPublicKey' in 'app.json' to use push notifications on web..
There are several tutorials around and they all seems so simple and none of them have this error...
So, I've tried 5+ tutorials, using Node 14, react-native-web 0.11.7 (due async issues), including owner, slug and notification.vapidPublicKey on app.json (the last one is not accepted by the file), and a lot of other stuffs, like trying to have this working on a brand new project.
This error occours when I call await Notifications.getExpoPushTokenAsync() from import { Notifications } from 'expo';.
"dependencies": {
"#expo-google-fonts/inter": "^0.1.0",
"expo": "~37.0.3",
"moment": "^2.27.0",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-screens": "~2.2.0",
"react-native-web": "0.11.7"
},
"devDependencies": {
"#babel/core": "^7.8.6",
"#types/react": "~16.9.23",
"#types/react-native": "~0.61.17",
"babel-preset-expo": "~8.1.0",
"styled-components": "^5.1.1",
"typescript": "~3.8.3"
},
Any ideas on how to fix this error?

Need help in compilation of react-native iOS app

I am relatively new to react-native and trying to compile a previously running project but not able to compile
I am facing this error while compiling the code.
** BUILD FAILED **
Installing build/Build/Products/Debug-iphonesimulator/myapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I have tried all solutions mentioned below
Print: Entry, ":CFBundleIdentifier", Does Not Exist
this is my package.json file
{
"name": "myapp",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-plugin-module-resolver": "^3.1.1",
"babel-preset-react-native-stage-0": "^1.0.1",
"babel-root-slash-import": "^1.1.0",
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-plugin-import": "^2.11.0",
"jest-react-native": "^18.0.0",
"jetifier": "^1.6.3",
"prop-types": "^15.6.1",
"react-native-dotenv": "^0.1.1",
"react-test-renderer": "16.2.0"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "node node_modules/jest/bin/jest.js",
"clean": "react-native-clean-project"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"moment": "^2.22.0",
"react": "16.2.0",
"react-native": "0.52",
"react-native-clean-project": "^1.0.8",
"react-native-device-info": "^0.21.5",
"react-native-document-picker": "^2.1.0",
"react-native-firebase": "^4.2.0",
"react-native-htmlview": "^0.12.1",
"react-native-image-picker": "^0.26.7",
"react-native-mime-types": "^2.2.1",
"react-native-network-info": "^3.2.2",
"react-native-pdf": "^4.0.0",
"react-native-photo-view": "^1.5.2",
"react-native-push-notification-ce": "^3.1.3",
"react-native-swiper": "^1.5.13",
"react-native-video": "^2.3.1",
"react-native-video-preview":
"git://github.com/chadsmith/react-native-video-preview.git",
"react-native-video-processing": "^1.13.0",
"react-navigation": "^1.5.8",
"rn-fetch-blob": "^0.10.12"
}
}
Try cleaning up the build folder and deleting DerivedData folder which clears the build cache. But the main reason is that you haven't set the bundle ID for the app. Assuming you followed the link and made sure that you have one, then usually the build being cached is the issue.
I think there are 2 possible causes:
1) At some point there is some other error that is blocking the creation of the JS bundle.
Check the entire log of the build attempt carefully.
2) The bundle is generated at the incorrect path or using the incorrect index.js file.
More info here:
https://stackoverflow.com/a/57604941/1979861

React Native Metro Bundler issue with invalid left side AssingmentExpression

I'm just simply trying to start metro bundler to serve the app. Here's the error:
TypeError: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "StringLiteral"
at Object.validate (/Users/tyler/Code/.../node_modules/#babel/types/lib/definitions/utils.js:128:13)
at Object.validate (/Users/tyler/Code/.../node_modules/#babel/types/lib/validators/validate.js:17:9)
at NodePath._replaceWith (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/replacement.js:194:9)
at NodePath.replaceWith (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/replacement.js:178:8)
at PluginPass.MemberExpression (/Users/tyler/Code/.../node_modules/babel-plugin-transform-inline-environment-variables/lib/index.js:19:18)
at newFn (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/visitors.js:193:21)
at NodePath._call (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/context.js:118:16)
which means something like Platform.OS = "ios" is transformed into "ios" = "ios": like so <- That PR also addresses the TypeError being thrown for the process.env which seems to be the case for me. My stack trace references ...babel-plugin-transform-inline-environment-variables/lib/index.js:19:18 which deals exclusively with setting process.env. There are only two places in my code using a var from process.env and neither are used on the left side of an assignment.
PR 45 for the metro bundler was merged way back in 2017 though. And I'm using the latest version btw, this is occurring when trying to start up the bundler with the script "NODE_ENV=development npm start -- --reset-cache". Note that I am using the reset cache flag as mentiond here
A coworker suggested the error may be cause by a react-native plugin, but I haven't uncovered it yet if that is the case. We did just migrate this app to Babel 7, fyi. I'm hitting a wall now on ideas and the google trail is growing stale. What else could be the cause of this error?
Here are the dependencies from my package.json in case it helps:
}
...
"dependencies": {
"#babel/runtime": "^7.0.0",
"lodash.capitalize": "^4.2.1",
"lodash.debounce": "^4.0.8",
"lodash.find": "^4.6.0",
"phoenix": "^1.3.4",
"prettier": "^1.14.2",
"prop-types": "^15.6.2",
"react": "^16.4.2",
"react-native": "0.57.0",
"react-native-firebase": "^4.3.8",
"react-native-keep-awake": "^3.1.0",
"react-native-linear-gradient": "^2.4.2",
"react-native-router-flux": "^4.0.1",
"react-native-swiper": "^1.5.13",
"react-native-tts": "^2.0.0",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0",
"spokestack-react-native": "0.0.2"
},
"devDependencies": {
"#babel/plugin-proposal-object-rest-spread": "^7.0.0",
"#babel/plugin-transform-runtime": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"imagemin": "^6.0.0",
"imagemin-jpegtran": "^5.0.2",
"imagemin-optipng": "^5.2.1",
"imagemin-svgo": "^7.0.0",
"jest": "^23.6.0",
"metro-react-native-babel-preset": "^0.45.2",
"pre-commit": "^1.2.2",
"precise-commits": "^1.0.2",
"react-test-renderer": "^16.4.2",
"redux-mock-store": "^1.5.3"
},
...
}
...and additionally, the babel.config.js as per babel 7
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'#babel/plugin-transform-runtime',
'#babel/plugin-proposal-object-rest-spread',
'transform-inline-environment-variables'
]
}
UPDATE: I used grep within the react-* packages to find additional lines where process.env were used as a lefthand assignment. Only found a few, but couldn't resolve the issue.
The error you see in the log is related to babel-plugin-transform-inline-environment-variables. If you exclude it from your configuration file, the build should pass.
I'm facing the same issue and haven't found a good solution so far, so try to workaround a way how you pass your environment variables.

Can't find variable: Store

I'm working on an react-native app since 3 months, and we're currently using v0.21.
In an attempt to upgrade the app in order to fix a bug, I:
ran brew update && brew upgrade
Made some change to package.json
ran npm install
ran npm update -g react-native-cli to get the v0.1.10 locally
At this point I tried to run the app, but either in iOS or Android, I've got the same error:
So Logically I got back to origin/master, remove my node_modules folder, and reinstalled the react-native-cli v0.1.7 ... But I've got the same error !!
My package.json looks like that:
{
"name": "XXXXXX",
"version": "0.0.1",
"private": true,
"dependencies": {
"awesome-phonenumber": "^1.0.10",
"buffer": "^3.6.0",
"immutable": "^3.7.6",
"react-native": "^0.21.0",
"react-native-animatable": "^0.5.0",
"react-native-blur": "^0.7.10",
"react-native-button": "^1.3.1",
"react-native-code-push": "^1.5.3-beta",
"react-native-date": "^1.0.3",
"react-native-device-info": "^0.6.0",
"react-native-drawer-layout": "^0.4.0",
"react-native-facebook-ios": "file:lib/react-native-facebook-ios",
"react-native-facebook-login": "^1.0.2",
"react-native-floating-label-text-input": "0.0.8",
"react-native-google-places-autocomplete": "^1.1.6",
"react-native-material-kit": "^0.2.4",
"react-native-modalbox": "^1.3.1",
"react-native-onesignal": "file:lib/react-native-onesignal",
"react-native-parallax": "^0.2.2",
"react-native-parallax-scroll-view": "^0.16.17",
"react-native-router-flux": "^2.2.6",
"react-native-scrollable-tab-view": "^0.3.5",
"react-native-sync-now-android": "file:lib/react-native-sync-now-android",
"react-native-sync-now-ios": "file:lib/react-native-sync-now-ios",
"react-native-timer-ios": "file:lib/react-native-timer-ios",
"react-native-twitter-ios": "file:lib/react-native-twitter-ios",
"react-native-twitter-login": "0.0.2",
"react-native-utils": "^1.0.1",
"react-native-vector-icons": "^1.0.3",
"react-native-webrtc": "^0.1.5",
"react-redux": "^3.1.0",
"redux": "^3.0.2",
"redux-logger": "^2.0.1",
"redux-thunk": "^1.0.0",
"rnpm": "^1.4.1"
},
"scripts": {
"start": "react-native start",
"postinstall": "sh scripts/postinstall.sh"
},
"devDependencies": {
"react-native-cli": "^0.1.7"
}
}
I'm sure the problem is in the version of my tools because everything happened after I updated them and the code is the same
Here's the versions:
Watchman 4.4.0
Flow 0.22.1
react-native-cli 0.1.7
Can someone help me with this ?
Fixed it !
Because I must have upgraded packagers, it did not like the:
export default variable = {};
It prefers:
const variable = {};
export default variable;
Lost 24 hours on this...