Skip to content

Socket connection timed out.. (Crashlytics issue with nativescript-plugin-firebase) #4138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NickIliev opened this issue Nov 14, 2018 · 10 comments

Comments

@NickIliev
Copy link
Contributor

@alereisan commented on Fri Nov 09 2018

Environment
tns info: output
image

Describe the bug
image
I cannot run my app.

Error detected during LiveSync on emulator-5554 for /Users/iamacpro2018/Documents/nativescript/tns-yoojis-kies. Error: Socket connection timed out.

I tried to start it from the CLI, from Sidekick, on an Android Emulator, on 2 different Android Devices. I deleted the project folder and re-cloned the github repository.

I followed all the inputs from related errors on Github, Slack and Stackoverflow.

I wrote a cleanup script (which worked for one day):

sudo chmod -R 777 .
npm cache clean --force
echo "Starting Nativescript cleanup..."
echo "removing node_modules folder..."
rm -rf node_modules/ 
echo "removing platforms folder..."
rm -rf platforms/ 
echo "removing package-lock.json file..."
rm -rf package-lock.json 
echo "removing hooks folder..."
rm -rf hooks/
npm i
echo "Nativescript cleanup successfull!"
echo "Configuring TypeScript for NativeScript..."
./node_modules/.bin/ns-upgrade-tsconfig
echo "Configuring Webpack for NativeScript..."
./node_modules/.bin/update-ns-webpack --deps --configs
echo "Configuring Angular dependencies for NativeScript..."
./node_modules/.bin/update-app-ng-deps
echo "Running npm install..."
npm install
echo "npm install done!"
echo "Starting Android Build..."
tns build android
echo "Android build successfull!"

The "Socket connection timed out..." error persists.

(If I start a new project in Sidekick, the new project runs)

Sample project
as this is a private repository, please tell me whom i should add as a collaborator

tns doctor output:
image

package.json:

{
  "nativescript": {
    "id": "ch.inaffect.yoojis.kies",
    "tns-ios": {
      "version": "5.0.0"
    },
    "tns-android": {
      "version": "5.0.0"
    }
  },
  "description": "Android App for Yooji's KIES consoles",
  "license": "-",
  "repository": "https://github.com/inaffect-ag/tns-yoojis-kies",
  "scripts": {
    "lint": "tslint \"app/**/*.ts\""
  },
  "dependencies": {
    "@angular/animations": "~6.1.0",
    "@angular/common": "~6.1.0",
    "@angular/compiler": "~6.1.0",
    "@angular/core": "~6.1.0",
    "@angular/forms": "~6.1.0",
    "@angular/http": "~6.1.0",
    "@angular/platform-browser": "~6.1.0",
    "@angular/platform-browser-dynamic": "~6.1.0",
    "@angular/router": "~6.1.0",
    "@ngx-translate/core": "^10.0.2",
    "@ngx-translate/http-loader": "^3.0.1",
    "moment": "^2.22.2",
    "nativescript-angular": "^6.2.0",
    "nativescript-permissions": "^1.2.3",
    "nativescript-plugin-firebase": "^7.3.0",
    "nativescript-ripple": "2.1.0",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-listview": "3.7.2",
    "nativescript-ui-sidedrawer": "~4.2.0",
    "reflect-metadata": "~0.1.10",
    "rxjs": "^6.0.0",
    "tns-core-modules": "^5.0.2",
    "tns-platform-declarations": "^4.2.1",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~6.1.0",
    "@ngtools/webpack": "~6.2.0",
    "codelyzer": "~4.3.0",
    "nativescript-dev-sass": "~1.6.0",
    "nativescript-dev-typescript": "^0.7.4",
    "nativescript-dev-webpack": "^0.17.0",
    "tslint": "~5.11.0",
    "typescript": "~2.7.2"
  },
  "readme": "NativeScript Application"
}

Here is the log output while running: tns run android --log trace
https://gist.github.com/alereisan/cdd27d6ea6df48f6879957251d97f2ab


@NickIliev commented on Wed Nov 14 2018

@alereisan the issue might be caused by an error in the code that prevents the compiling. Or for a number of other reasons. Closing as duplicate to #4029


@djokone commented on Tue Nov 13 2018

@alereisan, I've had the same problem, and it was the Firebase crashlytics plugin who's not compatible with the Android Runtime 5.0. Try to take it off.

in your firebase.nativescript.json :
...
"crashlytics": false,
...

rm -rf nodes_modules
npm i


@alereisan commented on Tue Nov 13 2018

@djokone Yes thanks, I figured out yesterday that it was related with firebase and I completely disabled firebase for now.

@NickIliev
Copy link
Contributor Author

NickIliev commented Nov 15, 2018

+1 Reported via t.1360938 (UMediaGroup)

Description of the issue in detailes : EddyVerbruggen/nativescript-plugin-firebase#1023

@NickIliev
Copy link
Contributor Author

Details on how to reproduce the issue:
The application is crashing when the Crashlytics library is added via nativescript-plugin-firebase- application demonstrating the issue can be found here.

  • clone the demo repo or create a new project and install native script-plugin-firebase
  • build the app with Crashlytics enabled (in firebase.nativescript.json set to true)
  • the app is building successfully but is failing runtime with a security freeze. The app is crashing with the following in logcat
11-15 02:29:29.810: E/IconLoader(2580): Could not find icon drawable from resource
11-15 02:29:29.810: E/IconLoader(2580): android.content.res.Resources$NotFoundException: Resource ID #0xffffffff
11-15 02:29:29.810: E/IconLoader(2580): 	at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:225)
11-15 02:29:29.810: E/IconLoader(2580): 	at android.content.res.Resources.getDrawableForDensity(Resources.java:887)
11-15 02:29:29.810: E/IconLoader(2580): 	at android.content.res.Resources.getDrawable(Resources.java:827)
11-15 02:40:48.088: E/IconLoader(2580): Could not find icon drawable from resource
11-15 02:40:48.088: E/IconLoader(2580): android.content.res.Resources$NotFoundException: Resource ID #0xffffffff
11-15 02:40:48.088: E/IconLoader(2580): 	at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:225)
11-15 02:40:48.088: E/IconLoader(2580): 	at android.content.res.Resources.getDrawableForDensity(Resources.java:887)
11-15 02:40:48.088: E/IconLoader(2580): 	at android.content.res.Resources.getDrawable(Resources.java:827)
11-15 02:40:48.670: E/IconLoader(2580): Could not find icon drawable from resource
11-15 02:40:48.670: E/IconLoader(2580): android.content.res.Resources$NotFoundException: Resource ID #0xffffffff
11-15 02:40:48.670: E/IconLoader(2580): 	at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:225)
11-15 02:40:48.670: E/IconLoader(2580): 	at android.content.res.Resources.getDrawableForDensity(Resources.java:887)
11-15 02:40:48.670: E/IconLoader(2580): 	at android.content.res.Resources.getDrawable(Resources.java:827)

@NickIliev
Copy link
Contributor Author

The issue is resolved via EddyVerbruggen/nativescript-plugin-firebase#1023

@kunjee17
Copy link

kunjee17 commented Dec 5, 2018

Hi, Can any one confirm that it is resolved for Windows as well. Because I was able to make it work on Mac but on Windows machine it is still giving that issue. Either this issue or Gradle just going into loop while compiling it.

Let me know what details will be required. Because stack trace is showing same this pointed in above comments. Running latest SDK (28.0.3) and Tns (5) also latest plugin as well. There is a google map plugin installed along side other plugins, just in case if that is causing the issue.

I am not reopening the issue. But let me know if filing a new issue or reopening this issue is required.

@NickIliev
Copy link
Contributor Author

NickIliev commented Dec 6, 2018

@kunjee17 I've tested the scenario with this app (building on Windows with several Firebase options including Ctrashlytics) and everything works as expected.

Can you post the content of your package.json and also the error log (if the whole log post it as a txt file)

Update: added nativescript-google-maps-sdk plugin in the same test project and again I am able to build with no hassle

@kunjee17
Copy link

kunjee17 commented Dec 6, 2018

@NickIliev sure thing I ll do that.

@kunjee17
Copy link

kunjee17 commented Dec 8, 2018

Hi, @NickIliev
Here is my package.json

"dependencies": {
    "@angular/animations": "~7.1.1",
    "@angular/common": "~7.1.1",
    "@angular/compiler": "~7.1.1",
    "@angular/core": "~7.1.1",
    "@angular/forms": "~7.1.1",
    "@angular/http": "~7.1.1",
    "@angular/platform-browser": "~7.1.1",
    "@angular/platform-browser-dynamic": "~7.1.1",
    "@angular/router": "~7.1.1",
    "faker": "^4.1.0",
    "moment": "^2.22.2",
    "nativescript-angular": "^7.0.2",
    "nativescript-camera": "^4.1.1",
    "nativescript-feedback": "^1.3.1",
    "nativescript-geolocation": "^4.3.1",
    "nativescript-google-maps-sdk": "^2.6.1",
    "nativescript-imagepicker": "^6.0.5",
    "nativescript-local-notifications": "^3.1.0",
    "nativescript-numeric-keyboard": "^4.2.0",
    "nativescript-phone": "^1.4.0",
    "nativescript-plugin-firebase": "^7.4.3",
    "nativescript-social-share": "^1.5.1",
    "nativescript-theme-core": "^1.0.4",
    "nativescript-ui-autocomplete": "^3.10.3",
    "nativescript-ui-calendar": "^3.9.1",
    "nativescript-ui-chart": "^3.10.0",
    "nativescript-ui-dataform": "^3.9.0",
    "nativescript-ui-listview": "^5.0.0",
    "nativescript-ui-sidedrawer": "^5.0.0",
    "nativescript-unit-test-runner": "^0.3.4",
    "nativescript-videoplayer": "^4.2.1",
    "reflect-metadata": "~0.1.10",
    "rxjs": "~6.3.3",
    "tns-core-modules": "^5.0.5",
    "validator": "^10.9.0",
    "zone.js": "~0.8.18"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~7.1.1",
    "@nativescript/schematics": "^0.3.4",
    "@ngtools/webpack": "^6.2.8",
    "@types/chai": "^4.1.7",
    "@types/lodash": "^4.14.119",
    "@types/mocha": "^5.2.5",
    "@types/validator": "^9.4.3",
    "chai": "4.2.0",
    "codelyzer": "~4.3.0",
    "fs-extra": "^7.0.1",
    "karma": "3.1.3",
    "karma-chai": "0.1.0",
    "karma-mocha": "1.3.0",
    "karma-nativescript-launcher": "0.4.0",
    "mocha": "5.2.0",
    "nativescript-dev-sass": "~1.6.0",
    "nativescript-dev-typescript": "^0.7.8",
    "nativescript-dev-webpack": "^0.16.3",
    "tslint": "~5.11.0",
    "typescript": "~3.1.6"
  }

I am running with command tns run android --buldle --log trace. So, if you want any more details from log then let me know. Below is the part when error occurs.

Unable to apply changes on device: 50a4ecf1. Error is: Socket connection timed out..
Will emit event liveSyncError with data { error:
   Error: Socket connection timed out.
       at Timeout.setTimeout [as _onTimeout] (..\node_modules\nativescript\lib\services\livesync\android-livesync-tool.js:267:46)
       at ontimeout (timers.js:436:11)
       at tryOnTimeout (timers.js:300:5)
       at listOnTimeout (timers.js:263:5)
       at Timer.processTimers (timers.js:223:10),
  deviceIdentifier: '50a4ecf1',
  projectDir: 'D:\\app\\app',
  applicationIdentifier: 'in.app.app' }

I can't get any other dump. Other things seems to be working fine as per logs.

@Kraften
Copy link

Kraften commented Apr 2, 2019

I'm getting the same error msg after installing the nativescript-fabric plugin. I do not have the firebase plugin installed. Is there any fix for this?

@Kraften
Copy link

Kraften commented Apr 24, 2019

Nothing new?

@rosen-vladimirov
Copy link
Contributor

Hey @Kraften ,
This issue is quite old and I'm going to lock it from further comments as the information in it is not enough to get the desired output. Can you please open a new issue and provide all the required information in the issue template. This way we'll be able to provide better help.

@NativeScript NativeScript locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants