我研究了如何使用react-native为Android开发应用程序。我曾经做过像“ Hellow World”这样的简单应用,并在博览会中构建。
从命令行运行了我
exp build:android
We've built a brand new CLI for Expo!
Expo CLI is a drop in replacement for exp.
Install: npm install -g expo-cli
Use: expo --help
Read more: https://blog.expo.io/expo-cli-2-0-released-a7a9c250e99c
[19:07:57] Checking if current build exists...
[19:07:59] No currently active or previous builds for this project.
[19:08:01] Publishing to channel 'default'...
[19:08:03] Building iOS bundle
[19:08:04] Building Android bundle
[19:08:04] Analyzing assets
[19:08:06] Uploading assets
[19:08:06] No assets to upload, skipped.
[19:08:06] Processing asset bundle patterns:
[19:08:06] - /home/xxx/projects/wtf/assets/*
[19:08:06] Uploading JavaScript bundles
[19:08:09] Published
[19:08:09] Your URL is
https://exp.host/xxx/wtf
[19:08:09] Building...
[19:08:10] Build started, it may take a few minutes to complete.
[19:08:10] You can check the queue length at
https://expo.io/turtle-status
[19:08:10] You can monitor the build at
https://expo.io/builds/4eb3dae0-d227-4732-a6db-1a1953a79b0d
|[19:08:10] Waiting for build to complete. You can press Ctrl+C to exit.
[19:25:21] Successfully built standalone app:
应用程序构建良好。我是从Expo网站下载apk,并尝试在android上安装。安装时,出现类似以下消息的错误:
注意问题。如何使我的应用程序安全?我找不到有关此信息。这样就可以在不禁用Android保护的情况下安装它。
我的app.json看起来像:
{
"expo": {
"name": "wtf",
"slug": "wtf",
"privacy": "public",
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"assets/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.wtf.wtf"
}
}
}
等待该应用程序在android上安装。
答案 0 :(得分:0)
在手机的设置中,您应该能够选择一个选项,以允许从不受信任的来源进行安装。然后,它应该为您提供“仍然安装”之类的选项