【问题标题】:Cannot run React Native Project on Android Device or Simulator with React-Native-Maps dependency无法在具有 React-Native-Maps 依赖项的 Android 设备或模拟器上运行 React Native 项目
【发布时间】:2017-01-06 19:30:40
【问题描述】:

我目前正在尝试在 android 上构建和运行我的项目,但它一直失败。我遵循了正确设置 android 环境的所有说明,因为我能够让我的其他应用程序在模拟器上运行。我在这个项目上使用了 React 本机映射依赖项,并且由于某种原因,每当我运行 react-native run-android 时,它都会因以下错误而崩溃: error: constructor ActionSheetPackage in class ActionSheetPackage cannot be applied to given types; new ActionSheetPackage() ^ required: FragmentActivity found: no arguments reason: actual and formal argument lists differ in length 1 error :app:compileDebugJavaWithJavac FAILED
其次是: What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. Compilation failed; see the compiler error output for details.

我尝试使用 react-native-maps github 页面上的内容进行故障排除,但似乎都不起作用。有人有什么想法吗?

【问题讨论】:

  • 你是在一个干净的项目中开发它还是你有一些现有的代码库?

标签: android react-native react-native-maps


【解决方案1】:

事实证明,问题在于有一个在 android 上不起作用的依赖项。当我npm installed 依赖项时,它还将它的自身安装在项目的 android 部分中。一旦我从那里移除它,它就像一个魅力。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-16
    • 1970-01-01
    • 2019-03-27
    • 1970-01-01
    • 1970-01-01
    • 2020-09-23
    • 2018-03-24
    相关资源
    最近更新 更多