Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include app in F-Droid #63

Closed
ghost opened this issue Feb 24, 2014 · 12 comments
Closed

Include app in F-Droid #63

ghost opened this issue Feb 24, 2014 · 12 comments

Comments

@ghost
Copy link

ghost commented Feb 24, 2014

F-Droid is a alternative "market/store" providing only free, libre and open-source apps, see https://f-droid.org/ for more information.

There's a request on the forums https://f-droid.org/forums/topic/textfairy-android-ocr-app/ and a merge request for the initial metadata is already submitted. However, it would be nice if you could

  • add a LICENSE file
  • tag your releases

Thanks.

@ghost
Copy link
Author

ghost commented Mar 5, 2014

Trying to build master

  • What went wrong:
    A problem occurred configuring project ':textfairy'.
    Configuration with name 'default' not found.

@renard314
Copy link
Owner

i'm currently on holidays so the next release might take a while.
what is the output of gradle build -info?

@ghost
Copy link
Author

ghost commented Mar 8, 2014

Oh, möchte nicht deinen Urlaub kaputt machen.. liegt sowieso wahrscheinlich an mir: Ich versuch es nur zu packagen und bin kein Entwickler... wie dem auch sei:


Successfully started process 'command '/home/builder/tmp/fdroid-tmp/android-ndk/ndk-build''
[armeabi-v7a] SharedLibrary : libhocr2pdf.so
[armeabi-v7a] SharedLibrary : liblept.so
[armeabi-v7a] Install : libjpeg.so => libs/armeabi-v7a/libjpeg.so
[armeabi-v7a] Compile++ thumb: ocr <= ocr.cpp
In file included from jni/ocr/ocr.cpp:31:0:
/home/builder/tmp/builbot/textfairy-test/textfairy/../OCRTest/src/util.h:32:0: warning: "LOG_TAG" redefined [enabled by default]
jni/ocr/common.h:32:0: note: this is the location of the previous definition
jni/ocr/ocr.cpp:32:25: fatal error: text_search.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi-v7a/objs/ocr/ocr.o] Error 1
make: *** Waiting for unfinished jobs....
:textfairy:ndkBuild FAILED
:textfairy:ndkBuild (Thread[Daemon,5,main]) completed. Took 3.003 secs.

FAILURE: Build failed with an exception.

I tried to build 752a45a and after fixing some missing res it worked (or at least it build without errors).

@ghost
Copy link
Author

ghost commented Mar 24, 2014

I had another look at building the latest version, see 32943992e123fde7f0dc9576fd42310d04041e81. Here are some things I noticed:

  • Tag releases after you verified a build. Fdroid uses the last tagged commit to build, so changes after this are not included.
  • It looks like you are using a case insensitive file system. Please update settings.gradle and textfairy/build.gradle to reference ViewPager3D instead of ViewPager3d
  • gradle clean seems to run the complete ndk job ???

@mvdan
Copy link

mvdan commented Mar 24, 2014

The problem with "gradle clean" running ndkBuild is the line saying "clean.dependsOn..." with the Armv5 stuff. That line should go.

@mvdan
Copy link

mvdan commented Mar 24, 2014

I'll now do a Pull Request trying to fix the few issues remaining. I patched these manually for 1.1.19, so it should be available on F-Droid soon.

@renard314
Copy link
Owner

my gradle knowledge is limited and the android build system does not yet support the ndk fully. Currently the build has to be run twice for the apk files to be generated with the native so files. After the first run the apt files contain no so files at all.

@mvdan
Copy link

mvdan commented Mar 27, 2014

Thanks for fixing the clean problem, @renard314 :)

Another easy fix you could do is the following:

sed -i 's/ViewPager3d/ViewPager3D/g' settings.gradle build.gradle

Also, you could have your arch-specific gradle tasks change jni/Application.conf. Currently, when e.g. building the x86 flavour, we do:

sed -i 's/APP_ABI.*/APP_ABI := x86/' jni/Application.mk

Sure, building armeabi and armeabi-v7a is not a problem since they will not be copied into lib. But still, it will make the building of jni three times slower.

The problem with gradle needing to be run twice for the native libs to appear is probably because the dependency structure is not correct. For example, it could be that you are moving the native libs into lib after gradle includes them, hence making the first build not have them. But then, a following build does have the lib dir populated at the beginning, so it works. I don't know if I made myself clear. I'm not a gradle expert myself either, nor do I know how your tasks work, so maybe you have an idea as to how to fix it.

@mvdan
Copy link

mvdan commented Mar 27, 2014

This shows what I meant about the order of the tasks:

:textfairy:prepareComAndroidSupportAppcompatV71901Library
:textfairy:prepareComRenardOcrAndroidViewPagerIndicatorLibraryUnspecifiedLibrary
:textfairy:prepareComRenardOcrFileExplorerUnspecifiedLibrary
:textfairy:prepareComRenardOcrViewPager3DViewPager3DUnspecifiedLibrary
:textfairy:prepareX86ReleaseDependencies
:textfairy:compileX86ReleaseAidl
:textfairy:compileX86ReleaseRenderscript
:textfairy:generateX86ReleaseBuildConfig
:textfairy:mergeX86ReleaseAssets
:textfairy:generateX86ReleaseResValues
:textfairy:generateX86ReleaseResources
:textfairy:mergeX86ReleaseResources
:textfairy:processX86ReleaseManifest
:textfairy:processX86ReleaseResources
:textfairy:generateX86ReleaseSources
:textfairy:ndkBuild
[x86] Prebuilt       : libgnustl_shared.so <= <NDK>/sources/cxx-stl/gnu-libstdc++/4.6/libs/x86/
[x86] Install        : libgnustl_shared.so => libs/x86/libgnustl_shared.so
[x86] Compile++      : hocr2pdf <= Image.cc
[x86] Compile++      : hocr2pdf <= crop.cc
[x86] Compile++      : hocr2pdf <= scale.cc
[x86] Compile++      : hocr2pdf <= rotate.cc

Try moving native??LibsToJar up in that list, so that the libraries are ready earlier in the build process.

@renard314
Copy link
Owner

I added LICENSE file and will tag your releases

@nkasvosve
Copy link

@renard314 I still cannot get the project to build.
Here is the output:

Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
signing.properties not found

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_developDebugApk'.
Configuration with name 'default' not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

@mvdan
Copy link

mvdan commented Mar 20, 2017

@nkasvosve please open a new issue instead of resurrecting three-year-old threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants