繁体   English   中英

React Native package 服务器未连接到 Android 模拟器

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM