sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Getting "No platform selected" from sentry-wizard

Open alexstoyanov opened this issue 5 years ago β€’ 33 comments

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

  1. Follow the installation guide and running npx @sentry/wizard -i reactNative -p android
  2. 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.

alexstoyanov avatar Mar 10 '21 09:03 alexstoyanov

@KinanKazmi try yarn add @sentry/[email protected]

hanselsen avatar May 10 '21 06:05 hanselsen

Screenshot 2021-05-10 at 11 40 01 AM

KinanKazmi avatar May 10 '21 06:05 KinanKazmi

@hanselsen some of my packages dont exist on yarn so that doesn't work at all.

KinanKazmi avatar May 10 '21 06:05 KinanKazmi

@jennmueng can you confirm if i need to provide more info for this ?

KinanKazmi avatar May 10 '21 07:05 KinanKazmi

@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 avatar May 10 '21 07:05 KinanKazmi

@KinanKazmi npm remove --save @sentry/wizard npm install --save @sentry/[email protected]

hanselsen avatar May 10 '21 07:05 hanselsen

@hanselsen same, even for a brand new project

KinanKazmi avatar May 10 '21 08:05 KinanKazmi

@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 avatar May 10 '21 08:05 jennmueng

@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 avatar May 10 '21 08:05 KinanKazmi

@KinanKazmi Can you provide a reproduction repo? Looks like some edge case as it’s solved for others.

jennmueng avatar May 10 '21 08:05 jennmueng

@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 avatar May 10 '21 08:05 KinanKazmi

@KinanKazmi Try [email protected]

jennmueng avatar May 11 '21 13:05 jennmueng

@jennmueng sorry i forgot to respond here, yes that worked. Thanks a bunch!

KinanKazmi avatar May 17 '21 03:05 KinanKazmi