2

I was looking for an ePub reader in android.
I referred PageTurner. Got it's apk downloaded and it worked.

But when I downloaded it's source code from github (as it's open source) and tried to Import the project, it gives the message that No Projects found to import even though it's pointing to the correct location.

I searched for similar questions on SO, but didn't got any help.
I guess I'm missing out libraries and some other stuff that will make this work. Note that bin and gen folders are missing at github link.
I'm using Eclipse Indigo as IDE.

Any idea what's wrong here? Any help appreciated.

EDIT

1.) From suggestions, I created new project and imported it from existing source but it's giving errors at virtually every line of code.

Some of the errors are like :

Package x1 does not match with package x2
class RoboActivity not found
method not found
@Inject cannot be resolved to a type

2.) What exactly do I download from Maven site?

Which libraries are required from these.

Moreover, When I tried to install the plugin from instructions, I got this

3.) this link is available for Maven Plugin but I can't find the plugin here :(

Community
  • 1
  • 1
GAMA
  • 5,958
  • 14
  • 79
  • 126
  • Simply create new project and use existing source code, instead of importing. – RobinHood Apr 21 '12 at 07:15
  • after creating a project and before copying the source have you deleted the existing src,res,manifeast file from your project? – Shankar Agarwal Apr 21 '12 at 07:27
  • how one can do that. After pressing create new project, eclipse prompts to choose between `create new project in workspace` or `create project from existing source`. If I choose 2nd, it asks for source and project gets created. – GAMA Apr 21 '12 at 07:42
  • I add maven tag to this question since the Android project is mavenized. – yorkw Apr 21 '12 at 08:30

5 Answers5

4

Your project is maven project. Download maven plugins for eclipse then import existing project as Existing Maven Projects. Dependencies of other jar will automatically resolved if your pom.xml file is correct.

Maven Eclipse Plugin

Maven 2 Eclipse Plug-in

user370305
  • 108,599
  • 23
  • 164
  • 151
  • 1
    More specifically, need install apache Maven first, then need two Eclipse plugin: m2e and m2e-android, all available via Eclipse Marketplace. – yorkw Apr 21 '12 at 08:20
  • Yes, Just check your Eclipse update site, you can get eclipse maven plugins. Just install it from there. – user370305 Apr 21 '12 at 08:22
  • In your Eclipse IDE, just go to Help -> Install New Software -> Add Site (your eclipse (indigo or else) release site) -> select maven plugins for eclipse and install it. – user370305 Apr 23 '12 at 04:58
2

instead of importing try

create new project using existing source

Hope this helps

Rohit Sharma
  • 13,787
  • 8
  • 57
  • 72
  • project.properties and .classpath various important files will be automatically created via eclipse. that will allow your eclipse to import this project next time and you will be enabled for using tools like proguard for your apk using these files only. – Rohit Sharma Apr 21 '12 at 07:12
  • Thnx. It got uploaded in Eclipse but it's giving hell lot of errors in virtually every line of code in each file :( – GAMA Apr 21 '12 at 07:17
  • have you cleaned and build your project? – Shankar Agarwal Apr 21 '12 at 07:20
  • Everything has its solution so don't worry. in fact you are through with the first step. Now open a source file containing error. firstly press ctrl+shift+o for importing all if they are available – Rohit Sharma Apr 21 '12 at 07:21
  • if its still showing you missing classes error. check whether these are default android one or third party classes. if they are android one ctrl+shift+o would have imported it. if not see are there any jar files respective to them. if yes add them to the class path – Rohit Sharma Apr 21 '12 at 07:23
  • `extends RoboApplication` is raising so many errors. Any idea this class belongs to which library? – GAMA Apr 21 '12 at 08:03
  • This is not recommended for importing a Mavenized project, especially for Android project, maven use a different folder structure ../src/main/java/com/.. instead of ../src/com/.. Not sure if ADT can handle this properly. Moreover, by doing this, you need manually download and resolve all jar dependencies from internet. – yorkw Apr 21 '12 at 08:28
1

if bin and gen folders are missing no matter you can also create your own project and just copy the res,src and manifeast files from that source to your project. then just refresh your project then clean it an build it will work.

Shankar Agarwal
  • 34,573
  • 7
  • 66
  • 64
1

This is maven based android project. So you need to download all the dependencies first, then import the project.

Read this carefully.

Rafiq
  • 2,000
  • 2
  • 21
  • 27
1

Big update: I hadn't realized that the new ADT likes Maven even less than the old one.

Let me chime in here as the author of PageTurner: personally I don't use the Eclipse Maven plugin, but I simply generate an Eclipse project with mvn eclipse:eclipse.

If you have never worked with Maven, it's a command-line build tool similar to Ant (or Unix make). You can download Maven 3 here: http://maven.apache.org/download.html

Once you have Maven installed, the steps to import PageTurner into your Eclipse environment are:

  1. Download and unpack the sources
  2. Run

    mvn -Djavax.net.ssl.trustStore=trust.jks -Djavax.net.ssl.trustStorePassword=pageturner -DexcludeTransitive=true dependency:copy-dependencies

    inside the source folder

  3. Create a libs folder

  4. Copy everything in target/dependency to the libs folder
  5. In Eclipse, select "New Android Project" -> "From existing source" and point it to the folder you unpacked PageTurner in.

Essentially this completely leaves Maven out of the game, except to get the dependencies.

NightWhistler
  • 326
  • 2
  • 7