File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 99const DEP_LINE = 'implementation("androidx.core:core-splashscreen:1.0.1")' ;
1010
1111function ensureDependency ( contents ) {
12+ // If gradle file isn't available during introspection, just return as-is.
13+ if ( typeof contents !== "string" ) return contents ;
1214 if ( contents . includes ( DEP_LINE ) ) return contents ; // already present
1315 return contents . replace (
1416 / d e p e n d e n c i e s \s * \{ / m,
@@ -19,7 +21,16 @@ function ensureDependency(contents) {
1921const withCoreSplashscreenDependency = ( config ) =>
2022 withAppBuildGradle ( config , ( config ) => {
2123 try {
22- config . modResults . contents = ensureDependency ( config . modResults . contents ) ;
24+ const updated = ensureDependency ( config . modResults ?. contents ) ;
25+ if ( typeof updated === "string" ) {
26+ config . modResults . contents = updated ;
27+ } else {
28+ // During introspection (e.g., EAS Read app config) the file may not exist yet.
29+ WarningAggregator . addWarningAndroid (
30+ "core-splashscreen" ,
31+ "Skipped adding androidx.core:core-splashscreen; app/build.gradle not available during introspection." ,
32+ ) ;
33+ }
2334 } catch ( e ) {
2435 WarningAggregator . addWarningAndroid (
2536 "core-splashscreen" ,
You can’t perform that action at this time.
0 commit comments