nativescript-cli: Unable to apply changes on device: xxxxxxxxxxxxxx Error is: Socket connection timed out..
Environment No issues were detected. ✔ Your ANDROID_HOME environment variable is set and points to correct directory. ✔ Your adb from the Android SDK is correctly installed. ✔ The Android SDK is installed. ✔ A compatible Android SDK for compilation is found. ✔ Javac is installed and is configured properly. ✔ The Java Development Kit (JDK) is installed and is configured properly. ✔ Xcode is installed and is configured properly. ✔ xcodeproj is installed and is configured properly. ✔ CocoaPods are installed. ✔ CocoaPods update is not required. ✔ CocoaPods are configured properly. ✔ Your current CocoaPods version is newer than 1.0.0. ✔ Python installed and configured correctly. ✔ The Python ‘six’ package is found. ✔ Xcode version 9.4.1 satisfies minimum required version 9. ✔ Getting NativeScript components versions information… ✔ Component nativescript has 5.0.0-2018-10-12-12481 version and is up to date. ✔ Component tns-core-modules has 4.2.1 version and is up to date. ✔ Component tns-android has 4.2.0 version and is up to date. ✔ Component tns-ios has 4.2.0 version and is up to date.
Describe the bug When I run my apps I started to get
` Project successfully built.
Installing on device 192.168.57.101:5555...
Successfully installed on device with identifier '192.168.57.101:5555'.
Unable to apply changes on device: 192.168.57.101:5555. Error is: Socket connection timed out..`
I deleted the platforms, hooks, package-lock.json and node modules folders and when I re-run the app it is not even opening. Then I upgraded to next CLI and faced the same issue. The problem started when Google Mobile SDK version 17.0.0 was released last week.
In order to test, I created a blank project and ran with an emulator. It worked fine, then I only ran tns plugin add nativescript-admob command and when I debug without adding anything to code, the app failed with Unable to apply changes on device: 192.168.57.101:5555. Error is: Socket connection timed out…`output. The app doesn’t open and you can’t delete it. You have to uninstall the app from settings. So I believe that there must be some kind of problem with the latest release of Google Mobile SDK version 17.0.0 and admob plugin. Any help is appreciated.
To Reproduce
Expected behavior
Sample project
Additional context
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 15 (2 by maintainers)
Commits related to this issue
- Updated per https://github.com/NativeScript/nativescript-cli/issues/4029#issuecomment-430192531 — committed to skopekreep/nativescript-admob by skopekreep 6 years ago
- Updated per https://github.com/NativeScript/nativescript-cli/issues/4029#issuecomment-430192531 — committed to skopekreep/nativescript-admob by skopekreep 6 years ago
- Merge branch 'sdk17_fix' of https://github.com/skopekreep/nativescript-admob into sdk17_fix * 'sdk17_fix' of https://github.com/skopekreep/nativescript-admob: Updated per https://github.com/NativeS... — committed to skopekreep/nativescript-admob by skopekreep 6 years ago
- Updated per https://github.com/NativeScript/nativescript-cli/issues/4029#issuecomment-430192531 — committed to skopekreep/nativescript-admob by skopekreep 6 years ago
Then probably its due to some other issue, in my case I changed the app name in package.json file but forgot to change the same in
app/App_Resources/Android/app.gradle
file. That’s why I was getting this error. Please make sure you are not having the same issue.I also have this “Socket connection timed out…” Error since a few days. After upgrading my nativescript-angular app, to the latest versions, it worked for some hours. But now again, I cannot start my app: Error is: Socket connection timed out…
@alereisan,
If your app does not use
nativescript-admob
plugin, it is not related to this thread. So I’ll reopen your original issue - https://github.com/NativeScript/NativeScript/issues/6534.Socket connection timeout
error can happen when the app is not started on device for some reason. One possible reason could be if the application throws an exception on startup. To check if this is the case you can startlogcat
process and see if any error will be printed from your application.My app does not even use nativescript-admob 😦
Hey @szgozcan, @skopekreep,
Thank you for investigating the problem.
You’re absolute right that the problem is caused by Google Mobile Ads SDK version 17.0.0. Actually version 17.0.0 of Google Mobile Ads SDK requires
<meta-data>
tag inAndroidManifest.xml
. You can find more info here https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml.In order to successfully run your app on device using local builds, you need to change the following code inside
./node_modules/nativescript-admob/platforms/android/include.gradle
file.This way {N} CLI will fallback to version
16.0.0
of Google Mobile Ads SDK.In case you’re using cloud builds, you need to refer
nativescript-admob
plugin from local folder inside your project. (The plugin should contain the changes described above).We’re working on a fix that will be applied directly from plugin on install step. Meanwhile, you can use the described approach above.
Let me know if this works for you.