Kiwix-android: Save Media option saves whole article rather than file

Created on 19 Dec 2018  路  22Comments  路  Source: kiwix/kiwix-android

When using the new landing page layout: on android 2.4 a long press on an image will give me the opportunity to "save media"
savemedia

The problem is that it won't save the image but the .html file.

bug good first issue

All 22 comments

@Popolechien Do you have the same problem with an image in an article or is that linked to this new welcome page?

@kelson42 Only on the new welcome page. When browsing articles I get to save the actual image.

@Popolechien Ok, good to know this is not a regression, we would need to have this file somewhere to download - as these are still not official ZIM files.

I would like to work on this issue. Hoping to get it done within a short span of time.

@prat-bphc52 Please go ahead, this is probably a problem in Kiwix Android.

@kelson42 @Popolechien Can you please help me understanding the bug.

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@mhutti1 would you be able to help us to fix that one?

Is there a small zim file where this can be repro-ed? To give anyone who takes this up an easier time of diagnosing?

Should occur with http://download.kiwix.org/zim/wikipedia/wikipedia_ru_football_nopic_2019-10.zim. I guess the problem is that the code is done to handle traditional HTML images, and here we have CSS defined stuff... and the error mgmt is wrong on the top of the root inability to retrieve the picture URL/name.

I might be able to have a look later in the week. Will see how much time I have.

@mhutti1 You have met specific difficulties ti fix that one?

So the url is in this from.
../I/m/%D0%9A%D0%BE%D0%BD%D1%81%D1%82%D0%B0%D0%BD%D1%82%D0%B8%D0%BD%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9_%D0%B4%D0%B2%D0%BE%D1%80%D0%B5%D1%86.jpg

I think this is too long to save so it causes issues.

@macgills When I try to commit (I bypassed)
```

Task :custom:processCustomexampleDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':custom:processCustomexampleDebugResources'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    Android resource linking failed
    /home/mhutti1/kiwix/kiwix-android/custom/src/main/AndroidManifest.xml:6:3-43:17: AAPT: error: resource string/app_name (aka org.kiwix.kiwixcustomexample:string/app_name) not found.

    /home/mhutti1/kiwix/kiwix-android/custom/src/main/AndroidManifest.xml:6:3-43:17: AAPT: error: resource style/AppTheme (aka org.kiwix.kiwixcustomexample:style/AppTheme) not found.

    /home/mhutti1/kiwix/kiwix-android/custom/src/main/AndroidManifest.xml:8:5-35:16: AAPT: error: resource string/app_name (aka org.kiwix.kiwixcustomexample:string/app_name) not found.

    /home/mhutti1/kiwix/kiwix-android/custom/src/main/AndroidManifest.xml:24:7-30:23: AAPT: error: resource string/app_search_string (aka org.kiwix.kiwixcustomexample:string/app_search_string) not found.

    /home/mhutti1/kiwix/kiwix-android/core/build/intermediates/library_manifest/debug/AndroidManifest.xml:33:9-48:20: AAPT: error: resource string/app_name (aka org.kiwix.kiwixcustomexample:string/app_name) not found.

    /home/mhutti1/kiwix/kiwix-android/core/build/intermediates/library_manifest/debug/AndroidManifest.xml:33:9-48:20: AAPT: error: resource style/AppTheme.Launcher (aka org.kiwix.kiwixcustomexample:style/AppTheme.Launcher) not found.

    /home/mhutti1/kiwix/kiwix-android/core/build/intermediates/library_manifest/debug/AndroidManifest.xml:45:13-47:53: AAPT: error: resource xml/shortcuts (aka org.kiwix.kiwixcustomexample:xml/shortcuts) not found.

    /home/mhutti1/kiwix/kiwix-android/core/build/intermediates/library_manifest/debug/AndroidManifest.xml:83:13-85:58: AAPT: error: resource xml/provider_paths (aka org.kiwix.kiwixcustomexample:xml/provider_paths) not found.

    /home/mhutti1/.gradle/caches/transforms-2/files-2.1/9d55815a802cb043f369858877d13ab9/jetified-leakcanary-android-core-2.0-alpha-2/AndroidManifest.xml:39:9-44:66: AAPT: error: resource string/leak_canary_display_activity_label (aka org.kiwix.kiwixcustomexample:string/leak_canary_display_activity_label) not found.

    /home/mhutti1/.gradle/caches/transforms-2/files-2.1/9d55815a802cb043f369858877d13ab9/jetified-leakcanary-android-core-2.0-alpha-2/AndroidManifest.xml:39:9-44:66: AAPT: error: resource style/leak_canary_LeakCanary.Base (aka org.kiwix.kiwixcustomexample:style/leak_canary_LeakCanary.Base) not found.

    /home/mhutti1/.gradle/caches/transforms-2/files-2.1/9d55815a802cb043f369858877d13ab9/jetified-leakcanary-android-core-2.0-alpha-2/AndroidManifest.xml:46:9-59:26: AAPT: error: resource bool/leak_canary_add_launcher_icon (aka org.kiwix.kiwixcustomexample:bool/leak_canary_add_launcher_icon) not found.

    /home/mhutti1/.gradle/caches/transforms-2/files-2.1/9d55815a802cb043f369858877d13ab9/jetified-leakcanary-android-core-2.0-alpha-2/AndroidManifest.xml:46:9-59:26: AAPT: error: resource string/leak_canary_display_activity_label (aka org.kiwix.kiwixcustomexample:string/leak_canary_display_activity_label) not found.

    /home/mhutti1/.gradle/caches/transforms-2/files-2.1/9d55815a802cb043f369858877d13ab9/jetified-leakcanary-android-core-2.0-alpha-2/AndroidManifest.xml:46:9-59:26: AAPT: error: resource style/leak_canary_LeakCanary.Base (aka org.kiwix.kiwixcustomexample:style/leak_canary_LeakCanary.Base) not found.

    /home/mhutti1/.gradle/caches/transforms-2/files-2.1/9d55815a802cb043f369858877d13ab9/jetified-leakcanary-android-core-2.0-alpha-2/AndroidManifest.xml:61:9-67:68: AAPT: error: resource string/leak_canary_storage_permission_activity_label (aka org.kiwix.kiwixcustomexample:string/leak_canary_storage_permission_activity_label) not found.

    /home/mhutti1/.gradle/caches/transforms-2/files-2.1/9d55815a802cb043f369858877d13ab9/jetified-leakcanary-android-core-2.0-alpha-2/AndroidManifest.xml:61:9-67:68: AAPT: error: resource style/leak_canary_Theme.Transparent (aka org.kiwix.kiwixcustomexample:style/leak_canary_Theme.Transparent) not found.

@mhutti1 curious, have you tried invalidating caches and restarting? Can you build a custom app locally?

@mhutti1 I hope the string is URL decoded before writing?

@kelson42 I think the issue is it wasn't being in certain circumstances. @macgills I will try.

@macgills

```> Task :app:ktlintAndroidTestSourceSetCheck
/home/mhutti1/kiwix/kiwix-android/app/src/androidTest/java/org/kiwix/kiwixmobile/KiwixMockServer.kt:48:1: Exceeded max line length (100) (cannot be auto-corrected)
/home/mhutti1/kiwix/kiwix-android/app/src/androidTest/java/org/kiwix/kiwixmobile/di/components/TestComponent.kt:36:1: Exceeded max line length (100) (cannot be auto-corrected)
"plain" report written to /home/mhutti1/kiwix/kiwix-android/app/build/reports/ktlint/ktlintAndroidTestSourceSetCheck.txt

Task :app:ktlintAndroidTestSourceSetCheck FAILED

FAILURE: Build failed with an exception.
```

@mhutti1 Exceeded max line length (100) you have to wrap these lines for the formatter to be okay with it, unfortunately it can't fix this

But I am not changing the files. That's the weird thing. It is changing them when I commit.

Yeah, that is confusing, it could depend on what branches you have been on lately. I have updated the git hooks and ktlint now observes all source sets (it had been ignoring androidTest) and that seems the most likely culprit. Merging develop in should get rid of it.

Yeah merging in develop fixed it thanks.

Was this page helpful?
0 / 5 - 0 ratings