File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 11// Inject core-splashscreen dependency to fix Android resource linking errors for Theme.SplashScreen
22// This runs during EAS prebuild and modifies android/app/build.gradle
3- const { withAppBuildGradle, createRunOncePlugin, WarningAggregator } = require ( '@expo/config-plugins' ) ;
3+ const {
4+ withAppBuildGradle,
5+ createRunOncePlugin,
6+ WarningAggregator,
7+ } = require ( "@expo/config-plugins" ) ;
48
59const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")' ;
610
711function ensureDependency ( contents ) {
812 if ( contents . includes ( DEP_LINE ) ) return contents ; // already present
9- return contents . replace ( / d e p e n d e n c i e s \s * \{ / m, ( match ) => `${ match } \n ${ DEP_LINE } ` ) ;
13+ return contents . replace (
14+ / d e p e n d e n c i e s \s * \{ / m,
15+ ( match ) => `${ match } \n ${ DEP_LINE } ` ,
16+ ) ;
1017}
1118
1219const withCoreSplashscreenDependency = ( config ) =>
@@ -15,16 +22,16 @@ const withCoreSplashscreenDependency = (config) =>
1522 config . modResults . contents = ensureDependency ( config . modResults . contents ) ;
1623 } catch ( e ) {
1724 WarningAggregator . addWarningAndroid (
18- ' core-splashscreen' ,
19- `Failed to add androidx.core:core-splashscreen dependency: ${ e ?. message ?? e } `
25+ " core-splashscreen" ,
26+ `Failed to add androidx.core:core-splashscreen dependency: ${ e ?. message ?? e } ` ,
2027 ) ;
2128 }
2229 return config ;
2330 } ) ;
2431
25- // module exp
32+ // module exp
2633module . exports = createRunOncePlugin (
2734 withCoreSplashscreenDependency ,
28- ' with-core-splashscreen-dependency' ,
29- ' 1.0.0'
35+ " with-core-splashscreen-dependency" ,
36+ " 1.0.0" ,
3037) ;
You can’t perform that action at this time.
0 commit comments