question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

INSTALL_FAILED_INSUFFICIENT_STORAGE Execution failed for task ':app:installDebug'. React-native app on Android Emulator

See original GitHub issue

I am getting the following error when trying to run react-native run-android hooked to Pixel 2 XL (API 26) Emulator

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_INSUFFICIENT_STORAGE

Package.json

{
  "name": "ReactNativeApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.6.0-alpha.8af6728",
    "react-native": "^0.57.4",
    "react-native-animatable": "^1.3.0",
    "react-native-catch-first-time": "0.0.1",
    "react-native-device-info": "^0.24.3",
    "react-native-keyboard-aware-scroll-view": "^0.7.4",
    "react-native-maps": "^0.22.0",
    "react-native-push-notification": "^3.1.1",
    "react-native-splash-screen": "^3.1.1",
    "react-navigation": "^2.18.1"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.45.3",
    "react-test-renderer": "16.6.0-alpha.8af6728",
    "schedule": "^0.4.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Project level Build.gradle

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:3.2.1'
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
        maven { url 'https://maven.google.com' }
        jcenter()
        maven { url "$rootDir/../node_modules/react-native/android" }
        }
     }

    task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

App level Build.gradle

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.reactnativeapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile project(':react-native-device-info')
    compile project(':react-native-push-notification')
    compile project(':react-native-maps')
    compile project(':react-native-splash-screen')
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

Any help is appreciated!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

15reactions
alsemanycommented, Apr 12, 2019

INSTALL_FAILED_INSUFFICIENT_STORAGE I got this error also I thought this issue because there’s no space remaining and this was right I just resolved this by uninstalling some applications from the emulator to add free space

1reaction
shahmir811commented, Jun 17, 2019

Un-install old apps so that you can get some free space on emulator. Then run react-native run-android it will work perfectly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

INSTALL_FAILED_INSUFFICIEN...
I uninstalled it from the phone, and re-install the app (via the react-native run-android command) and it worked. Share.
Read more >
How to Fix "Install Failed Insufficient Storage" errors? - PSPDFKit
You can fix this issue easily by either of these steps: Uninstall previous apps installed on the emulator to make room for the...
Read more >
What react-native :app:installDebug FAILED ? - GeeksforGeeks
Hence it fails in installing the application. Follow the below steps to Fix this error: Step 1: Launch Android studio and open your...
Read more >
INSTALL_FAILED_INSUFFICIEN...
How to fix INSTALL_FAILED_INSUFFICIENT_STORAGE on Android emulators. Learn to fix this error and the reason for this error on this post.
Read more >
react native com.android.ddmlib.installexception
Learn Few Effective Solutions To Fix Android Emulator Installation Error – “Install Failed Insufficient Storage”! Overview: Are you getting installation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found