Fix Windows native builds with hoisted dependencies and JDK guidance

This commit is contained in:
tomchukk committed 2026-09-09 14:06:51 +03:00
1 parent fb937848c3
commit 6514a357a5
4 files changed
+27 -3

No files matched your search

+1
View File
@@ -13,3 +13,4 @@ android/
*.jks *.jks
*.keystore *.keystore
.DS_Store .DS_Store
.idea/
+2
View File
@@ -1,2 +1,4 @@
save-exact=true save-exact=true
strict-peer-dependencies=true strict-peer-dependencies=true
# Keep native CMake/Ninja paths below Windows path limits.
node-linker=hoisted
+23 -1
View File
@@ -30,15 +30,37 @@ Select your development team for physical-device signing. The initial bundle/app
Install Android Studio, the SDK and JDK required by the generated Expo project. Start an emulator or attach a device, then run pnpm android. For subsequent JS-only changes run pnpm start. The native directories are intentionally generated and ignored; app.json and config plugins are their source of truth. Install Android Studio, the SDK and JDK required by the generated Expo project. Start an emulator or attach a device, then run pnpm android. For subsequent JS-only changes run pnpm start. The native directories are intentionally generated and ignored; app.json and config plugins are their source of truth.
### Windows PowerShell
Use a JDK 17 or 21 for the Android command-line build. Android Studio can keep using its own bundled runtime. Its bundled Java 25 caused the native CMake configuration to fail with `A restricted method in java.lang.System has been called` on the verified Windows workstation; switching the build to its installed JDK 21 resolved that error.
The paths below are the installed SDK and JDK on Tom's Windows workstation. Adjust them for another computer:
```powershell
$env:ANDROID_HOME = "$env:LOCALAPPDATA\Android\Sdk"
$env:JAVA_HOME = "C:\Program Files\Eclipse Adoptium\jdk-21.0.10.7-hotspot"
$env:Path = "$env:JAVA_HOME\bin;$env:ANDROID_HOME\platform-tools;$env:ANDROID_HOME\emulator;$env:Path"
adb devices
pnpm install --frozen-lockfile
if ($LASTEXITCODE -eq 0) { pnpm android }
```
Run these commands from the mobile repository with an emulator started. They set the environment for the current PowerShell session only. SDK Platform 36, Build-Tools 36.0.0 and an API 36 x86_64 emulator are used on this workstation.
This repository uses pnpm's hoisted node linker to shorten native dependency paths. The previous isolated layout caused CMake object-path warnings and Ninja's `manifest 'build.ninja' still dirty after 100 tries` error on Windows. After switching an existing checkout to this layout, reinstall dependencies and clear only generated native build caches that still reference the previous dependency paths. Keep the lockfile and application source. Do not modify dependency source files to suppress the warnings.
## Checks ## Checks
```sh ```sh
pnpm typecheck pnpm typecheck
pnpm test pnpm test
pnpm build pnpm build
pnpm doctor pnpm run doctor
``` ```
Build exports Metro bundles for iOS and Android; it does not compile an IPA/APK or replace Xcode/Gradle and real-device verification. The separate delivery-app-web repository owns the PWA. EXPO_PUBLIC_ values are public and baked into the bundle. Use only an HTTPS API URL; loopback and Android-emulator HTTP are allowed in development builds. No SSO client secret or provider token belongs here. Build exports Metro bundles for iOS and Android; it does not compile an IPA/APK or replace Xcode/Gradle and real-device verification. The separate delivery-app-web repository owns the PWA. EXPO_PUBLIC_ values are public and baked into the bundle. Use only an HTTPS API URL; loopback and Android-emulator HTTP are allowed in development builds. No SSO client secret or provider token belongs here.
Windows verification (2026-09-09): the x86_64 debug APK compiled successfully with JDK 21 and the hoisted dependency layout, installed on the API 36 emulator, and displayed the branded Hebrew welcome/connection screen. Typechecking, all 3 configuration tests and iOS/Android Metro exports passed. Expo doctor passed 20/21 checks; its remaining check recommends the newly available Expo 57.0.21 and expo-glass-effect 57.0.2 patches over the currently locked 57.0.20/57.0.1 versions. iOS native compilation and operational mobile SSO/offline workflows remain separate work.
[Repository map](docs/repositories.md). Expo starter attribution is retained in docs/expo-template-license.txt. [Repository map](docs/repositories.md). Expo starter attribution is retained in docs/expo-template-license.txt.
+1 -2
View File
@@ -11,7 +11,6 @@
}, },
"include": [ "include": [
"**/*.ts", "**/*.ts",
"**/*.tsx", "**/*.tsx"
".expo/types/**/*.ts"
] ]
} }