Skip to content

Commit dd20bdc

Browse files
docs: update android, llm instrx
1 parent 82a20d3 commit dd20bdc

2 files changed

Lines changed: 116 additions & 6 deletions

File tree

CLAUDE.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ Tables:
165165
- Rust targets installed (`aarch64-linux-android`, `armv7-linux-androideabi`, `i686-linux-android`, `x86_64-linux-android`)
166166
- Android project initialized at `src-tauri/gen/android/`
167167
- Fastlane configured with build, beta, and release lanes
168-
- Package name: `com.lunch.desktop`
168+
- Application ID: `com.lunch.app` (used for install/uninstall)
169+
- Namespace: `com.lunch.desktop` (used for class paths)
169170
- Required environment variables (add to `~/.bash_profile`):
170171
```bash
171172
# Java
@@ -187,6 +188,58 @@ Tables:
187188
- Android: Test on emulator: `task android:dev`
188189
- Android: Test on device: `task android:run:device` (builds release APK, signs with debug key, installs)
189190

191+
## Android Emulator Troubleshooting
192+
193+
### "Failed to request http://..." error (devUrl cached)
194+
195+
If the app shows "Failed to request http://X.X.X.X:1430/" on startup, the Rust build cache has a stale dev server URL baked in. Clean and rebuild:
196+
197+
```bash
198+
# Clean Rust Android targets and Gradle cache
199+
rm -rf src-tauri/target/aarch64-linux-android \
200+
src-tauri/target/armv7-linux-androideabi \
201+
src-tauri/target/i686-linux-android \
202+
src-tauri/target/x86_64-linux-android \
203+
src-tauri/gen/android/app/build \
204+
src-tauri/gen/android/.gradle
205+
206+
# Uninstall old app from emulator
207+
adb -s emulator-5554 uninstall com.lunch.app
208+
209+
# Rebuild
210+
task android:run:emulator
211+
```
212+
213+
### Signature mismatch error (INSTALL_FAILED_UPDATE_INCOMPATIBLE)
214+
215+
If install fails with signature mismatch, uninstall the existing app first:
216+
217+
```bash
218+
adb -s emulator-5554 uninstall com.lunch.app
219+
```
220+
221+
### Black screen / GPU errors (EmulatedEglImage)
222+
223+
If emulator shows black screen with `Failed to find EmulatedEglImage` errors, fix the GPU config:
224+
225+
```bash
226+
# Fix emulator GPU settings
227+
cd ~/.android/avd/pixel_7.avd
228+
sed -i '' 's/hw.gpu.enabled = no/hw.gpu.enabled = yes/' config.ini
229+
sed -i '' 's/hw.gpu.mode = auto/hw.gpu.mode = host/' config.ini
230+
231+
# Remove corrupted snapshot
232+
rm -rf snapshots/default_boot
233+
```
234+
235+
### Full Android clean (nuclear option)
236+
237+
```bash
238+
task android:clean
239+
rm -rf src-tauri/target/*-linux-android*
240+
adb -s emulator-5554 uninstall com.lunch.app
241+
```
242+
190243
## Context
191244

192245
Always use Context7 MCP when I need library/API documentation, code generation,

docs/android.md

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-andro
3535

3636
| Setting | Value |
3737
|---------|-------|
38-
| Package name | `com.lunch.app` |
38+
| Application ID | `com.lunch.app` (used for install/uninstall) |
39+
| Namespace | `com.lunch.desktop` (used for class paths) |
3940
| Min SDK | 24 (Android 7.0) |
4041
| Target SDK | 36 |
4142
| Build location | `src-tauri/gen/android/` |
@@ -198,6 +199,7 @@ All lanes automatically:
198199
| `task android:dev` | Run on emulator |
199200
| `task android:dev:device` | Run on device (hot-reload) |
200201
| `task android:run:device` | Build and install release APK on device |
202+
| `task android:run:emulator` | Build and install release APK on emulator |
201203
| `task android:build` | Build APK and AAB |
202204
| `task android:build:apk` | Build APK only |
203205
| `task android:build:aab` | Build signed AAB |
@@ -215,10 +217,13 @@ All lanes automatically:
215217

216218
| Type | Path |
217219
|------|------|
218-
| Unsigned APK | `src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk` |
220+
| Release APK (with keystore) | `src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk` |
221+
| Unsigned APK (no keystore) | `src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk` |
219222
| Signed APK (debug key) | `src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-signed.apk` |
220223
| Signed AAB | `src-tauri/gen/android/app/build/outputs/bundle/universalRelease/app-universal-release.aab` |
221224

225+
Note: If `keystore.properties` is configured, the build produces a signed `app-universal-release.apk`. Without a keystore, it produces `app-universal-release-unsigned.apk` which `task android:run:emulator` signs with the debug key.
226+
222227
---
223228

224229
## Troubleshooting
@@ -237,12 +242,64 @@ Run keyboard configuration:
237242
task android:emulator:setup
238243
```
239244

245+
### "Failed to request http://..." Error (devUrl Cached)
246+
247+
If the app shows "Failed to request http://X.X.X.X:1430/" on startup, the Rust build cache has a stale dev server URL baked in. Clean and rebuild:
248+
249+
```bash
250+
# Clean Rust Android targets and Gradle cache
251+
rm -rf src-tauri/target/aarch64-linux-android \
252+
src-tauri/target/armv7-linux-androideabi \
253+
src-tauri/target/i686-linux-android \
254+
src-tauri/target/x86_64-linux-android \
255+
src-tauri/gen/android/app/build \
256+
src-tauri/gen/android/.gradle
257+
258+
# Uninstall old app from emulator
259+
adb -s emulator-5554 uninstall com.lunch.app
260+
261+
# Rebuild
262+
task android:run:emulator
263+
```
264+
265+
### Signature Mismatch (INSTALL_FAILED_UPDATE_INCOMPATIBLE)
266+
267+
If install fails with signature mismatch, uninstall the existing app first:
268+
269+
```bash
270+
adb -s emulator-5554 uninstall com.lunch.app
271+
```
272+
273+
### Black Screen / GPU Errors (EmulatedEglImage)
274+
275+
If emulator shows black screen with `Failed to find EmulatedEglImage` errors, fix the GPU config:
276+
277+
```bash
278+
# Fix emulator GPU settings
279+
cd ~/.android/avd/pixel_7.avd
280+
sed -i '' 's/hw.gpu.enabled = no/hw.gpu.enabled = yes/' config.ini
281+
sed -i '' 's/hw.gpu.mode = auto/hw.gpu.mode = host/' config.ini
282+
283+
# Remove corrupted snapshot
284+
rm -rf snapshots/default_boot
285+
```
286+
287+
### Full Android Clean (Nuclear Option)
288+
289+
```bash
290+
task android:clean
291+
rm -rf src-tauri/target/*-linux-android*
292+
adb -s emulator-5554 uninstall com.lunch.app
293+
```
294+
240295
### Upload Fails with Package Name Mismatch
241296

242297
Verify package name is `com.lunch.app` in:
243-
- `src-tauri/gen/android/app/build.gradle.kts` (namespace and applicationId)
298+
- `src-tauri/gen/android/app/build.gradle.kts` (applicationId)
244299
- Google Play Console app settings
245300

301+
Note: The namespace (`com.lunch.desktop`) is different from the applicationId (`com.lunch.app`).
302+
246303
### Version Code Too Low
247304

248305
Fastlane uses timestamp-based version codes. If Play Console rejects the build, wait a second and rebuild - each build gets a unique version code.
@@ -255,8 +312,8 @@ Fastlane uses timestamp-based version codes. If Play Console rejects the build,
255312
src-tauri/gen/android/
256313
├── app/
257314
│ ├── build.gradle.kts # Package name, signing config
258-
│ ├── src/main/java/com/lunch/app/
259-
│ │ └── MainActivity.kt # Entry point
315+
│ ├── src/main/java/com/lunch/desktop/
316+
│ │ └── MainActivity.kt # Entry point (namespace: com.lunch.desktop)
260317
│ └── build/outputs/
261318
│ ├── apk/ # APK builds
262319
│ └── bundle/ # AAB builds

0 commit comments

Comments
 (0)