我试图在android中的expo应用程序上运行create-react-native-app.
首先,我通过编写命令创建了项目
create-react-native-app test
然后我执行了
npm开始
然后从expo app扫描qr代码.
但扫描QR码后,我收到以下错误:
Uncaught Error: Java.net,sockettimeoutException: failed to connect to after 10000ms
Run Code Online (Sandbox Code Playgroud)
Github问题:
https://github.com/react-community/create-react-native-app/issues/144#issuecomment-296631692
react-native react-native-android expo create-react-native-app
我正在尝试使用Expo和Create React Native App为我的React Native应用程序生成.ipa和.apk文件.我成功构建了应用程序,并且能够让它在iOS和Android设备上运行,这要归功于以下文档:https://docs.expo.io/versions/v16.0.0/guides/building-standalone-apps. HTML
构建结束后,我的控制台会显示类似的内容
然后exp.host/@myname/myapp我在我的设备上打开,应用程序通过Expo客户端显示.
但是在文档的第4点,据说是这样的
完成后,您将看到.apk(Android)或.ipa(iOS)文件的网址 - 这是您的应用.
我有点困惑.没有在这个过程中我看到我的电脑上任何地方生成的任何ipa或apk文件.我错过了什么吗?我如何实际生成文件?
我正在尝试为我的React Native Expo应用程序实现导航栏.这是一个问题:
"dependencies": {
"expo": "^18.0.3",
"react": "16.0.0-alpha.12",
"react-native": "^0.45.1",
"react-navigation": "^1.0.0-beta.11"
}
Run Code Online (Sandbox Code Playgroud)
我不知道在哪里以及如何为此组件设置样式以使其不与通知栏重叠.我尝试设置marginTop: StatusBar.currentHeight我的根视图,但它没有用.它在视图上应用了边距,但未在导航栏上应用.
我的应用:
import {StackNavigator} from 'react-navigation';
import Home from './app/screens/Home';
export default App = StackNavigator({
Home: { screen: Home }
})
Run Code Online (Sandbox Code Playgroud)
家:
export default class Home extends Component {
constructor() {
super();
// <...>
}
static navigationOptions = {
title: 'Welcome'
};
// <...>
}
Run Code Online (Sandbox Code Playgroud) 嗨,我正在尝试在我的反应本机项目上运行'yarn android'.并且遇到以下错误:
yarn android v0.27.5
$ react-native-scripts android
10:37:45 AM: Starting packager...
10:39:34 AM: Starting Android...
10:39:37 AM: Packager started!
To view your app with live reloading, point the Expo app to this QR code.
You'll find the QR scanner on the Projects tab of the app.
<QR CODE>
Or enter this address in the Expo app's search bar:
exp://172.19.29.31:19000
Your phone will need to be on the same local network as this computer.
For links to install the Expo …Run Code Online (Sandbox Code Playgroud) 我运行 npx @react-native-community/cli doctor ,遇到以下错误:
我看到与 Android SDK 相关的错误,它正在查找名为 .b33.0.0 的版本,但我找不到有关此版本的任何信息。它似乎不遵循标准的 Android SDK 版本控制格式。
.b33.0.0 版本在 Android SDK 上下文中代表什么?这是一个有效的版本,还是可能是 React Native CLI 的错误或错误?
任何有关如何解决此问题的见解或建议将不胜感激。谢谢你!
检查并安装了最新的Android SDK。验证 ANDROID_HOME 环境变量设置正确。尝试了网上找到的各种解决方案,但都没有解决问题。
我发现 create-react-native-app 是基于 expo 的。但是在使用exp-cli的时候,也是基于Expo的。
create-react-native-app 和 exp init 之间有什么区别?
我试图找到一种方法来使用Facebook登录和Android和IOS的Create-react-native-app.那可能吗?这一切看起来都很新......
拥有以下代码:
import { SQLite } from 'expo';
const db = SQLite.openDatabase('mydb.db')
db.transaction( tx => {
tx.executeSql('insert into invalidTable values (?,?)', [1,2], null, (transact, err) => {
//I can't find error description in the objects below
console.log({transact, err})
})
})
Run Code Online (Sandbox Code Playgroud)
如何获取sqlite错误消息,以确定导致此错误的原因(在本例中为无效表)?
该API文档说我的误差函数" 有两个参数:交易本身,以及错误对象 ",但我找不到在没有这些错误描述.
我做了一个小吃模拟这个场景.
我使用create-react-native设置我的应用程序,并在我的应用程序中使用了expo的 Video组件.如何保留此视频组件并生成apk文件?如果我错了,请纠正我:根据我的理解,npm run eject会阻止你将来使用expo组件.那么我该如何生成apk文件呢.无论是签名还是未签名,至少对我而言,我只想给我的朋友发送apk文件,这样他就可以在手机上运行了
编辑:这不是重复:如何生成一个可以在没有带有react-native的服务器的情况下运行的apk?
当该问题询问如何为react-native生成apk文件时,我会问我如何使用特定的create-react-native-app构建,其中我使用的是expo组件
需要一些帮助,我从左侧字段中得到一个奇怪的错误,我无法调试.在我在另一台Mac上设置我的react本机项目后,这个项目成功捆绑到昨天.
我想知道它是否来自npm软件包的版本我必须重新安装.
任何方向都会有所帮助,它始终是最难设置的,因为你很少这么做...
我的babelrc文件如下 -
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
}
Run Code Online (Sandbox Code Playgroud)
还有我的package.json
{
"name": "hancho_frontend",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "~27.0.0",
"react-native-scripts": "^1.14.1",
"react-test-renderer": "16.3.1"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^6.2.0",
"axios": "^0.18.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-upgrade": "0.0.19",
"color": "^2.0.0",
"expo": "^27.1.0",
"hoist-non-react-statics": "^2.3.0", …Run Code Online (Sandbox Code Playgroud)