React Native Release App.APK搜索Metro服务器

发布于 2025-01-26 23:19:13 字数 707 浏览 2 评论 0 原文

我创建了我的Android应用程序的发布。但是,我已经使用Android Studio来创建它,但是,当我安装应用程序时,它会自动关闭。出现的错误如下:

我的第一个应用程序的规格如下(App1):

-react native : 0.68.1
-buildToolsVersion = "31.0.0"
-minSdkVersion = 21
-compileSdkVersion = 31
-targetSdkVersion = 31
-buildGradle : 7.1.3

我的第二个应用程序具有以下规格(App2)的情况也是如此:

-react native : 0.67.4
-buildToolsVersion = "30.0.2"
-minSdkVersion = 21
-compileSdkVersion = 30
-targetSdkVersion = 30
-ndkVersion = "21.4.7075529"
-buildGradle : 4.2.2

我需要的是签名的APK,我不需要一个调试是因为它编译了。非常感谢您。

I have created a release of my android application. I have used Android Studio to create it, however, when I install the application it closes automatically. The error that appears is the following:
enter image description here

The specifications of my first application are as follows (app1):

-react native : 0.68.1
-buildToolsVersion = "31.0.0"
-minSdkVersion = 21
-compileSdkVersion = 31
-targetSdkVersion = 31
-buildGradle : 7.1.3

The same goes for my second app with the following specs (app2):

-react native : 0.67.4
-buildToolsVersion = "30.0.2"
-minSdkVersion = 21
-compileSdkVersion = 30
-targetSdkVersion = 30
-ndkVersion = "21.4.7075529"
-buildGradle : 4.2.2

What I need is a signed apk, I don't need a debug because it compiles. Thank you very much in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执笏见 2025-02-02 23:19:13

我遇到了同样的问题。我的解决方案:

  M1 Macbook Pro
  react-native: "0.68.1",
  buildToolsVersion = "31.0.0"
  minSdkVersion = 21
  compileSdkVersion = 31
  targetSdkVersion = 31
  1. android/app/src/main/assests不存在。我创建了一个。

  2. npx react-native bundle-平台android -dev false-entry-file index.js - bundle-undle-undle-undle-underput android/app/src/src/src/src/assets/index.android.bundle.bundle

  3. 在此阶段,发布过程会导致错误。我将在android/app/src/main/res下删除所有可绘制的文件夹。不要删除Android/app/src/main/res/drawable文件夹!

  4. 在Android文件夹中

I had the same problem. My solution:

  M1 Macbook Pro
  react-native: "0.68.1",
  buildToolsVersion = "31.0.0"
  minSdkVersion = 21
  compileSdkVersion = 31
  targetSdkVersion = 31
  1. android/app/src/main/assests is not exist. I created one.

  2. npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle

  3. At this stage, the release process results in an error. I am delete all drawable-* folders under android/app/src/main/res. Don't delete android/app/src/main/res/drawable folder!.

  4. in android folder ./gradlew assembleRelease and success!

萝莉病 2025-02-02 23:19:13

错误日志清楚地提到了 index.android.bundle 文件是此处的罪魁祸首。要解决此问题,请运行以下命令,

npx react-native bundle -platform-dev false-entry-file-entry-file index.js - bundle-out-out-undle-out-out-under-untroid/app/app/src/src/src/src/assets/index。 Android.bundle

这将创建正确的 index.android.bundle 文件,您将能够运行该应用程序。

The error log has clearly mentioned that the index.android.bundle file is the culprit here. To fix this, run the following command,

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle

This will create the correct index.android.bundle file and you will be able to run the app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文