javascript - 当我尝试在 android 模拟器中运行 react native 时。我得到错误类型 3。错误:活动类 {com.eg/com.eg.MainActivity} 不存在
问题描述
BUILD SUCCESSFUL in 10s
154 actionable tasks: 2 executed, 152 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.baqala/.MainActivity }
Error type 3
Error: Activity class {com.baqala/com.baqala.MainActivity} does not exist.
解决方案
如果您将产品风味或变体与applicationIdSuffix "<YOUR SUFFIX>"
我的项目有多种构建类型和产品风格,每种风格在 app/build.gradle 中指定 applicationIdSuffix。当您运行react-native run-android --variant=<VARIANT>
它时,它将构建但无法在模拟器上打开。一个解决方案是添加--appIdSuffix '<YOUR SUFFIX>'
到您的运行命令
例如:
react-native run-android --variant=stagingDebug --appIdSuffix 'staging'
React Native CLI 有望在未来解决这个问题。
推荐阅读
- javascript - react _this2.setState 不是函数 - 可能的绑定问题
- google-analytics-api - 如何使用 nodejs 中的访问令牌从 Google Analytics api v4 获取数据
- dc.js - 使用交叉过滤器在环形图 dc js 中显示多个值总数
- java - 加载 Java xlsx 文件的属性时出错。[错误] 格式错误的 \uxxxx 编码
- java - 是否有范围<?在 JDK 中扩展 Comparable> API
- django - 如何在 django 中使用“add_fields”?
- java - 来自每个表单导航的代号一个新的 gui builder-back 命令
- asp.net-core - rzc discover 退出,代码为 -1073741819
- git - 如何检查 git 历史记录以强制推送?
- python - ctypes 数组中元素上的 Ctypes 指针