File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
platform-android/src/lib/commands/runAndroid
platform-apple-helpers/src/lib/utils Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @rnef/platform-apple-helpers ' : patch
3+ ' @rnef/platform-android ' : patch
4+ ---
5+
6+ fix: better errors when android install fails
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ export async function tryInstallAppOnDevice(
6565 `Installed the app on ${ device . readableName } (id: ${ deviceId } ).`
6666 ) ;
6767 } catch ( error ) {
68- const errorMessage = ( error as SubprocessError ) . stdout ;
68+ const errorMessage =
69+ ( error as SubprocessError ) . stderr || ( error as SubprocessError ) . stdout ;
6970 if ( errorMessage . includes ( 'INSTALL_FAILED_INSUFFICIENT_STORAGE' ) ) {
7071 try {
7172 loader . message ( 'Trying to install again due to insufficient storage' ) ;
@@ -81,14 +82,18 @@ export async function tryInstallAppOnDevice(
8182 `Failed: Uninstalling and installing the app on ${ device . readableName } (id: ${ deviceId } )` ,
8283 1
8384 ) ;
84- const errorMessage = ( error as SubprocessError ) . stdout ;
85- throw new RnefError ( errorMessage ) ;
85+ const errorMessage =
86+ ( error as SubprocessError ) . stderr ||
87+ ( error as SubprocessError ) . stdout ;
88+ throw new RnefError (
89+ `The "adb" command failed with: ${ errorMessage } . \nPlease uninstall the app manually and try again.`
90+ ) ;
8691 }
8792 }
8893 loader . stop (
8994 `Failed: Installing the app on ${ device . readableName } (id: ${ deviceId } )` ,
9095 1
9196 ) ;
92- throw new RnefError ( errorMessage ) ;
97+ throw new RnefError ( `The "adb" command failed with: ${ errorMessage } .` ) ;
9398 }
9499}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ async function runCodegen(options: CodegenOptions) {
3535 ] ) ;
3636 } catch ( error ) {
3737 throw new RnefError ( 'Failed to run React Native codegen script' , {
38- cause : ( error as SubprocessError ) . stdout ,
38+ cause : ( error as SubprocessError ) . output ,
3939 } ) ;
4040 }
4141}
You can’t perform that action at this time.
0 commit comments