L.TileLayer.Cordova
L.TileLayer.Cordova copied to clipboard
can't make your plugin run - test description
Hi @gregallensworth
I need to create an android/ios offline map with leaflet using cordova. I m new to Cordova so i apologize for eventual banal mistakes. Thanks in advance.
my stack is :
Cordova 9.0.0 Ubuntu 16 Androind Studio 3.4.1
1) test I copied your source code, moved to /test and launched : cordova run androd, got this error :
Unable to load PlatformApi from platform. Error: Cannot find module '/var/www/html/cordova/L.TileLayer.Cordova-master-2/test/platforms/android/cordova/Api.js' Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.)
i launched : $ cordova platform remove android $ cordova platform add android $ cordova run android
got this error : No target specified and no devices found, deploying to emulator Using apk: /var/www/html/cordova/L.TileLayer.Cordova-master-2/test/platforms/android/app/build/outputs/apk/debug/app-debug.apk Package name: io.cordova.hellocordova Error executing "adb -s emulator-5554 install -r "/var/www/html/cordova/L.TileLayer.Cordova-master-2/test/platforms/android/app/build/outputs/apk/debug/app-debug.apk"": adb: failed to install /var/www/html/cordova/L.TileLayer.Cordova-master-2/test/platforms/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
2) test So i created a brand new project + your leaflet plugin $ cordova create offlinemaptest $ cordova platform add android $ cordova platform add ios $ cordova plaftorm add browser $ cordova plugin plugin add cordova-plugin-console $ cordova plugin plugin add cordova-plugin-file $ cordova plugin plugin add cordova-plugin-file-transfer
added source code on the www, added all the js and css needed assets. App is now correctly launched on the emulator but map is not showing and if i click on Cache current (piramid) gives me "undefined" error.
Used this log for logging on abd logcat :
window.onerror = function (message, url, lineNo){ console.log('Errore: ' + message + '\n' + 'Line Number: ' + lineNo + '\n' + 'Url: ' + url); return true;}
But i get no window js error logged on logcat.
This is the logcat log
06-06 14:17:09.930 1844 2922 W WindowManager: Failed looking up window callers=com.android.server.wm.WindowManagerService.windowForClientLocked:5513 com.android.server.wm.WindowState$DeathRecipient.binderDied:2443 android.os.BinderProxy.sendDeathNotice:1193
06-06 14:17:09.981 1844 1862 W libprocessgroup: Failed to open process cgroup uid 99001 pid 5049: No such file or directory
06-06 14:17:09.981 1844 1862 E libprocessgroup: Error encountered killing process cgroup uid 99001 pid 5049: No such file or directory
06-06 14:17:09.988 1844 1867 W ActivityManager: setHasOverlayUi called on unknown pid: 5024
06-06 14:17:09.989 1844 1863 W KernelCpuProcReader: File not exist: /proc/uid_cpupower/concurrent_active_time
06-06 14:17:09.989 1844 1863 W KernelCpuProcReader: File not exist: /proc/uid_cpupower/concurrent_policy_time
06-06 14:17:09.991 1844 1860 W Looper : Slow dispatch took 123ms android.ui h=com.android.server.am.ActivityManagerService$UiHandler c=null m=53
06-06 14:17:10.102 2429 2429 W SessionLifecycleManager: Handover failed. Creating new session controller.
06-06 14:17:10.107 1691 1893 E : Couldn't opendir /data/app/vmdl674585771.tmp: No such file or directory
06-06 14:17:10.107 1691 1893 E installd: Failed to delete /data/app/vmdl674585771.tmp: No such file or directory
06-06 14:17:10.110 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.android.musicfx/.Compatibility$Receiver
06-06 14:17:10.110 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.android.vending/com.google.android.finsky.packagemanager.impl.PackageMonitorReceiverImpl$RegisteredReceiver
06-06 14:17:10.110 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.android.vending/com.google.android.finsky.instantapps.appmanagement.InstantAppRemoveMonitor
06-06 14:17:10.110 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.gms/.games.chimera.GamesSystemBroadcastReceiverProxy
06-06 14:17:10.110 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
06-06 14:17:10.110 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.googlequicksearchbox.GelStubAppWatcher
06-06 14:17:10.115 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.android.musicfx/.Compatibility$Receiver
06-06 14:17:10.116 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.android.vending/com.google.android.finsky.packagemanager.impl.PackageMonitorReceiverImpl$RegisteredReceiver
06-06 14:17:10.116 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.gms/.games.chimera.GamesSystemBroadcastReceiverProxy
06-06 14:17:10.116 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.gms/.gass.chimera.PackageChangeBroadcastReceiver
06-06 14:17:10.116 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
06-06 14:17:10.116 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.googlequicksearchbox.GelStubAppWatcher
06-06 14:17:10.167 2429 2429 W ThreadPoolDumper: Queue length for executor Lightweight is now 11. Perhaps some tasks are too long, or the pool is too small.
06-06 14:17:10.294 2429 5229 W LocationOracle: No location history returned by ContextManager
06-06 14:17:10.296 2254 2638 W GCoreFlp: No location to return for getLastLocation()
06-06 14:17:10.378 1844 2922 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.android.musicfx/.Compatibility$Receiver
06-06 14:17:10.379 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.apps.photos/.account.full.FetchAccountPropertiesAppUpgradeBroadcastReceiver
06-06 14:17:10.379 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.apps.photos/.account.full.SyncAccountsForLoginBroadcastReceiver
06-06 14:17:10.379 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.apps.photos/.experiments.phenotype.full.PhenotypeAppUpgradeBroadcastReceiver
06-06 14:17:10.379 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.apps.photos/.notificationchannels.AppUpdateBroadcastReceiver
06-06 14:17:10.379 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.gms/.gass.chimera.PackageChangeBroadcastReceiver
06-06 14:17:10.379 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
06-06 14:17:10.379 1844 1859 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:io.cordova.hellocordova flg=0x4000010 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.googlequicksearchbox.GelStubAppWatcher
06-06 14:17:10.408 1844 1863 E BatteryExternalStatsWorker: no controller energy info supplied for wifi
06-06 14:17:10.614 2524 5244 W PeopleContactsSync: CP2 sync disabled by gservices.
06-06 14:17:10.621 2254 2638 W GCoreFlp: No location to return for getLastLocation()
06-06 14:17:10.738 2254 4264 W ctxmgr : [AclManager] No 3 for (accnt=account#-517948760#, com.google.android.gms(10009):UserVelocityProducer, vrsn=17455040, 0, 3pPkg = null , 3pMdlId = null , pid = 2254). Was: 3 for 1, account#-517948760# [CONTEXT service_id=47 ]
06-06 14:17:10.747 2254 2638 W GCoreFlp: No location to return for getLastLocation()
06-06 14:17:10.763 5205 5205 W app_process: Unexpected CPU variant for X86 using defaults: x86
06-06 14:17:10.779 5205 5205 W app_process: CheckJNI: method to register "write" not in the given class. This is slow, consider changing your RegisterNatives calls.
06-06 14:17:10.780 5205 5205 W app_process: CheckJNI: method to register "write" not in the given class. This is slow, consider changing your RegisterNatives calls.
06-06 14:17:10.780 5205 5205 W app_process: CheckJNI: method to register "write_non_chained" not in the given class. This is slow, consider changing your RegisterNatives calls.
06-06 14:17:10.780 5205 5205 W app_process: CheckJNI: method to register "write_non_chained" not in the given class. This is slow, consider changing your RegisterNatives calls.
06-06 14:17:10.813 1598 5201 E : Request requires android.permission.RECORD_AUDIO
06-06 14:17:10.813 1598 5201 E AudioPolicyIntefaceImpl: getInputForAttr permission denied: recording not allowed for uid 10031 pid 2429
06-06 14:17:10.813 1598 5201 E AudioFlinger: createRecord() checkRecordThread_l failed
06-06 14:17:10.814 2429 4922 E IAudioFlinger: createRecord returned error -22
06-06 14:17:10.814 2429 4922 E AudioRecord: AudioFlinger could not create record track, status: -22
06-06 14:17:10.814 2429 4922 E AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -22.
06-06 14:17:10.814 2429 4922 E android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
06-06 14:17:10.817 2429 4922 E ActivityThread: Failed to find provider info for com.google.android.apps.gsa.testing.ui.audio.recorded
06-06 14:17:10.820 2429 4926 W ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
06-06 14:17:10.836 2429 4926 W ErrorProcessor: onFatalError, processing error from engine(4)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.staticplugins.microdetection.d.k.a(SourceFile:91)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.staticplugins.microdetection.d.l.run(Unknown Source:14)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.libraries.gsa.runner.a.a.b(SourceFile:32)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.libraries.gsa.runner.a.c.call(Unknown Source:4)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.g.run(Unknown Source:4)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.aw.run(SourceFile:4)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.lang.Thread.run(Thread.java:764)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.shared.util.concurrent.b.i.run(SourceFile:6)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.Tee.j(SourceFile:103)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.au.read(SourceFile:2)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.io.InputStream.read(InputStream.java:101)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.ao.run(SourceFile:17)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at com.google.android.apps.gsa.speech.audio.an.run(SourceFile:2)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
06-06 14:17:10.836 2429 4926 W ErrorProcessor: ... 10 more
06-06 14:17:10.839 5205 5263 E app_process: Thread attaching to non-existent runtime: Binder:5205_1
06-06 14:17:10.867 2254 2638 W GCoreFlp: No location to return for getLastLocation()
06-06 14:17:11.164 5269 5269 W va.hellocordov: Unexpected CPU variant for X86 using defaults: x86
06-06 14:17:11.314 5269 5291 E cr_VariationsUtils: Failed reading seed file "/data/user/0/io.cordova.hellocordova/app_webview/variations_seed": /data/user/0/io.cordova.hellocordova/app_webview/variations_seed (No such file or directory)
06-06 14:17:11.325 5269 5292 W cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
06-06 14:17:11.340 5295 5295 W dboxed_process: Unexpected CPU variant for X86 using defaults: x86
06-06 14:17:11.348 5295 5295 E dboxed_process: Not starting debugger since process cannot load the jdwp agent.
06-06 14:17:11.419 5269 5269 W va.hellocordov: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->
Hi @RomanSurface, I'm dealing with the same issue here - did you manage to solve it?
@guyschrift no i did not manage to make this plugin work and developed my own solution.
@guyschrift no i did not manage to make this plugin work and developed my own solution.
is it public? this https://github.com/RomanSurface/L.TileLayer.Cordova is not a solution?
@guyschrift it is not public unfortunately, the source code belongs to my client. In my case the map area was corresponding to an italian region, so i pre-loaded the tiles in the app with the dir structure /x/y/z and customized leafleat to point to this internal tiles database. Looks banal but it works and you won't need any additional plugin.
In my case the map area was corresponding to an italian region, so i pre-loaded the tiles in the app with the dir structure /x/y/z and customized leafleat to point to this internal tiles database. Looks banal but it works and you won't need any additional plugin.
this is great! i´ll try it, too.