Getting "No platform selected" from sentry-wizard
Environment
How do you use Sentry? Sentry SaaS
Which SDK and version? @sentry/react-native: 2.2.2 react-native: 0.63.3
Steps to Reproduce
- Follow the installation guide and running npx @sentry/wizard -i reactNative -p android
- Getting this: `β Patched build.gradle file. Error: No platform selected at ReactNative.MobileProject.getPlatforms (/Applications/MAMP/htdocs/shkolo/shkolo-mobileapp/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19) at ReactNative._patchJs (/Applications/MAMP/htdocs/shkolo/shkolo-mobileapp/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14) at /Applications/MAMP/htdocs/shkolo/shkolo-mobileapp/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45 at processTicksAndRejections (node:internal/process/task_queues:94:5)
π Successfully set up Sentry for your project π
3. But android/sentry.properties is not generated
and after that when I try to build the android app I get:
Task :app:bundleReleaseJsAndAssets_SentryUpload_89 FAILED error: An organization slug is required (provide with --org) `
Expected Result
The Sentry setup should be successful and the app should be build successfully
Actual Result
I get both errors described in the steps.
@KinanKazmi try yarn add @sentry/[email protected]

@hanselsen some of my packages dont exist on yarn so that doesn't work at all.
@jennmueng can you confirm if i need to provide more info for this ?
@jennmueng just tried it for a brand new project. Still fails.
kinan@Kinans-MacBook-Pro react % npx react-native init testForSentry
Need to install the following packages:
react-native
Ok to proceed? (y) y
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: support for ECMAScript is superseded by uglify-js` as of v3.13.0
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
## ### #### ### ##
#### ######## ####
### ########## ###
#### ######## ####
## ### #### ### ##
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
Welcome to React Native!
Learn once, write anywhere
β Downloading template
β Copying template
β Processing template
β Installing CocoaPods dependencies (this may take a few minutes)
β Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./testForSentry/ios && pod install".
CocoaPods documentation: https://cocoapods.org/
kinan@Kinans-MacBook-Pro react % ls
AvazaExpenses okta-react-native-app-auth-example testForSentry
AvazaExpenses.zip package-lock.json testProj
AvazaTSMobile scroller toDoList
node_modules taskassigner
kinan@Kinans-MacBook-Pro react % cd testForSentry
kinan@Kinans-MacBook-Pro testForSentry % clear
kinan@Kinans-MacBook-Pro testForSentry % npm install --save @sentry/react-native
added 107 packages, changed 3 packages, and audited 1072 packages in 9s
72 packages are looking for funding
run npm fund for details
4 low severity vulnerabilities
Some issues need review, and may require choosing a different dependency.
Run npm audit for details.
kinan@Kinans-MacBook-Pro testForSentry % npx @sentry/wizard -i reactNative -p ios android
Running Sentry Wizard...
version: 1.2.7 | sentry-cli version: 1.64.1
Sentry Wizard will help you to configure your project
Thank you for using Sentry :)
Please open https://sentry.io/account/settings/wizard/npe1p02nxyg14j26ltc2bgpls5onnmhwip0smpmjwayan4v3zenxiqlbdfz9pzs2/ in your browser (if it's not open already)
? Please select your project in Sentry: Avaza / avaza-expenses-apps β Patched build.gradle file. Error: No platform selected at ReactNative.MobileProject.getPlatforms (/Users/kinan/react/testForSentry/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19) at ReactNative._patchJs (/Users/kinan/react/testForSentry/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14) at /Users/kinan/react/testForSentry/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45 at processTicksAndRejections (internal/process/task_queues.js:97:5) β Patched build script in Xcode project. Error: No platform selected at ReactNative.MobileProject.getPlatforms (/Users/kinan/react/testForSentry/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19) at ReactNative._patchJs (/Users/kinan/react/testForSentry/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14) at /Users/kinan/react/testForSentry/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45 at processTicksAndRejections (internal/process/task_queues.js:97:5)
π Successfully set up Sentry for your project π kinan@Kinans-MacBook-Pro testForSentry % `
@KinanKazmi
npm remove --save @sentry/wizard
npm install --save @sentry/[email protected]
@hanselsen same, even for a brand new project
@KinanKazmi if it says that it patched the files successfully, you should be good. I will check why the error still throws if I can reproduce your issue.
@jennmueng it actually broke my xcode project. The xCode cant even open the project. Luckily i had Git backup so i restored it. Then pod install caused more issues. Updated cocapods and still no difference. Note: I'm using the latest Mac OS and Xcode.
@KinanKazmi Can you provide a reproduction repo? Looks like some edge case as itβs solved for others.
@jennmueng its happening with my new project too.
npx react-native init sentryTest
cd sentryTest
npm install --save @sentry/react-native
npx @sentry/wizard -i reactNative -p ios android
Result is the same screenshot i posted above.
@KinanKazmi Try [email protected]
@jennmueng sorry i forgot to respond here, yes that worked. Thanks a bunch!