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):
{
"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
I run into the same issue.
Our app was working using tns-android 6.1.0. After running tns platform remove android and
tns platform add [email protected] tns platform add android@latest,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..
Creating a new project using the latest android runtime 6.1.2 works as expected.
We have the following plugins installed:
"@nstudio/nativescript-floatingactionbutton": "^1.1.0",
"@nstudio/nativescript-loading-indicator": "^1.0.0",
"@nstudio/nativescript-pulltorefresh": "^1.0.1",
"@nstudio/nativescript-snackbar": "^1.0.0",
"nativescript-globalevents": "^1.2.2",
"nativescript-iqkeyboardmanager": "^1.5.1",
"nativescript-pager": "^10.0.0",
"nativescript-permissions": "^1.3.6",
"nativescript-platform-css": "^1.6.9",
"nativescript-plugin-firebase": "^10.0.1",
"nativescript-toasty": "^2.0.1",
"nativescript-ui-listview": "^7.0.5",
"nativescript-ui-sidedrawer": "^7.0.1",
"nativescript-worker-loader": "^0.9.5",
"tns-core-modules": "^6.1.1"
I'm also having this issue on a physical device after upgrading from 5.4 to 6.1 with 6.1.2 android version.
Deleting platforms folder and manually downgrading package.json to 6.1.0 works but doesnt seem like a solution.
For me, the issue only occurs only on a Windows machine.
When building and running the Android app on a mac, everything works as expected.
@thomas-alrek @loonatic maybe you can confirm that?
@felix-idf I'm on a Windows machine indeed. Don't own a Mac so can't "validate" there.
Hi @thomas-alrek ,
We were not able to reproduce the issue on our side and we will need some additional info to be able to investigate. Can you please execute tns run android --log trace and send us the log. Also if it is possible send us sample project to reproduce the issue.
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.
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,
Same problem here. When I run tns run android I get the following:
Execution failed for task ':app:processDebugResources'.
Package 'org.nativescript.default' from AndroidManifest.xml is not a valid Java package name as 'default' is a Java keyword.Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1.
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.
Thank you so much @Fatme . WebStorm provides a default apple ID that I had to change to something else.
I have the same issue.
changed the project to 6.1.0. But problem is still there.
Is there any luck?
Hey,
Make sure your android emulator is already running
On Wed, Jan 1, 2020 at 2:53 AM gambheera notifications@github.com wrote:
I have the same issue.
changed the project to 6.1.0. But problem is still there.
Is there any luck?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NativeScript/nativescript-cli/issues/5031?email_source=notifications&email_token=AACTTVBOOXQVKY2PIAGHAITQ3PZR3A5CNFSM4IZ4JO22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH43PSA#issuecomment-570013640,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AACTTVDJLL6C7KOYKO6VJHTQ3PZR3ANCNFSM4IZ4JO2Q
.
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..
Hey @keithgulbro ,
Have you changed your application identifier in <path to project's App_Resources>/Android/app.gradle file? If yes, please ensure it is also changed in your package.json file.
I had the same issue. What help by me was changing the App_Resources/Android/settings.json to the same value as in package.json
{"appId":"here.your.id","minSdkVersion":null,"targetSdkVersion":null}
{
"nativescript": {
"id": "here.your.id",
"tns-android": {
"version": "6.3.0"
},
"tns-ios": {
"version": "6.3.0"
}
}
I'm using android emulator on my local machine, in AVD manager, i removed virtual device and add the new one and it fixed
As the initial issue is resolved and the error is quite generic (it may be caused by different reasons), I'm closing this thread. Please open a separate one in case you encounter similar problem. Also ensure your application identifier is the same in package.json and all gradle files (preferably keep it set only in your package.json file).
Most helpful comment
Hey @aligit,
It seems the name of your application is
default. Android doesn't allow building applications calleddefaultasdefaultis a Java keyword. You need to create an application with a different name.