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

Network request failed in 'expo start --dev-client',error: App Transport Security,but it is work in expo go. #2328

Closed
konson-git opened this issue Apr 13, 2024 · 0 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@konson-git
Copy link

Build/Submit details page URL

No response

Summary

EAS build project, the http request will report an error: "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.", this only happens in the development client, but it works in expo go , I tried adding the following code in app.json but it didn't work.

"infoPlist": {
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true,
"NSAllowsLocalNetworking": true,
"NSExceptionDomains": {
"1.94.105.1": {
"NSIncludesSubdomains": true,
"NSExceptionAllowsInsecureHTTPLoads": true
}
}
}
}

Managed or bare?

Managed

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 12.5.1
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.15.0 - ~/.volta/tools/image/node/18.15.0/bin/node
Yarn: 4.1.0 - ~/.volta/tools/image/yarn/4.1.0/bin/yarn
npm: 9.5.0 - ~/.volta/tools/image/node/18.15.0/bin/npm
Managers:
CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
IDEs:
Xcode: 14.0/14A309 - /usr/bin/xcodebuild
npmPackages:
expo: ~50.0.14 => 50.0.15
expo-router: ~3.4.8 => 3.4.8
react: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
Expo Workflow: managed

Check Expo config for common issues

✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check for issues with metro config
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that native modules use compatible support package versions for installed Expo SDK
✔ Check that packages match versions required by installed Expo SDK

Error output

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

Reproducible demo or steps to reproduce from a blank project

null

@konson-git konson-git added the needs review Issue is ready to be reviewed by a maintainer label Apr 13, 2024
@konson-git konson-git changed the title EAS build Network request failed,about ATS,but it is work in expo go. Network request failed in 'expo start --dev-client',error: App Transport Security,but it is work in expo go. Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant