Skip to content

Commit 9ab989c

Browse files
committed
fix android example
1 parent 9bd13af commit 9ab989c

File tree

24 files changed

+2208
-97
lines changed

24 files changed

+2208
-97
lines changed

bun.lockb

-73.3 KB
Binary file not shown.

examples/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,19 @@ That's it! Now you can commit changes and create a PR.
192192
#### Expo
193193

194194
To update `expo` example you should follow this [guide](https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough).
195+
After re-building the native project you should ensure that top of `android/settings.gradle` file looks like this:
196+
197+
```gradle
198+
pluginManagement {
199+
includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().toString())
200+
}
201+
```
202+
203+
Otherwise, you will get an error like this:
204+
205+
```bash
206+
FAILURE: Build failed with an exception.
207+
208+
What went wrong:
209+
Included build (...)/react-native-video/examples/expo/node_modules/react-native/node_modules/@react-native/gradle-plugin has build path :gradle-plugin which is the same as included build (...)/react-native-video/node_modules/@react-native/gradle-plugin
210+
```

examples/bare/metro.config.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@ module.exports = makeMetroConfig({
2020
resolver: {
2121
// We need to make sure that only one version is loaded for peerDependencies
2222
// So we block them at the root, and alias them to the versions in example's node_modules
23-
resolver: {
24-
blacklistRE: exclusionList(
25-
modules.map(
26-
(m) =>
27-
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
28-
),
23+
blacklistRE: exclusionList(
24+
modules.map(
25+
(m) =>
26+
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
2927
),
28+
),
3029

31-
extraNodeModules: modules.reduce((acc, name) => {
32-
acc[name] = path.join(__dirname, 'node_modules', name);
33-
return acc;
34-
}, {}),
35-
},
30+
extraNodeModules: modules.reduce((acc, name) => {
31+
acc[name] = path.join(__dirname, 'node_modules', name);
32+
return acc;
33+
}, {}),
3634
},
3735
watchFolders: [root],
3836
});

examples/expo/.gitignore

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
14
node_modules/
5+
6+
# Expo
27
.expo/
38
dist/
4-
npm-debug.*
9+
web-build/
10+
expo-env.d.ts
11+
12+
# Native
13+
*.orig.*
514
*.jks
615
*.p8
716
*.p12
817
*.key
918
*.mobileprovision
10-
*.orig.*
11-
web-build/
19+
20+
# Metro
21+
.metro-health-check*
22+
23+
# debug
24+
npm-debug.*
25+
yarn-debug.*
26+
yarn-error.*
1227

1328
# macOS
1429
.DS_Store
30+
*.pem
31+
32+
# local env files
33+
.env*.local
34+
35+
# typescript
36+
*.tsbuildinfo
37+
38+
app-example
13.7 KB
Loading
7.96 KB
Loading
20 KB
Loading
34.2 KB
Loading
49.3 KB
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<resources>
22
<string name="app_name">ExpoExample</string>
3+
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
4+
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
35
</resources>

0 commit comments

Comments
 (0)