u
This commit is contained in:
1 parent
06d79d186a
commit
737aa98d18
85 files changed
+21476
-66
No files matched your search
@@ -26,10 +26,17 @@ npx expo start
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 基础配置
|
||||
|
||||
## 生成基础文件
|
||||
|
||||
```bash
|
||||
npx expo customize babel.config.js
|
||||
npx expo customize metro.config.js
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 集成 [antfu-eslint](https://github.com/antfu/eslint-config)
|
||||
|
||||
可以使用快捷命令(推荐):
|
||||
@@ -903,7 +910,36 @@ oneao://courses/react-native
|
||||
}
|
||||
```
|
||||
|
||||
安装 `module-resolver` :
|
||||
|
||||
```
|
||||
pnpm add -D babel-plugin-module-resolver
|
||||
```
|
||||
|
||||
修改 `babel.config.js` :
|
||||
|
||||
```js
|
||||
module.exports = function (api) {
|
||||
api.cache(true)
|
||||
return {
|
||||
presets: [
|
||||
['babel-preset-expo', { jsxImportSource: 'nativewind' }],
|
||||
'nativewind/babel',
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
'module-resolver',
|
||||
{
|
||||
root: ['./src'],
|
||||
alias: {
|
||||
'@': './src',
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1301,16 +1337,53 @@ app-universal-release.apk
|
||||
|
||||
# 报错
|
||||
|
||||
## 检查依赖是否有误
|
||||
|
||||
```bash
|
||||
npx expo-doctor
|
||||
```
|
||||
|
||||
## Cannot find module 'react-native-worklets/plugin'
|
||||
|
||||
```bash
|
||||
npx expo add react-native-worklets
|
||||
```
|
||||
|
||||
## Filename longer than 260 characters
|
||||
|
||||
解决方法:
|
||||
|
||||
1️⃣ 启用 Windows 长路径支持
|
||||
|
||||
通过 **注册表**开启 Windows 对长路径(超过 260 字符)的支持:
|
||||
|
||||
- 路径:
|
||||
|
||||
```
|
||||
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
|
||||
```
|
||||
|
||||
- 键值:`LongPathsEnabled`
|
||||
|
||||
- 设置为 `1` 表示开启长路径支持。
|
||||
|
||||
✅ 作用:允许系统和应用使用超过 260 个字符的文件路径。
|
||||
|
||||
2️⃣ 替换 Ninja 版本
|
||||
|
||||
- 旧版本 Ninja(v1.10)在 Windows 下仍然可能受路径长度限制,导致构建 `.o` 文件失败。
|
||||
- 下载新版 Ninja(v1.12+)并替换 Android SDK 自带的 Ninja:
|
||||
|
||||
旧路径(Android SDK 自带):
|
||||
|
||||
```
|
||||
C:\Users\<your-username>\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe
|
||||
```
|
||||
|
||||
> 该路径可能不在这里,C盘这里是默认安装的,如果安装到其他位置的话,那么就换成具体的位置。
|
||||
|
||||
新 Ninja 下载地址:
|
||||
👉 https://github.com/ninja-build/ninja/releases
|
||||
|
||||
替换后,Ninja 就可以处理更长的路径,不再报 “Filename longer than 260 characters” 错误。
|
||||
|
||||
|
||||
Reference in new issue
Block a user