nativescript-cli: Unable to apply changes on device: emulator-xxxx. Error is: Socket connection timed out..

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.1.2
  • Cross-platform modules: 6.1.1
  • Android Runtime: 6.1.1
  • iOS Runtime: 6.1.1
  • Plugin(s):
{
    "nativescript-bluetooth": "^1.3.1",
    "nativescript-carousel": "^6.1.0",
    "nativescript-datetimepicker": "^1.2.1",
    "nativescript-modal-datetimepicker": "^1.2.0",
    "nativescript-permissions": "^1.3.7",
    "nativescript-photoviewer": "^2.1.5",
    "nativescript-platform-css": "^1.6.8",
    "nativescript-social-share": "^1.5.2",
    "nativescript-socketio": "^3.2.1",
    "nativescript-svg": "^1.3.7",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-toasty": "^1.3.0",
    "nativescript-ui-listview": "^7.0.5",
    "nativescript-urlhandler": "^1.3.0",
    "nativescript-videoplayer": "^4.2.1",
    "nativescript-vue": "^2.0.0",
    "nativescript-vue-devtools": "^1.2.0",
    "nativescript-vue-shadow": "^0.1.0",
    "nativescript-youtubeplayer": "^3.0.1"
}

Describe the bug I am suddenly unable to run my app on Android devices. This error occurs both on a simulated device, and on physical devices.

The app is building OK, and it gets installed by ADB. I can even find it listed inside the Settings -> Apps & notificaitons -> See all xx apps menu.

However, the app icon does not appear in the launcher, and cannot be found through search.

The cli errors out like this:

Project successfully built.
The build result is located at: /Users/thomas/Development/myapp/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Installing on device emulator-5554...
Successfully installed on device with identifier 'emulator-5554'.
Unable to apply changes on device: emulator-5554. Error is: Socket connection timed out..

I have looked through related issues like #4138 #4902 #4029 but they was all resolved. In this case, I do not have Firebase or Crashlytics, or AdMob dependencies, and my devices have plenty of spare storage.

The app ID is also correct in both package.json and in the app.gradle file.

I have also attempted to manuelly uninstall the APK through ADB.

I have attempted to perform tns platform clean android

I am stuck. The app builds and launches fine on iOS.

To Reproduce I have not been able to find the root cause of this, and this I have no idea how to reproduce it.

Expected behavior The app should launch.

Additional context

I have the following native library as a dependency through app.gradle:

com.estimote:proximity-sdk:1.0.3

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Hey @aligit,

It seems the name of your application is default. Android doesn’t allow building applications called default as default is a Java keyword. You need to create an application with a different name.

I’m having this issue too, any update? Currently on Mac.

  "nativescript": {
    "id": "com.nativescript.examplename",
    "tns-ios": {
      "version": "6.3.0"
    },
    "tns-android": {
      "version": "6.3.1"
    }
  },

I tried tns platform remove android -> tns platform add android -> tns run android --bundle (my project is built via Nativescript-Vue)

Current error:

Project successfully built.
The build result is located at: /Users/USERNAME/Desktop/Projects/PROJECTNAME/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Installing on device emulator-5554...
Successfully installed on device with identifier 'emulator-5554'.
Unable to apply changes on device: emulator-5554. Error is: Socket connection timed out..

Hi @felix-idf and @loonatic , There is a fix for the nativescript-plugin-firebase on windows issue in the next version of android runtime. Until we release it officially you can give it a try executing tns platform add android@next

Hi @felix-idf and @loonatic , We were able to reproduce the issue you describe with latest android runtime and nativescript-plugin-firebase on windows. We are investigating it and will update you when we have more info.

@felix-idf I’m on a Windows machine indeed. Don’t own a Mac so can’t “validate” there.