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

Getting "No platform selected" from sentry-wizard #1386

Closed
alexstoyanov opened this issue Mar 10, 2021 · 33 comments · Fixed by getsentry/sentry-wizard#110
Closed

Getting "No platform selected" from sentry-wizard #1386

alexstoyanov opened this issue Mar 10, 2021 · 33 comments · Fixed by getsentry/sentry-wizard#110

Comments

@alexstoyanov
Copy link

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.

@HazAT
Copy link
Member

HazAT commented Mar 10, 2021

Thanks for reporting, we are taking a look

@coltonmccormack
Copy link

coltonmccormack commented Mar 17, 2021

I am seeing the exact same issue. Project previously had v2.0.0 setup in November and everything worked well. After updating via yarn to 2.3.0 I started getting compile issues in Android. Wizard --uninstall would fail with ENAMETOOLONG when trying to revert the iOS project, so I just reverted my initial sentry install commit, cleaned build folders, ran yarn, etc. Then when trying to re-add sentry using the current version and wizard I get the same error as the OP.

Of note, I get asked to select the platform 5 times during the wizard. IOS and Android are selected each time. Using -p ios android throws the same error, but doesn't ever ask for the platforms.

How do you use Sentry?
Self-hosted Sentry

Which SDK and version?
@sentry/react-native: 2.3.0
react-native: 0.63.4

npx @sentry/wizard -i reactNative --url 'https://<redacted>
'Running Sentry Wizard...version: 1.2.2 | sentry-cli version: 1.63.1
Sentry Wizard will help you to configure your project

Thank you for using Sentry :)
? Select the platforms you like to set up: (Press <space> to select, <a> to toggle all, <i> to invert selection)iOS, Android
? Select the platforms you like to set up: (Press <space> to select, <a> to toggle all, <i> to invert selection)iOS, Android

Please open https://<redacted>/account/settings/wizard/vmxmf043k3rrpby43za1mcjlu9anawpwqq9m26dkuwuape6lfvz2cy4xdxwim773/in your browser (if it's not open already)

? Select the platforms you like to set up: (Press <space> to select, <a> to toggle all, <i> to invert selection)iOS, Android

? Please select your project in Sentry: <redacted>
? Select the platforms you like to set up: (Press <space> to select, <a> to toggle all, <i> to invert selection)iOS, Android
? Select the platforms you like to set up: (Press <space> to select, <a> to toggle all, <i> to invert selection)iOS, Android
✅ Patched build.gradle file.
Error: No platform selected    at ReactNative.MobileProject.getPlatforms (/Users/act/.npm/_npx/45638/lib/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19)    at ReactNative._patchJs (/Users/act/.npm/_npx/45638/lib/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14)    at /Users/act/.npm/_npx/45638/lib/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45    at processTicksAndRejections (internal/process/task_queues.js:93:5)
✅ Patched build script in Xcode project.
Error: No platform selected    at ReactNative.MobileProject.getPlatforms (/Users/act/.npm/_npx/45638/lib/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19)    at ReactNative._patchJs (/Users/act/.npm/_npx/45638/lib/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14)    at /Users/act/.npm/_npx/45638/lib/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Successfully set up Sentry for your project

@the-prime-thanatos
Copy link

+1

@renatomserra
Copy link

renatomserra commented Mar 25, 2021

Facing the same issue,

@sentry/react-native: 2.4.0
react-native: 0.63.4

This would likely be a reason source maps are not being uploaded right?

@it-hienvv
Copy link

The same issue

@hanselsen
Copy link

hanselsen commented Mar 29, 2021

Same here.
UPDATE:
I ran yarn add @sentry/wizard@1.1.4 and reran the wizard. This error is gone.

@NhanTranThanh
Copy link

Same here

@Zakyyy
Copy link

Zakyyy commented Apr 8, 2021

same here

@victoriaSh
Copy link

Had the same issue.
Ran npm i --save-dev @sentry/wizard@1.1.4 as @hanselsen said.
But after that I got:

✅ Patched build.gradle file.
✅ Patched App.js file.
✅ Added sentry.properties file to android
Successfully set up android for react-native
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at Object.writeFileSync (node:fs:1507:5)
    at {projectdir}/node_modules/@sentry/wizard/dist/lib/Helper/File.js:23:20
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

🎉  Successfully set up Sentry for your project 🎉

And "An organization slug is required" error on building project.

Then I just copied sentry.properties from android to ios directory and everything works fine.

@hanselsen
Copy link

Indeed as @victoriaSh said, I too am stuck on this new TypeError.
As both version 1.2.3 and 1.1.4 are crashing, we should use 1.2.3 and try to fix the "No platform selected" issue.
Is there anyone from Sentry that can confirm that this is under investigation?

@hanselsen
Copy link

I decided not to be lazy and used the manual configuration. It is now working for me. Hopefully other people will get to enjoy the wizard.

@bruscantini
Copy link

bruscantini commented Apr 19, 2021

I'm on React Native 0.59
@sentry/react-native: "^2.4.1"
I also get this even though it said "Successfully set up Sentry for your project":

Error: No platform selected
    at ReactNative.MobileProject.getPlatforms (/Users/pure2maestro/code/ember-app/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/MobileProject.js:65:19)
    at ReactNative._patchJs (/Users/pure2maestro/code/ember-app/node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js:224:14)
    at /Users/pure2maestro/code/ember-app/node_modules/@sentry/wizard/dist/lib/Helper/File.js:28:45
    at process._tickCallback (internal/process/next_tick.js:68:7)
{
	"message": "Expected \"/*\", \"//\", or \"{\" but \"u\" found.",
	"expected": [
		{
			"type": "literal",
			"text": "//",
			"ignoreCase": false
		},
		{
			"type": "literal",
			"text": "/*",
			"ignoreCase": false
		},
		{
			"type": "literal",
			"text": "{",
			"ignoreCase": false
		}
	],
	"found": "u",
	"location": {
		"start": {
			"offset": 0,
			"line": 1,
			"column": 1
		},
		"end": {
			"offset": 1,
			"line": 1,
			"column": 2
		}
	},
	"name": "SyntaxError"
}

I can't even "pod install" now. Throws this:

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
              if config.name == 'Staging'
                  config.build_settings['CONFIGURATION_TEMP_DIR'] = '$(PROJECT_TEMP_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)'
                  config.build_settings['CONFIGURATION_BUILD_DIR'] = '$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)'
              end
  end
  installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
              if config.name == 'Staging'
                  config.build_settings['CONFIGURATION_TEMP_DIR'] = '$(PROJECT_TEMP_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)'
                  config.build_settings['PODS_CONFIGURATION_BUILD_DIR'] = '${PODS_BUILD_DIR}/Release$(EFFECTIVE_PLATFORM_NAME)'
              end
          end
  end
end

Error

NoMethodError - undefined method `[]' for nil:NilClass
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.17.1/lib/xcodeproj/project.rb:265:in `new_from_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.17.1/lib/xcodeproj/project.rb:212:in `initialize_from_file'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.17.1/lib/xcodeproj/project.rb:112:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1177:in `block (2 levels) in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1176:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1176:in `block in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1171:in `inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:106:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

@KinanKazmi
Copy link

Same issue here.

@hanselsen
Copy link

I can confirm that the PR 105 fixes the issue. Thanks!

@KinanKazmi
Copy link

@hanselsen how can i get the version with that PR merged ?

@jennmueng
Copy link
Member

@KinanKazmi You can just update to the latest version.

@KinanKazmi
Copy link

KinanKazmi commented May 10, 2021 via email

@jennmueng
Copy link
Member

@KinanKazmi Did you actually update? This issue does not exist anymore.

Mobile Platform Team Archived automation moved this from Backlog to Done May 10, 2021
@KinanKazmi
Copy link

KinanKazmi commented May 10, 2021

@jennmueng i just installed it an hour ago and got that error.
Didn't have to update. It was a fresh install in my new project.

@jennmueng
Copy link
Member

jennmueng commented May 10, 2021

It says last update was 6 days ago. I just tried it last hour.

If it still occurs please provide a reproduction and the version in your lockfile/node_modules

@hanselsen
Copy link

@KinanKazmi try yarn add @sentry/wizard@1.2.7

@KinanKazmi
Copy link

Screenshot 2021-05-10 at 11 40 01 AM

@KinanKazmi
Copy link

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

@KinanKazmi
Copy link

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

@KinanKazmi
Copy link

@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 urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated uglify-es@3.3.9: 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 %
`

@hanselsen
Copy link

@KinanKazmi
npm remove --save @sentry/wizard
npm install --save @sentry/wizard@1.2.7

@KinanKazmi
Copy link

@hanselsen same, even for a brand new project

@jennmueng
Copy link
Member

@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.

@KinanKazmi
Copy link

@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.

@jennmueng
Copy link
Member

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

@KinanKazmi
Copy link

@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.

@jennmueng
Copy link
Member

@KinanKazmi Try sentry-wizard@1.2.8

@KinanKazmi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.