无法解析模块AccessibilityInfo

时间:2018-07-12 21:59:13

标签: android reactjs react-native react-native-android

在Android文件中运行./gradlew assembleRelease时出现此错误。 我试过了:-

  • 清除缓存
  • 删除node_modules,然后运行npm install
  • 将本机版本从0.56降级到0.55

所有这些都不起作用。请帮助我

:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareAndroidArchLifecycleRuntime100Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2610Library
:app:prepareComAndroidSupportAppcompatV72610Library
:app:prepareComAndroidSupportSupportCompat2610Library
:app:prepareComAndroidSupportSupportCoreUi2610Library
:app:prepareComAndroidSupportSupportCoreUtils2610Library
:app:prepareComAndroidSupportSupportFragment2610Library
:app:prepareComAndroidSupportSupportMediaCompat2610Library
:app:prepareComAndroidSupportSupportV42610Library
:app:prepareComAndroidSupportSupportVectorDrawable2610Library
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library
:app:prepareComFacebookFrescoDrawee190Library
:app:prepareComFacebookFrescoFbcore190Library
:app:prepareComFacebookFrescoFresco190Library
:app:prepareComFacebookFrescoImagepipeline190Library
:app:prepareComFacebookFrescoImagepipelineBase190Library
:app:prepareComFacebookFrescoImagepipelineOkhttp3190Library
:app:prepareComFacebookReactReactNative0560Library
:app:prepareComFacebookSoloaderSoloader030Library
:app:prepareOrgWebkitAndroidJscR174650Library
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:mergeReleaseShaders UP-TO-DATE
:app:compileReleaseShaders UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
:app:bundleReleaseJsAndAssets
Scanning folders for symlinks in C:\Users\hasan\TEaPP\node_modules (46ms)
Scanning folders for symlinks in C:\Users\hasan\TEaPP\node_modules (45ms)
warning: the transform cache was reset.
Loading dependency graph, done.

Unable to resolve module `AccessibilityInfo` from `C:\Users\hasan\TEaPP\node_modules\react-native\Libraries\react-native\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.

:app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 23.073 secs

2 个答案:

答案 0 :(得分:1)

如果有人仍在寻找解决方案,请不要浪费时间来解决软件包问题,该问题将在下一版本中得到纠正。您可以使用最新的RC版本(截止到今天为0.57.0-rc.3)并创建项目,所有这些都可以在Windows中正常工作。这个问题浪费了很多开发人员大量的时间。

答案 1 :(得分:0)

严重的是,当我运行react-native链接时遇到了这个问题,但这是针对iOS的。那天,我在尝试为解决方案大量调试。但是它什么也没找到。我刚刚重新启动lp,一切对我来说都很好。 这只是我遇到这个问题的一种方式,我尝试了不同的方法。