Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Timeout searching for location on Android (Nativescript 4.2.6) #134

Closed
cnqiuxue opened this issue Jun 1, 2018 · 15 comments
Closed

Timeout searching for location on Android (Nativescript 4.2.6) #134

cnqiuxue opened this issue Jun 1, 2018 · 15 comments

Comments

@cnqiuxue
Copy link

cnqiuxue commented Jun 1, 2018

image
run tns run android
image
Analog device
image
package.json
image

@kwontaeheon
Copy link

I'm getting the same error on nativescript 4.0.2

@kwontaeheon
Copy link

kwontaeheon commented Jun 1, 2018

In my situation,
when it was the first time to enable location request, getCurrentLocation() works fine.
But after that calling again getCurrentLocation() causes Timeout error.

@zbranzov
Copy link
Contributor

zbranzov commented Jun 1, 2018

Unfortunately, I was unable to reproduce your case using the demo app from the repository. Could you edit it and try to reproduce the error using that app and send it over for investigation?

@zuohuadong
Copy link

zuohuadong commented Jun 2, 2018

I also have the same problem.
A lot of people have made similar mistakes. In addition, I would like to say, please be sure to use an Android test.
@zbranzov

I hope you can give me a picture of your normal operation under Android.

like: #62

@cnqiuxue
Copy link
Author

cnqiuxue commented Jun 4, 2018

I'm sorry for the belated reply.
I just cloned the project.
Run TNS plugin Add nativescript-geolocation
Run TNS run Android again This is my mistake.

bc-082@bc082-desktop ~/workLZ/nativescript-geolocation/demo $ tns run androidSearching for devices...
Executing before-watch hook from /home/bc-082/workLZ/nativescript-geolocation/demo/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.3.4
10:20:57 - Compilation complete. Watching for file changes.



Copying template files...
⠋ Installing tns-android
⠋ [..................] - loadIdealTree:loadAllDepsIntoIdealTree: sill install loadIdeal⠴ [   ...............] | loadDep:negotiator: sill resolveWithNewModule [email protected].⠦ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠧ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠇ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠏ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠋ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠙ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠹ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠸ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠼ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠴ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠦ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠧ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠇ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠏ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠋ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠙ [      ............] | loadExtraneous: sill resolveWithNewModule [email protected] ch⠏ [         .........] - extract:nan: sill pacote nan@https://registry.npmjs.org/nan/-/⠋ [         .........] - extract:nan: sill pacote nan@https://registry.npmjs.org/nan/-/⠙ [         .........] - extract:nan: sill pacote nan@https://registry.npmjs.org/nan/-/⠹ [         .........] - extract:nan: sill pacote nan@https://registry.npmjs.org/nan/-/⠸ [         .........] - extract:nan: sill pacote nan@https://registry.npmjs.org/nan/-/⠼ [          ........] \ extract:fsevents: sill pacote fsevents@https://registry.npmjs.⠴ [          ........] \ extract:fsevents: sill pacote fsevents@https://registry.npmjs.⠦ [            ......] | finalize:nan: sill finalize /home/bc-082/workLZ/nativescript-g⠧ [            ......] | refresh-package-json:tns-android: sill finalize /home/bc-082/w⠇ [            ......] - preinstall:tns-android: info lifecycle [email protected]~prein⠏ [            ......] / postinstall: info lifecycle [email protected]~postinstall: tns⠴ [            ......] \ postinstall: info lifecycle [email protected]~postinstall: tns⠦ [            ......] - postinstall: info lifecycle [email protected]~postinstall: tns+ [email protected]
added 1 package in 6.683s
Project successfully created.
Executing before-prepare hook from /home/bc-082/workLZ/nativescript-geolocation/demo/hooks/before-prepare/nativescript-dev-typescript.js
Preparing project...
Executing before-prepareJSApp hook from /home/bc-082/workLZ/nativescript-geolocation/demo/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-toast for android.
Successfully prepared plugin nativescript-unit-test-runner for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Project successfully prepared (Android)
Executing after-prepare hook from /home/bc-082/workLZ/nativescript-geolocation/demo/hooks/after-prepare/nativescript-dev-webpack.js
Executing after-prepare hook from /home/bc-082/workLZ/nativescript-geolocation/demo/hooks/after-prepare/nativescript-unit-test-runner.js
Building project...
Gradle build...
         + applying user-defined configuration from /home/bc-082/workLZ/nativescript-ge
olocation/demo/app/App_Resources/Android/app.gradle
         + add include.gradle from /home/bc-082/workLZ/nativescript-geolocation/demo/no
de_modules/nativescript-geolocation/platforms/android/include.gradle
         + applying plugin configuration from /home/bc-082/workLZ/nativescript-geolocation/demo/platforms/android/app/build/configurations/nativescript-geolocation/include.gradle
         + adding nativescript runtime package dependency: nativescript-optimized
         + adding aar plugin dependency: /home/bc-082/workLZ/nativescript-geolocation/d
emo/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar
false
Running full build
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Project successfully built.
Installing...
Successfully installed on device with identifier 'emulator-5554'.
Successfully transferred all files.
Refreshing application...
Successfully synced application org.nativescript.demo on device emulator-5554.
ActivityManager: Start proc 11313:org.nativescript.demo/u0a85 for activity org.nativescript.demo/com.tns.NativeScriptActivity
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.demo/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Failed to find module: "nativescript-geolocation", relative to: app/tns_modules/
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
System.err:     at android.app.ActivityThread.-wrap12(ActivityThread.java)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     at android.os.Looper.loop(Looper.java:154)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6119)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
System.err: Caused by: com.tns.NativeScriptException: Failed to find module: "nativescript-geolocation", relative to: app/tns_modules/
System.err:     at com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     at com.tns.Module.resolvePath(Module.java:55)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err:     at android.app.Activity.performCreate(Activity.java:6679)
System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
System.err:     ... 9 more
ActivityManager: Process org.nativescript.demo (pid 11313) has died
ActivityManager: cleanUpApplicationRecord -- 11313

@xantrix
Copy link

xantrix commented Jun 4, 2018

In my situation,
when it was the first time to enable location request, getCurrentLocation() works fine.
But after that calling again getCurrentLocation() causes Timeout error.

@zuohuadong Same for me: Error: Timeout while searching for location!
nativescript 4.0.2

@zbranzov
Copy link
Contributor

@cnqiuxue In order to run the demo from the repo, you will have to execute 'npm run build' in /src folder and then in the /demo folder execute 'tns run android'

@cnqiuxue
Copy link
Author

@zbranzov Thank you so much

@Ross-Jo
Copy link

Ross-Jo commented Jul 3, 2018

I also have similar issue

@luishcastroc
Copy link

same issue here :(

@gogoout
Copy link

gogoout commented Nov 25, 2018

Very weird one, but my simulator is starting to get this also. Also a lot of my customers report the same issue.

@zbranzov
Copy link
Contributor

No new information has been provided since we tried to reproduce the issue last time, but I tried again using the app from the repository on Galaxy S8 Android 8.0 still to no avail. Without any clue on the case we are unable to reproduce and debug the issue. Please, try to isolate it and provide all information available regarding device model, OS version and anything the might be of help.

@elena-p
Copy link
Contributor

elena-p commented Dec 21, 2018

closing due to inactivity

@elena-p elena-p closed this as completed Dec 21, 2018
@vahidvdn
Copy link

I have the same issue.

@mturneruk
Copy link

mturneruk commented Oct 27, 2019

I also am experiencing this problem on Nexus_5X_API_29 Emulator, using Angular.

JS: ERROR Error: Uncaught (in promise): Error: Timeout while searching for location!
JS: Error: Timeout while searching for location - at file:///node_modules\nativescript-geolocation\geolocation.js:67:0 [angular]
at invoke (file:///node_modules\tns-core-modules\timer\timer.js:20:30) [angular]

It does not seem to be a problem on my phone. One Plus 6.

Anybody got any suggestions ?

Cheers

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