弹出到 ExpoKit 后,Expo 不起作用

Posted

技术标签:

【中文标题】弹出到 ExpoKit 后,Expo 不起作用【英文标题】:Expo doesn't work after ejecting to ExpoKit 【发布时间】:2020-04-19 15:20:41 【问题描述】:

我正在使用 Expo 应用程序,我需要将此应用程序弹出到 ExpoKit,以使用 this library 创建 p2p 聊天。当我设法使用 ExpoKit 弹出我的应用程序时(我在终端中从 Expo 收到“弹出成功消息”,所以我想这没问题)。而现在,当我想构建我的项目时,即使只是为了品尝它是否工作(不更改代码,在使用 expo start --lan 弹出之前工作)。这是此错误的完整堆栈跟踪。

dolidod@debian:~/PROJECT_DIR/android$ ./gradlew assembleDebug --stacktrace

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.internal.service.ServiceCreationException: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:823)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:774)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:568)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:625)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:787)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:773)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:568)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:625)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:787)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:773)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:568)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:625)
        at org.gradle.internal.service.DefaultServiceRegistry.find(DefaultServiceRegistry.java:292)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:281)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:276)
        at org.gradle.initialization.DefaultGradleLauncherFactory.doNewInstance(DefaultGradleLauncherFactory.java:172)
        at org.gradle.initialization.DefaultGradleLauncherFactory.newInstance(DefaultGradleLauncherFactory.java:99)
        at org.gradle.composite.internal.DefaultRootBuildState.<init>(DefaultRootBuildState.java:46)
        at org.gradle.composite.internal.DefaultIncludedBuildRegistry.addRootBuild(DefaultIncludedBuildRegistry.java:85)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:823)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:774)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:568)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:625)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:787)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:773)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:568)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:625)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:787)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:773)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:568)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:625)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:787)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:773)
        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:568)
        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:625)
        at org.gradle.internal.service.DefaultServiceRegistry.find(DefaultServiceRegistry.java:292)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:281)
        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:276)
        at org.gradle.internal.service.scopes.BuildScopeServices.defaultScriptPluginFactory(BuildScopeServices.java:318)
        at org.gradle.internal.service.scopes.BuildScopeServices.createScriptPluginFactory(BuildScopeServices.java:310)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:35)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:821)
        ... 63 more
Caused by: org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: /home/dolidod/KORONAPIVOT/SkateAppFrontend/android/.gradle/4.10.2/fileHashes/fileHashes.lock (Permission denied)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:57)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:40)
        at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:110)
        at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.incrementLockCount(LockOnDemandCrossProcessCacheAccess.java:106)
        at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.acquireFileLock(LockOnDemandCrossProcessCacheAccess.java:165)
        at org.gradle.cache.internal.DefaultCacheAccess.onStartWork(DefaultCacheAccess.java:368)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:213)
        at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:203)
        at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:298)
        at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:57)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.createCache(DefaultPersistentDirectoryStore.java:160)
        at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.createCache(DefaultCacheFactory.java:185)
        at org.gradle.api.internal.changedetection.state.CrossBuildFileHashCache.createCache(CrossBuildFileHashCache.java:60)
        at org.gradle.api.internal.changedetection.state.CachingFileHasher.<init>(CachingFileHasher.java:45)
        at org.gradle.internal.service.scopes.BuildSessionScopeServices.createFileSnapshotter(BuildSessionScopeServices.java:161)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:35)
        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:821)
        ... 89 more
Caused by: java.io.FileNotFoundException: /home/dolidod/KORONAPIVOT/SkateAppFrontend/android/.gradle/4.10.2/fileHashes/fileHashes.lock (Permission denied)
        at org.gradle.cache.internal.filelock.LockFileAccess.<init>(LockFileAccess.java:33)
        at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.<init>(DefaultFileLockManager.java:156)
        at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:107)
        ... 107 more


* Get more help at https://help.gradle.org

BUILD FAILED in 0s

经过一些提示,Allan Joseph 建议:https://pastebin.com/0HPdKzba(由于 *** 帖子正文的限制,我使用了 pastebin)。

另外,这是我的 AndroidManifest.xml 权限:

<?xml version="1.0" encoding="utf-8"?>
<manifest
  package="host.exp.exponent"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools">

  <permission
    android:name="skate.some.permission.C2D_MESSAGE"
    android:protectionLevel="signature"/>

  <!-- These are required permissions to make the app run -->
  <uses-permission android:name="skate.some.permission.C2D_MESSAGE" />
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />

  <uses-permission android:name="android.permission.CAMERA" />
  <uses-feature android:name="android.hardware.camera" />
  <uses-feature android:name="android.hardware.camera.autofocus"/>

  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

  <!-- ADD PERMISSIONS HERE -->
  <!-- BEGIN OPTIONAL PERMISSIONS -->
  <uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
  <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.USE_FINGERPRINT" />
  <uses-permission android:name="android.permission.VIBRATE" />
  <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

  <!-- These require runtime permissions on M -->
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-permission android:name="android.permission.READ_CONTACTS" />
  <uses-permission android:name="android.permission.READ_CALENDAR" />
  <uses-permission android:name="android.permission.WRITE_CALENDAR" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_SETTINGS" />
  <!-- END OPTIONAL PERMISSIONS -->

  <!-- ADD TEST PERMISSIONS HERE -->

  <uses-feature android:glEsVersion="0x00020000" android:required="false" />
  <uses-feature android:name="android.software.leanback" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />

  <application

另外,这是我的 package.json


  "main": "node_modules/expo/AppEntry.js",
  "scripts": 
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  ,
  "dependencies": 
    "@babel/plugin-proposal-export-default-from": "^7.8.3",
    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
    "@babel/polyfill": "^7.8.7",
    "@babel/preset-react": "^7.9.4",
    "@eva-design/eva": "^1.4.0",
    "@material-ui/core": "^4.9.4",
    "@react-native-community/masked-view": "^0.1.6",
    "@react-native-community/netinfo": "~3.2.1",
    "@react-native-community/slider": "^2.0.8",
    "@react-navigation/routers": "^5.0.1",
    "@ui-kitten/components": "^4.4.1",
    "@ui-kitten/date-fns": "^4.4.1",
    "@ui-kitten/eva-icons": "^4.4.1",
    "@ui-kitten/moment": "^4.4.1",
    "axios": "^0.19.2",
    "axois": "^0.0.1-security",
    "babel-plugin-module-resolver": "^4.0.0",
    "babel-preset-es2016": "^6.24.1",
    "babel-preset-react-native": "^5.0.2",
    "expo": "^35.0.0",
    "expo-av": "~7.0.0",
    "expo-constants": "~7.0.0",
    "expo-document-picker": "~7.0.0",
    "expo-font": "~7.0.0",
    "expo-image-picker": "~7.0.0",
    "expo-image-picker-multiple": "^1.1.5",
    "expo-multiple-imagepicker": "^1.0.6",
    "expo-secure-store": "~7.0.0",
    "expo-video-player": "^1.5.7",
    "expokit": "^35.0.4",
    "i": "^0.3.6",
    "metro-react-native-babel-preset": "^0.59.0",
    "native-base": "2.13.8",
    "npm": "^6.14.3",
    "react": "16.8.3",
    "react-bottom-scroll-listener": "^3.0.0",
    "react-dom": "16.8.3",
    "react-hot-loader": "^4.12.20",
    "react-material-ui-form-validator": "^2.0.9",
    "react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
    "react-native-axios": "^0.17.1",
    "react-native-device-uuid": "^1.2.0",
    "react-native-dialog": "^5.6.0",
    "react-native-document-picker": "^3.2.4",
    "react-native-elements": "^1.2.7",
    "react-native-form": "^2.1.3",
    "react-native-gesture-handler": "~1.3.0",
    "react-native-image-crop-picker": "^0.28.0",
    "react-native-maps": "~0.25.0",
    "react-native-material-design-searchbar": "^1.8.0",
    "react-native-material-textfield": "^0.16.1",
    "react-native-picker-select": "^6.5.0",
    "react-native-reanimated": "~1.2.0",
    "react-native-safe-area-context": "~0.3.6",
    "react-native-safe-area-view": "^1.0.0",
    "react-native-screens": "~1.0.0-alpha.23",
    "react-native-search-bar": "^3.5.1",
    "react-native-star-rating": "^1.1.0",
    "react-native-store-rating": "^1.0.1",
    "react-native-svg": "~9.9.2",
    "react-native-unimodules": "^0.6.0",
    "react-native-validator-form": "^1.0.0",
    "react-native-video": "^5.0.2",
    "react-native-web": "^0.11.7",
    "react-native-webrtc": "^1.75.3",
    "react-navigation": "^4.0.10",
    "react-navigation-drawer": "^2.3.2",
    "react-navigation-stack": "^1.10.3",
    "react-on-screen": "^2.1.1",
    "reconnecting-websocket": "^4.4.0",
    "socket.io-client": "^2.3.0",
    "tcomb-form-native": "^0.6.20",
    "url-search-params-polyfill": "^8.0.0"
  ,
  "devDependencies": 
    "@babel/preset-typescript": "^7.9.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-const-enum": "^0.0.1",
    "babel-preset-expo": "^7.1.0"
  ,
  "private": true

【问题讨论】:

【参考方案1】:

检查您的 Android 手动安装是否已为库正确完成。浏览链接并再次验证。

Android Installation

此外,您的堆栈跟踪在以下几行中提到了 Permissions denied。检查您是否具有递归应用到项目文件夹中所有目录的写权限。如果不给目录写和执行权限。

原因:org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: /home/dolidod/KORONAPIVOT/SkateAppFrontend/android/.gradle/4.10.2/fileHashes/fileHashes.lock (权限被拒绝)

引起:java.io.FileNotFoundException: /home/dolidod/KORONAPIVOT/SkateAppFrontend/android/.gradle/4.10.2/fileHashes/fileHashes.lock (权限被拒绝)

对于权限,请在终端上使用以下命令

chmod -R 777 /project-folder-path

对于您更新的其他错误

转到项目根文件夹并尝试以下命令。确保这些是在根文件夹而不是 android 文件夹中完成的。

rm -rf node_modules

npm install -g expo-cli

npm install

expo start or npm start

同时检查您是否在 AndroidManifest.xml 文件中添加了以下权限。

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

【讨论】:

Jospeh - 好吧,我听从了你的建议。我遇到了一些错误,我尝试用谷歌搜索它们,但没有任何效果。我想这是版本的一些问题,因为似乎没有任何作用。 @DolidodTeethtard 我已经根据我在您共享的链接的堆栈跟踪中看到的内容更新了我的答案。试试看告诉我 我已经拥有这些权限,我删除了 node_modules 并安装了软件包(我使用的是纱线,所以我使用了“纱线添加”),如您在答案中所示。但是问题还是一样 你能分享你的 package.json 文件吗?我需要检查一下 执行expo install expo-permissionsexpo install expo-media-library 并再次重新运行项目

以上是关于弹出到 ExpoKit 后,Expo 不起作用的主要内容,如果未能解决你的问题,请参考以下文章

弹出 React Native 项目时,Bare 和 ExpoKit 有啥区别?

Expokit:未定义的方法“target_installation_results”

将 Expo Project 弹出到 Bare React Native 时出错

如何将我的应用程序从 expo 弹出到裸反应本机代码

为啥 expo 弹出无法弹出 expo 应用程序?

全局变量在 React Native 中不起作用 - Expo