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.
Thanks for reporting, we are taking a look
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
+1
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?
The same issue
Same here.
UPDATE:
I ran yarn add @sentry/[email protected] and reran the wizard. This error is gone.
Same here
same here
Had the same issue.
Ran npm i --save-dev @sentry/[email protected] 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.
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?
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.
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>'
Same issue here.
I can confirm that the PR 105 fixes the issue. Thanks!
@hanselsen how can i get the version with that PR merged ?
@KinanKazmi You can just update to the latest version.
It says last update was 6 days ago. I just tried it last hour.
On Mon, May 10, 2021, 11:16 AM Jenn Mueng @.***> wrote:
@KinanKazmi https://github.com/KinanKazmi You can just update to the latest version.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/getsentry/sentry-react-native/issues/1386#issuecomment-836232371, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2HKU3YV3EVDRCGTUM7FL3TM523FANCNFSM4Y5TFVDQ .
@KinanKazmi Did you actually update? This issue does not exist anymore.
@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.
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