Android 无法使react中的已签名apk成为本机

Android 无法使react中的已签名apk成为本机,android,react-native,signed-apk,Android,React Native,Signed Apk,尝试使用链接创建react本机项目的已签名apk时 我得到以下错误 Unable to resolve module `./touchables` from `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\index.js`: The module `./touchables` could not be found from `C:\Users\pc\Desktop\GSTCalc\node_modul

尝试使用链接创建react本机项目的已签名apk时 我得到以下错误

Unable to resolve module `./touchables` from `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\index.js`: The module `./touchables` could not be found from `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\index.js`. Indeed, none of these files exist:   * `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\touchables(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
* `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\touchables\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`

Error: Unable to resolve module `./touchables` from `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\index.js`: The module `./touchables` could not be found from `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\index.js`. Indeed, none of these files exist:   * `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\touchables(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
* `C:\Users\pc\Desktop\GSTCalc\node_modules\react-native-gesture-handler\touchables\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
    at ModuleResolver.resolveDependency (C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:120:15)
    at ResolutionRequest.resolveDependency (C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:49:18)
    at DependencyGraph.resolveDependency (C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\node-haste\DependencyGraph.js:218:16)
    at Object.resolve (C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\lib\transformHelpers.js:141:30)
    at dependencies.map.result (C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\DeltaBundler\traverseDependencies.js:373:31)
    at Array.map (<anonymous>)
    at resolveDependencies (C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\DeltaBundler\traverseDependencies.js:369:18)
    at C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\DeltaBundler\traverseDependencies.js:188:33
    at Generator.next (<anonymous>)
    at step (C:\Users\pc\Desktop\GSTCalc\node_modules\metro\src\DeltaBundler\traverseDependencies.js:298:30)
C:\Users\pc\Desktop\GSTAppDesign\GSTCalc\android\app\build\generated\assets\react\release\index.android.bundle 捆绑包:完成写入捆绑包输出捆绑包:复制7个资产文件 捆绑:复制资产完成

C:\Users\pc.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\2e72d58316ce557e86b0d638298e5052\res\values-v28\values-v28.xml:9:5-12:13: AAPT:错误:未找到资源android:attr/dialogCornerRadius

C:\Users\pc\Desktop\GSTAppDesign\GSTCalc\android\app\build\mediates\incremental\mergeReleaseResources\merged.dir\values-v28\values-v28.xml:11: AAPT:错误:未找到资源android:attr/dialogCornerRadius

C:\Users\pc.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\2e72d58316ce557e86b0d638298e5052\res\values\values.xml:1304:5-69: AAPT:错误:未找到资源android:attr/fontVariationSettings

C:\Users\pc.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\2e72d58316ce557e86b0d638298e5052\res\values\values.xml:1304:5-69: AAPT:错误:未找到资源android:attr/ttcIndex

错误:链接引用失败


在构建已签名的APK之前,首先确保您的捆绑包位于android文件夹中的资产中

运行此命令以生成捆绑包

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
另外,为手势处理程序添加此包

npm install -save react-native-gesture-handler

在构建已签名的APK之前,首先确保您的捆绑包位于android文件夹中的资产中

运行此命令以生成捆绑包

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
另外,为手势处理程序添加此包

npm install -save react-native-gesture-handler

我认为您会遇到错误,因为您已经在react原生项目中安装了
react navigation
,因此您还必须安装下面的软件包

尝试安装

npm i --save react-native-gesture-handler

react-native link react-native-gesture-handler
请尝试此选项以清除和重置缓存:

RN<0.50-看守人监视删除所有和&rm-rf$TMPDIR/react-*&&rm-rf节点\u模块/&&npm缓存清理和&npm安装和&npm启动---重置缓存
RN>=0.50-看守人监视删除所有和&rm-rf$TMPDIR/react本机打包机缓存-*&&rm-rf$TMPDIR/metro捆绑机缓存-*&&rm-rf节点\u模块/&&npm缓存清理和&npm安装和&npm启动--重置缓存
npm>=5-看守人监视删除所有和&rm-rf$TMPDIR/react-*&&rm-rf节点\U模块/&&npm缓存验证和&npm安装和&npm启动---重置缓存
Windows-del%appdata%\Temp\react native-*&cd android&gradlew clean&cd..&del node_modules/&npm缓存清除--force&npm安装&npm启动--reset缓存


希望这将为您工作,为我工作

我认为您遇到了错误,因为您已在react本机项目中安装了
react navigation
,因此您还必须安装以下软件包

尝试安装

npm i --save react-native-gesture-handler

react-native link react-native-gesture-handler
请尝试此选项以清除和重置缓存:

RN<0.50-看守人监视删除所有和&rm-rf$TMPDIR/react-*&&rm-rf节点\u模块/&&npm缓存清理和&npm安装和&npm启动---重置缓存
RN>=0.50-看守人监视删除所有和&rm-rf$TMPDIR/react本机打包机缓存-*&&rm-rf$TMPDIR/metro捆绑机缓存-*&&rm-rf节点\u模块/&&npm缓存清理和&npm安装和&npm启动--重置缓存
npm>=5-看守人监视删除所有和&rm-rf$TMPDIR/react-*&&rm-rf节点\U模块/&&npm缓存验证和&npm安装和&npm启动---重置缓存
Windows-del%appdata%\Temp\react native-*&cd android&gradlew clean&cd..&del node_modules/&npm缓存清除--force&npm安装&npm启动--reset缓存


希望这对你有用,对我有用

我正在使用android应用程序。npm a—保存反应本机手势处理程序。我应该写这个吗?你必须在你的终端应用程序中安装上面的模块粘贴上面的命令directory@Neha请阅读此处的说明,Hardik Virani没有任何功能。我最初在我的项目中使用了npm。然后我用纱线升级了gradle版本。我使用npm卸载了react navigation和react navigation手势处理程序,并使用Thread再次安装了它们。我把事情搞砸了。
watchman watch del&&rm-rf$TMPDIR/react native packager cache-*&&rm-rf$TMPDIR/metro bundler cache-*&&rm-rf node_modules/&&npm cache clean--force&&npm install&&npm start--reset cache
试试上面的命令@NehaI我在android应用程序中使用这个命令。npm a—保存反应本机手势处理程序。我应该写这个吗?你必须在你的终端应用程序中安装上面的模块粘贴上面的命令directory@Neha请阅读此处的说明,Hardik Virani没有任何功能。我最初在我的项目中使用了npm。然后我用纱线升级了gradle版本。我使用npm卸载了react navigation和react navigation手势处理程序,并使用Thread再次安装了它们。我把事情搞砸了。
watchman watch del&&rm-rf$TMPDIR/react native packager cache-*&&rm-rf$TMPDIR/metro bundler cache-*&&rm-rf node_modules/&&npm cache clean--force&&npm install&&npm start--reset cache
try over command@nehap请访问以下链接获取答案:当我转到build->build Bundle(s)/APK(s)->build APK(s),然后什么都不会发生。当我进入build->build Bundle(s)/APK(s)->build Bundle(s)时,它显示构建Android应用程序捆绑需要您更新到最新版本的Android Gradle插件。请访问以下链接以获取答案:当我进入build->build Bundle(s)/APK(s)->build APK(s)时,什么都不会发生。当我进入build->build Bundle(s)/APK(s)->build Bundle(s)时,它显示构建Android应用程序Bundle需要您更新到最新版本的Android Gradle插件