geometer / FBReaderJ

Official FBReaderJ project repository
http://www.fbreader.org/FBReaderJ/
1.83k stars 802 forks source link

How to Build FBReaderJ in Adroid Studio on Ubutu12.04 #362

Closed DhairyashilBhosale closed 8 years ago

DhairyashilBhosale commented 8 years ago

Hi all, I am new to Android and FbreaderJ, I am trying to build run FBReaderJ from Source that given on FBReaderJ repository, but its working fine, I tried to add source from VCS->CheckOUtFromGit->Git in Android studio but its added file but its not build and run.

So I tried from command prompt that 'git clone http://FBReaderJ-path' so its added all files, but its not built successfully.

So please give proper way to Built FBReaderJ in Android Studio on Linux Platform. I got following errors while building in Android studio:

Error:(10, 33) error: package android.support.v4.widget does not exist
Error:(28, 53) error: cannot find symbol cla

/home/nrcfoss/AndroidStudioProjects/FBReaderJ/library/src/main/java/com/mobeta/android/dslv/DragSortCursorAdapter.java
Error:(10, 33) error: package android.support.v4.widget does not exist
Error:(28, 53) error: cannot find symbol class CursorAdapter
Error:(56, 5) error: method does not override or implement a method from a supertype
Error:(58, 22) error: cannot find symbol variable super
Error:(68, 5) error: method does not override or implement a method from a supertype
Error:(70, 9) error: cannot find symbol variable super
Error:(79, 9) error: cannot find symbol method notifyDataSetChanged()
Error:(87, 5) error: method does not override or implement a method from a supertype
Error:(89, 16) error: cannot find symbol variable super
Error:(92, 5) error: method does not override or implement a method from a supertype
Error:(94, 16) error: cannot find symbol variable super
Error:(97, 5) error: method does not override or implement a method from a supertype
Error:(99, 16) error: cannot find symbol variable super
Error:(102, 5) error: method does not override or implement a method from a supertype
Error:(104, 16) error: cannot find symbol variable super
Error:(131, 13) error: cannot find symbol method notifyDataSetChanged()
Error:(157, 9) error: cannot find symbol method notifyDataSetChanged()
Error:(187, 5) error: method does not override or implement a method from a supertype
Error:(189, 16) error: cannot find symbol variable super
/home/nrcfoss/AndroidStudioProjects/FBReaderJ/library/src/main/java/com/mobeta/android/dslv/ResourceDragSortCursorAdapter.java
Error:(106, 5) error: method does not override or implement a method from a supertype
Error:(111, 5) error: method does not override or implement a method from a supertype
/home/nrcfoss/AndroidStudioProjects/FBReaderJ/library/src/main/java/com/mobeta/android/dslv/SimpleDragSortCursorAdapter.java
Error:(138, 5) error: method does not override or implement a method from a supertype
Error:(311, 5) error: method does not override or implement a method from a supertype
Error:(319, 21) error: cannot find symbol method convertToString(Cursor)
Error:Execution failed for task ':library:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
intari commented 8 years ago

start by reading HowToBuild in checkouted tree. You will need Android SDK AND NDK installed

I use following changes to make it buildable for myself - see https://gist.github.com/intari/feeaae1e3abfb018caf8 (you should fix paths)

I use Eclipse as IDE for FBReader (as far as I understood FBReader is not yet migrated to Android Studio )

see https://github.com/geometer/FBReaderJ/pull/279 for status of Android Studio build

DhairyashilBhosale commented 8 years ago

Hi Dmitriy, thanks for reply. I tried to built FBReaderJ in Android Studio, I did the modify the path for SDK and for NDK in local.properties and also modify the project.pro but I got the error like Gradle is not synchronized with the FBReaderJ project so please give step wise procedure to built FBReaderJ in Android Studio . . .

intari commented 8 years ago

hi, as far as I remember, main FBReader repository uses Ant and not Gradle as build system.

DhairyashilBhosale commented 8 years ago

Hi Dmitriy, I tried to built using ant like 'ant release' but it gives me lot of errors Ant-built-failed, please take look. I am trying very hard to built FBReaderJ from few days but didn't understand, the built process of FBReaderJ in Android Studio. so please give you valuable comments.

geometer commented 8 years ago

Could you please clarify why do you need to build fbreader from sources?

DhairyashilBhosale commented 8 years ago

Hi Dmitriy, sorry for late reply. I am trying to customize the behavior of FBReaderJ, so for that I need to build fbreaderJ.

1) I was trying to built fbreaderJ in Android studio but its not working. 2) So I added the FbreadeJ source in eclipse-Mars but I got following errors while 'ant release':

Buildfile: /home/nrcfoss/Downloads/fbreader-android/FBReaderJ/obsolete/j2me/build.xml
  [taskdef] Could not load definitions from resource antenna.properties. It could not be found.
prepare:

BUILD FAILED
/home/nrcfoss/Downloads/fbreader-android/FBReaderJ/obsolete/j2me/build.xml:31: Warning: Could not find file /media/android/Projects/FBReaderJ/platform/j2me/FBReaderJ.jad to copy.

3) I also try to built 'ant release' using terminal but I got following errors:

BUILD FAILED
/media/android/Android/Sdk/tools/ant/build.xml:597: The following error occurred while executing this line:
/media/android/Android/Sdk/tools/ant/build.xml:649: The following error occurred while executing this line:
/media/android/Android/Sdk/tools/ant/build.xml:694: null returned: 1

4) Please give your suggestion for building FbreaderJ on Linux Platform.

geometer commented 8 years ago

Sorry guys. For me this looks like a help to a person who wants to steel code for salary. And anyway this is not an fbreader issue. Closed.

geometer commented 8 years ago

Ok, sorry for "steeling code", I was not right. FBReader build system is currently ant-based; it should be not easy to convert it to gradle/AS because it includes native code compilation too.

aplicatii-romanesti commented 8 years ago

Hi, I have reinstalled my machine, and I have to start from zero the build setup for FBReaderJ. Did anyone make a VMWare/VirtualBox appliance with FBReader which he could share?

aplicatii-romanesti commented 8 years ago

For Android Studio, I found this: https://github.com/liquiddandruff/FBReaderJ/blob/android_studio/README.md (pointed from: http://www.goldyliang.net/blog/how-to-build-fbreaderj-android/)