[英]React Native package server not connected to Android simulator
我在 android 模擬器上運行我的 react 本機應用程序。 My app works fine and is connected with my react-native package server (npm start command I used to start my server) with the android simulator Galaxy J3 series and Galaxy pixel C series. 但是相同的應用程序將無法使用最新的 Android 模擬器三星 Galaxy S21 Ultra API 28 運行(未通過服務器加載包)。它會引發錯誤,無法連接到開發服務器注意:我將開發設置設置為所有模擬器是一樣的。 Android工作室版:3.6.1
構建.grdle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
經過搜索和大量試驗,我最終得到了解決方案。 我在androidmanifest.xml
文件的<application
標簽中添加了android:usesCleartextTraffic="true"
行。 然后我重新運行該應用程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.