{"id":19027956,"url":"https://github.com/kennytian/react-native-template","last_synced_at":"2025-07-20T06:06:02.516Z","repository":{"id":250856764,"uuid":"835610160","full_name":"Kennytian/react-native-template","owner":"Kennytian","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-19T01:53:41.000Z","size":416,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T19:44:48.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kennytian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T07:21:49.000Z","updated_at":"2024-08-19T01:53:44.000Z","dependencies_parsed_at":"2024-08-19T02:57:57.122Z","dependency_job_id":"2917696a-9882-4406-a2e9-5283926e46f5","html_url":"https://github.com/Kennytian/react-native-template","commit_stats":null,"previous_names":["kennytian/react-native-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/Kennytian/react-native-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Freact-native-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Freact-native-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Freact-native-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Freact-native-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kennytian","download_url":"https://codeload.github.com/Kennytian/react-native-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kennytian%2Freact-native-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076095,"owners_count":23872730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T21:09:32.645Z","updated_at":"2025-07-20T06:06:02.498Z","avatar_url":"https://github.com/Kennytian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native 应用模板\n\n\n\n## Q\u0026A\n\n### 1、Android 无法访问网络\n打开 `android/app/src/main/AndroidManifest.xml`，在第10行附件添加`android:usesCleartextTraffic=\"true\"`，如下所示：\n\n```shell\nandroid:roundIcon=\"@mipmap/ic_launcher_round\"\nandroid:usesCleartextTraffic=\"true\"\nandroid:allowBackup=\"false\"\n```\n\n### 2、Android 打 AAB 包失败\n现在 Google Play 要求上传的包必须是 AAB 格式， 当执行 `./gradlew buildBundle` 时，会报错：\n`\norg.gradle.execution.TaskSelectionException: Task 'buildBundle' is ambiguous in root project 'rnApp' and its subprojects. Candidates are: 'buildDebugPreBundle', 'buildReleasePreBundle'.\n`\n\n打开 `android/app/build.gradle`，在第 134 行附近添加如下代码：\n```grovy\ntask buildBundle {\n    dependsOn \"bundleRelease\"\n}\n```\n\n### 3、iOS 无法访问网络\n由于线上 API 服务器没有配置域名，直接用 IP 访问的，就会造成 iOS Debug 包都无法访问网络。打开 `ios/rnApp/Info.plist`，在第 33 行附近添加如下代码：\n\n```shell\n\u003ckey\u003eNSExceptionDomains\u003c/key\u003e\n\u003cdict\u003e\n    \u003ckey\u003e19.136.9.115\u003c/key\u003e\n    \u003cdict\u003e\n        \u003ckey\u003eNSTemporaryExceptionAllowsInsecureHTTPLoads\u003c/key\u003e\n        \u003ctrue/\u003e\n    \u003c/dict\u003e\n\u003c/dict\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennytian%2Freact-native-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennytian%2Freact-native-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennytian%2Freact-native-template/lists"}