Is OSMDroid trying to open and render a cached map tile it downloaded? - android

Context
I am developing an app that uses OSMDroid. While running the map functionality and testing for bugs, I stumble across something like this in the logs:
...
2023-02-17 15:19:06.820 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109600/60180.png': No such file or directory
2023-02-17 15:19:06.820 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109600/60180.png': No such file or directory
2023-02-17 15:19:06.823 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109594/60181.png': No such file or directory
2023-02-17 15:19:06.823 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109594/60181.png': No such file or directory
2023-02-17 15:19:06.826 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109595/60181.png': No such file or directory
2023-02-17 15:19:06.826 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109595/60181.png': No such file or directory
2023-02-17 15:19:06.828 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109596/60181.png': No such file or directory
2023-02-17 15:19:06.828 28041-28422 .networkmonitor com.project123.networkmonitor E Failed to open file '/data/data/com.project123.networkmonitor/code_cache/.overlay/base.apk/assets/Mapnik/17/109596/60181.png': No such file or directory
...
And it would continue to go on like this until I exit the activity running the Map. It wasn't app-breaking, but it is kind of annoying since I've been trying to find a way to get rid of the message.
After some research, I figured that it might have something to do with how map tiles are cached but I have no idea where to look for the root cause. Additionally, the map tiles are rendered correctly.
So I looked for anything related to the problem, and got this part of the code:
...
val tileSource: ITileSource =
XYTileSource(
"Mapnik", 1, 18, 256, ".png",
arrayOf<String>(
// extra URLs
//"https://tiles.wmflabs.org/hikebike/"
"https://tile.openstreetmap.org/"
)
)
osmDroidMapView.setTileSource(tileSource)
...
Since this is the only part of the code where "Mapnik" is mentioned, I figured I dive right into TileSource's implementation. TileSource could point me to where the error is being produced, but nothing (yet) turned up.
Question
Though the map tiles are loaded properly, why does something like this happen to OSMDroid? Is it trying to access and rendered the cached map tiles it downloaded?
If it was downloaded, why doesn't the cache and its directory exist? Should it exist somewhere? I did try to look for the files it tried to access, but haven't found anything.

Related

Change StorageManager's default mount point from /mnt/obb to /mnt/data

I am following this obb sample to load a native library from an obb file. But I am seeing following error on System.load(mylib.getAbsolutePath()) call.
java.lang.UnsatisfiedLinkError: dlopen failed: library "/mnt/obb/fcc93fcbaf5acfc/mylibs.so" needed or dlopened by
"/system/lib/libnativeloader.so" is not accessible for the namespace "classloader-namespace"
[name="classloader-namespace", ld_library_paths="", default_library_paths="", permitted_paths="/data:/mnt/expand:/data/data/com.example"]
But as far as I understood, StorageManager#mountObb() by default mounting to /mnt/obb. Is there a way I can instruct StorageManager to mount the obb at /mnt/data ?

Why am I getting file not found error even when file is in that location? Does it has to do something with the file path not given properly?

Caused by: java.io.FileNotFoundException: /RecordsKeeper/address/src/main/res/config.properties: open failed: ENOENT (No such file or directory)
I am getting the above error while I run my application. I am not able to load my config.properties file from config.java while I'm running my android application. Although it gets loaded and works fine when I run my library test cases using that config file.

APK tool returning the content of the res folder in encrypted language

I have used the APKTool to decompile the apk file.
For that,first i rename the apk file to zip and then extract it to get the res folder.
Now problem is i got the res folder with its respective subfolders,but when i opened any xml file in that
i got the text in some different language (as shown below).
After that i have tried it using command line ..
but when i run the command apktool d sample.apk
i got the following error ...
D:\Softwares\apktool_2.0.0rc4>apktool d sample.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode ars
c file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:491)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:66)
at brut.androlib.Androlib.getResTable(Androlib.java:50)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
2)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
... 8 more
can anyone guide me towards to get the possible solution ???
your suggestion and guidance are highly appreciated...
Thanks in advance..

failed to read the project description file in eclipse

I am new to android.While checking out a code from SVN , I face this issue:
Checkout operation for
'https://subversion.assembla.com/svn/SamplePjt/trunk/Android/SamplePjtv1.0/SamplePjt' failed.
Failed to read the project description file (.project) for 'SamplePjt'. The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state.
Can anyone please help me out.

java.io.FileNotFoundException: /sdcard/DCIM/ROBIN.jpg (No such file or directory)

I'm getting an error on the following line of code:
FileInputStream is = new FileInputStream("/sdcard/DCIM/ROBIN.jpg");
The error is:
java.io.FileNotFoundException: /sdcard/DCIM/ROBIN.jpg (No such file or directory)
But the image is present in the directory
My USB connection is Charge only
Never hardcode paths like /sdcard. For example, /sdcard is wrong on most Android devices. Use Environment.getExternalStorageDirectory() to find the root of external storage.
Make sure you have set the permission WRITE_EXTERNAL_STORAGE in your manifest.

Categories

Resources