Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c43b913dde | |||
| 256b338ae3 | |||
| ec95406305 |
@@ -89,6 +89,17 @@ jobs:
|
|||||||
[ -n "$KEYSTORE_STORE_PASSWORD" ] && echo "KEYSTORE_STORE_PASSWORD: set" || echo "KEYSTORE_STORE_PASSWORD: EMPTY"
|
[ -n "$KEYSTORE_STORE_PASSWORD" ] && echo "KEYSTORE_STORE_PASSWORD: set" || echo "KEYSTORE_STORE_PASSWORD: EMPTY"
|
||||||
[ -n "$KEYSTORE_KEY_PASSWORD" ] && echo "KEYSTORE_KEY_PASSWORD: set" || echo "KEYSTORE_KEY_PASSWORD: EMPTY"
|
[ -n "$KEYSTORE_KEY_PASSWORD" ] && echo "KEYSTORE_KEY_PASSWORD: set" || echo "KEYSTORE_KEY_PASSWORD: EMPTY"
|
||||||
|
|
||||||
|
- name: Patch native modules for Android 15 16KB page size
|
||||||
|
run: |
|
||||||
|
WORKLETS="node_modules/react-native-worklets/android/CMakeLists.txt"
|
||||||
|
REANIMATED="node_modules/react-native-reanimated/android/CMakeLists.txt"
|
||||||
|
if [ -f "$WORKLETS" ] && ! grep -q "max-page-size" "$WORKLETS"; then
|
||||||
|
printf '\ntarget_link_options(worklets PRIVATE "-Wl,-z,max-page-size=16384")\n' >> "$WORKLETS"
|
||||||
|
fi
|
||||||
|
if [ -f "$REANIMATED" ] && ! grep -q "max-page-size" "$REANIMATED"; then
|
||||||
|
printf '\ntarget_link_options(reanimated PRIVATE "-Wl,-z,max-page-size=16384")\n' >> "$REANIMATED"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build signed APK
|
- name: Build signed APK
|
||||||
run: ./build-apk.sh
|
run: ./build-apk.sh
|
||||||
|
|
||||||
|
|||||||
+60
-1
@@ -1,13 +1,55 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect, useState, Component } from "react";
|
||||||
|
import type { ReactNode } from "react";
|
||||||
import { Stack, router } from "expo-router";
|
import { Stack, router } from "expo-router";
|
||||||
import { StatusBar } from "expo-status-bar";
|
import { StatusBar } from "expo-status-bar";
|
||||||
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
||||||
|
import { View, Text, ScrollView } from "react-native";
|
||||||
import "../global.css";
|
import "../global.css";
|
||||||
import { Colors } from "@/constants/theme";
|
import { Colors } from "@/constants/theme";
|
||||||
import { useSettings } from "@/hooks/useSettings";
|
import { useSettings } from "@/hooks/useSettings";
|
||||||
|
|
||||||
|
// Catch JS errors in release mode and show them on-screen instead of
|
||||||
|
// silently crashing to desktop. Remove once the crash is identified.
|
||||||
|
class CrashBoundary extends Component<
|
||||||
|
{ children: ReactNode },
|
||||||
|
{ error: Error | null }
|
||||||
|
> {
|
||||||
|
state = { error: null };
|
||||||
|
static getDerivedStateFromError(e: Error) {
|
||||||
|
return { error: e };
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
const { error } = this.state;
|
||||||
|
if (error) {
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, backgroundColor: "#0f1117", padding: 20, paddingTop: 60 }}>
|
||||||
|
<Text style={{ color: "#ef4444", fontSize: 16, fontWeight: "700", marginBottom: 12 }}>
|
||||||
|
CRASH — copie ce texte
|
||||||
|
</Text>
|
||||||
|
<ScrollView>
|
||||||
|
<Text style={{ color: "#fff", fontSize: 11, fontFamily: "monospace" }}>
|
||||||
|
{String(error)}{"\n\n"}{(error as any).stack}
|
||||||
|
</Text>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return this.props.children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
const { settings, ready } = useSettings();
|
const { settings, ready } = useSettings();
|
||||||
|
const [jsError, setJsError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const prev = (ErrorUtils as any).getGlobalHandler();
|
||||||
|
(ErrorUtils as any).setGlobalHandler((e: Error, isFatal: boolean) => {
|
||||||
|
if (isFatal) setJsError(`${String(e)}\n\n${(e as any).stack ?? ""}`);
|
||||||
|
prev?.(e, isFatal);
|
||||||
|
});
|
||||||
|
return () => (ErrorUtils as any).setGlobalHandler(prev);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!ready) return;
|
if (!ready) return;
|
||||||
@@ -16,7 +58,23 @@ export default function RootLayout() {
|
|||||||
}
|
}
|
||||||
}, [ready, settings.onboardingDone]);
|
}, [ready, settings.onboardingDone]);
|
||||||
|
|
||||||
|
if (jsError) {
|
||||||
return (
|
return (
|
||||||
|
<View style={{ flex: 1, backgroundColor: "#0f1117", padding: 20, paddingTop: 60 }}>
|
||||||
|
<Text style={{ color: "#ef4444", fontSize: 16, fontWeight: "700", marginBottom: 12 }}>
|
||||||
|
FATAL JS ERROR — copie ce texte
|
||||||
|
</Text>
|
||||||
|
<ScrollView>
|
||||||
|
<Text style={{ color: "#fff", fontSize: 11, fontFamily: "monospace" }}>
|
||||||
|
{jsError}
|
||||||
|
</Text>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<CrashBoundary>
|
||||||
<GestureHandlerRootView style={{ flex: 1, backgroundColor: Colors.bg }}>
|
<GestureHandlerRootView style={{ flex: 1, backgroundColor: Colors.bg }}>
|
||||||
<StatusBar style="light" />
|
<StatusBar style="light" />
|
||||||
<Stack
|
<Stack
|
||||||
@@ -35,5 +93,6 @@ export default function RootLayout() {
|
|||||||
<Stack.Screen name="onboarding" options={{ headerShown: false }} />
|
<Stack.Screen name="onboarding" options={{ headerShown: false }} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</GestureHandlerRootView>
|
</GestureHandlerRootView>
|
||||||
|
</CrashBoundary>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,6 +77,32 @@ info "Running expo prebuild (Android)…"
|
|||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
npx expo prebuild --platform android --clean --no-install
|
npx expo prebuild --platform android --clean --no-install
|
||||||
|
|
||||||
|
# ─── 4.5. Patch native modules — 16KB page size (Android 15) ──────────────
|
||||||
|
info "Patching native modules for 16KB page size support (Android 15)…"
|
||||||
|
|
||||||
|
WORKLETS_CMAKE="$SCRIPT_DIR/node_modules/react-native-worklets/android/CMakeLists.txt"
|
||||||
|
REANIMATED_CMAKE="$SCRIPT_DIR/node_modules/react-native-reanimated/android/CMakeLists.txt"
|
||||||
|
|
||||||
|
if [ -f "$WORKLETS_CMAKE" ] && ! grep -q "max-page-size" "$WORKLETS_CMAKE"; then
|
||||||
|
printf '\ntarget_link_options(worklets PRIVATE "-Wl,-z,max-page-size=16384")\n' >> "$WORKLETS_CMAKE"
|
||||||
|
info "Patched react-native-worklets for 16KB pages"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$REANIMATED_CMAKE" ] && ! grep -q "max-page-size" "$REANIMATED_CMAKE"; then
|
||||||
|
printf '\ntarget_link_options(reanimated PRIVATE "-Wl,-z,max-page-size=16384")\n' >> "$REANIMATED_CMAKE"
|
||||||
|
info "Patched react-native-reanimated for 16KB pages"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ─── 4.6. Disable New Architecture (Android 15 compat) ────────────────────
|
||||||
|
GRADLE_PROPS_NEWARCH="$SCRIPT_DIR/android/gradle.properties"
|
||||||
|
if [ -f "$GRADLE_PROPS_NEWARCH" ]; then
|
||||||
|
sed -i 's/^newArchEnabled=true/newArchEnabled=false/' "$GRADLE_PROPS_NEWARCH"
|
||||||
|
if ! grep -q "^newArchEnabled=" "$GRADLE_PROPS_NEWARCH"; then
|
||||||
|
echo "newArchEnabled=false" >> "$GRADLE_PROPS_NEWARCH"
|
||||||
|
fi
|
||||||
|
info "New Architecture disabled in gradle.properties"
|
||||||
|
fi
|
||||||
|
|
||||||
# ─── 5. Patch build.gradle — inject release signingConfig ──────────────────
|
# ─── 5. Patch build.gradle — inject release signingConfig ──────────────────
|
||||||
info "Patching android/app/build.gradle for release signing…"
|
info "Patching android/app/build.gradle for release signing…"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// Exclude native build for packages not used in this project.
|
||||||
|
// react-native-gesture-handler detects their absence and falls back to its
|
||||||
|
// noreanimated codepath, so GestureHandlerRootView continues to work.
|
||||||
|
module.exports = {
|
||||||
|
dependencies: {
|
||||||
|
'react-native-reanimated': {
|
||||||
|
platforms: { android: null },
|
||||||
|
},
|
||||||
|
'react-native-worklets': {
|
||||||
|
platforms: { android: null },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user