kiwix / kiwix-xulrunner

[ARCHIVED] Legacy Kiwix desktop solution for Windows/macOS/Linux
https://download.kiwix.org/release/kiwix-xulrunner/
GNU General Public License v3.0
112 stars 28 forks source link

embedded apk built with android2.1 fails #438

Closed tim-moody closed 7 years ago

tim-moody commented 7 years ago

apk builds but in one case loads and will not run and in other fails to load

started with android_v2.10.tar.gz and followed instructions in android/README

sorry I don't find any error messages to report

mhutti1 commented 7 years ago

@tim-moody I have tried and it worked for me. Can you try building following the instructions exactly as specified as they should automatically get the correct android sdk?

tim-moody commented 7 years ago

Please confirm that when you tried 'it' you did exactly the following, which for me produces an apk that fails to load into my galaxy S6:

download and untar android_v2.10.tar.gz cd kiwix-android_v2.10 ./autogen.sh ./configure --disable-staticbins --disable-manager --disable-server --disable-launcher --disable-indexer --disable-installer --disable-searcher --disable-reader --disable-components --enable-android --enable-compileall cd src/dependencies && make android-deps && cd - [N.B.] there is no mention here of make in android/README, but I did it anyway cd android ./gen-custom-android-build.py /curation/iiab-factory/kiwix-apks/es-med.json --on=armeabi (my understanding is that this is used for custom apks and it worked in previous versions)

my json file is:

{ "app_name": "Wikipedia Médica", "package": "org.xsce.kiwix.wikipedia.medicine.es", "version_name": "2016-12", "version_code": "2", "zim_file": "/curation/XSCE-Content/IIAB-2/zims/content/wikipedia_es_medicine_2016-12.zim", "embed_zim": true, "ic_launcher": "/curation/iiab-factory/kiwix-apks/es-med.png", "enforced_lang": "es" }

the apk produced is build/outputs/apk/org.xsce.kiwix.wikipedia.medicine.es-debug.apk

mhutti1 commented 7 years ago

@tim-moody I have used this exact configuration (with slightly different file locations and file contents) to build and it succeeded.

I am a bit confused about the no mention thing as I can see it here in the read me:

https://github.com/kiwix/kiwix/blob/master/android/README

I am also still confused as to why you are downloading android_v2.10.tar.gz manually when it should do it automatically and this might be causing it to fail.

As a side note try building the standard app with ./build-android-with-native.py and see if that works fine.

tim-moody commented 7 years ago

how is android_v2.10.tar.gz (it is the kiwix git repo) supposed to download manually? I didn't find that.

let's be clear. the apk builds. it just doesn't load into an android phone. are you saying yours loads and runs. also note that this is an embedded example.

I think we're talking about these instructions:

I think there should be a make step here. is that wrong?

I will run cd android && ./build-android-with-native.py and see if it changes anything.

tim-moody commented 7 years ago

am I right that all this will change once the repos are reorganized? maybe I should wait for that.

mhutti1 commented 7 years ago

@tim-moody Oh really sorry about that. I was totally confused. I thought you were downloading an sdk. I would instead use the master branch and see if that works for you (`that's what I was using). Yes things will change when we reorganise though.

mhutti1 commented 7 years ago

@tim-moody Our script was updated to allow more flexibility a few days after the 2.1 release. I think that paths such as /home/... in the 2.1 version are not allowed.

tim-moody commented 7 years ago

tried again. this time I

cloned latest master of kiwix/kiwix did all steps mentioned above then ran ./build-android-with-native.py then ./gen-custom-android-build.py /curation/iiab-factory/kiwix-apks/es-med.json --on=armeabi

apks build as before, but build/outputs/apk/org.xsce.kiwix.wikipedia.medicine.es-debug.apk does not install when downloaded an old build of the phet app does install.

kelson42 commented 7 years ago

Are we not (partly) facing #310?

mhutti1 commented 7 years ago

Yeah sounds like it. The file is likely to big. Can you try with a smaller file? Also make sure to uninstall old versions. Could you share the apk? .

tim-moody commented 7 years ago

I don't think so. On this phone the en version built in Sept loaded, but the ES built now does not. Not sure how to remove an old version of something that never loaded in the first place. I just retested org.kiwix.kiwixcustomwikimed-debug.apk (296393651) and it loads.

tim-moody commented 7 years ago

looking at this again in comparison to http://xsce.org/downloads/content/org.kiwix.wikipedia.en.medicine.apk which I built in Sept and have loaded onto my phone and others.

why is the size of ES only 300M? did embedding in fact happen?

tim-moody commented 7 years ago

another idea. I inserted xsce into the package name to distinguish the ones I build. any possibility of a missmatch?

mhutti1 commented 7 years ago

@tim-moody that could be causing the issue. Can you try removing it

tim-moody commented 7 years ago

I just built build/outputs/apk/org.kiwix.test-debug.apk, size 12M

{ "app_name": "test", "package": "org.kiwix.test", "version_name": "2016-05", "version_code": "1", "zim_file": "/curation/XSCE-Content/IIAB-2/zims/content/wikiquote_hi_all_2016-05.zim", "embed_zim": true, "ic_launcher": "/curation/iiab-factory/kiwix-apks/en-med.png", "enforced_lang": "en" }

tim-moody commented 7 years ago

also doesn't load

mhutti1 commented 7 years ago

@tim-moody Can you please share that 12M apk so that I can debug please.

tim-moody commented 7 years ago

http://xsce.org/downloads/content/org.kiwix.test-debug.apk

mhutti1 commented 7 years ago

@tim-moody Thanks, I have done some debuging and this was the error that I got:

Failed to install org.kiwix.test-debug.apk: Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/or g.kiwix.test-1: Can't install because provider name org.kiwix.zim. (in package org.kiwix.test) is already used by org.xsce.kiwix.wikipe dia.medicine.es]

This seems to suggest that our current build script requires packages to be in the form org.kiwix.kiwixcustom...

I will create a new ticket to rectify this but for now this is how it is.

tim-moody commented 7 years ago

not to me. there is no mention of kiwixcustom and this requirement was lifted some time ago.

the error is that org.kiwix.zim is already used, so sounds like zim reader can't be shared. I'm also surprised, because org.xsce.kiwix.wikipedia.medicine.es is the package that won't install, so how can it be using a package?

tim-moody commented 7 years ago

what did you use to debug?

mhutti1 commented 7 years ago

@tim-moody I ran the command adb install apkname.apk

This is the line that I think is causing the error: https://github.com/kiwix/kiwix/blob/master/android/gen-custom-android-build.py#L449 It should be a simple fix so I should be able to push in a day or two.

mhutti1 commented 7 years ago

@tim-moody This should be fixed now in master.

tim-moody commented 7 years ago

do I need to do anything besides pull and rerun ./gen-custom-android-build.py ?

mhutti1 commented 7 years ago

@tim-moody If this was the only issue then no that should work fine.

tim-moody commented 7 years ago

congratulations. preliminary test looks good. I rebuilt the test apk shown above and it built, loaded on my phone, and ran. I'll try ES next.

tim-moody commented 7 years ago

ES and FR both built, loaded, and ran.

mhutti1 commented 7 years ago

@tim-moody Great, if any more problems occur be sure to report them 👍