1

I'm trying to run a React Native project on my Android phone and it's giving me this problem when I run 'npx react-native run-android'. But it works normally if I use an Android Studio simulator:

08:57:53 V/ddms: execute: running am get-config
08:57:53 V/ddms: execute 'am get-config' on '2b704600a21c7ece' : EOF hit. Read: -1
08:57:53 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'SM-G9650 - 10' for app:debug
08:57:53 D/app-debug.apk: Uploading app-debug.apk onto device '2b704600a21c7ece'
08:57:53 D/Device: Uploading file onto device '2b704600a21c7ece'
08:57:53 D/ddms: Reading file permision of /home/thadeucesario/Documents/Thadeu/Code/ReactNative/mobile/android/app/build/outputs/apk/debug/app-debug.apk as: rw-rw-r--
08:57:54 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
08:57:57 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '2b704600a21c7ece' : EOF hit. Read: -1
08:57:57 V/ddms: execute: returning

> Task :app:installDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 2 executed, 25 up-to-date
Unable to install /home/thadeucesario/Documents/Thadeu/Code/ReactNative/mobile/android/app/build/outputs/apk/debug/app-debug.apk
com.android.ddmlib.InstallException: Unknown failure: Exception occurred while executing:
android.os.ParcelableException: java.io.IOException: Requested internal only, but not enough space
at android.util.ExceptionUtils.wrap(ExceptionUtils.java:34)
at com.android.server.pm.PackageInstallerService.createSession(PackageInstallerService.java:562)
at com.android.server.pm.PackageManagerShellCommand.doCreateSession(PackageManagerShellCommand.java:2700)
at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1061)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:169)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:26690)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:5433)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:5012)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
Caused by: java.io.IOException: Requested internal only, but not enough space
at com.android.internal.content.PackageHelper.resolveInstallVolume(PackageHelper.java:531)
at com.android.internal.content.PackageHelper.resolveInstallVolume(PackageHelper.java:447)
at com.android.internal.content.PackageHelper.resolveInstallVolume(PackageHelper.java:462)
at com.android.server.pm.PackageInstallerService.createSessionInternal(PackageInstallerService.java:742)
at com.android.server.pm.PackageInstallerService.createSession(PackageInstallerService.java:560)
... 11 more

Can someone help me?

Thanks

  • 2
    Perhaps this will help you: https://stackoverflow.com/questions/54461288/installation-failed-with-message-error-android-os-parcelableexception-java-io. It looks like your device has no storage space left. – Nicolas Jul 16 '20 at 00:13

2 Answers2

3

At the 6th last line of your terminal Caused by: java.io.IOException: Requested internal only, but not enough space . This is basically happens when you don't have enough space in your physical device to install and run the app.

Make sure you have developer mode on with debugger turned on , and you have enough space left on your physical android device. Try checking all attached devices by using adb devices (you must install adb first if you don't have). Then forcefully close the simulator or in case for windows or linux emulator .

Then run npx react-native run-android

I think this is going to work perfectly for you.

TripleM
  • 1,096
  • 7
  • 20
  • 1
    This got me on the right track. If another else has issues, I had to create a new virtual device for this to work. The strange part is the new virtual device had the same configuration as the virtual device that was causing these errors. – jjjjjenkins Sep 27 '20 at 06:10
1

Try to open the android path with Android Studio and build with it, probaly the console will show where is the error.

With Android Studio you can also go to:

File > Ivalidate Caches/Restart...

And click at Invalidate and Restart. After that try to run your project agai with:

npx react-native run-android