Question

I'm trying to compile Gallery App source code for Android, which is currently public on Google Source.

I've had a few issues in the process, so I'll recap what I made:

  1. Clone the project from git repo
  2. Import on Eclipse
  3. Add framework.jar and core.jar libs from source to access hidden and internal APIs. (As answered here)

However, I still get compiler errors for some instance variables (e.g. on a derived class from TextView: mScrollX, mRight, etc.). Some of these are marked as protected on the super class ancestor, so they cannot be resolved from the source code (As seen here)

I've other similar issues for other Android internal clases. Am I missing something when configuring my environment to compile these kind of apps?

Was it helpful?

Solution

So I gave this a shot, imported the Gallery project into eclipse and added the framework.jar file to the build path and there are no compiler errors for me once everything has been done correctly.

I did notice that I will get the same compiler errors you got when the framework.jar file was not located at the top of order and export, so I would double check your order and export tab and make sure that it is at the very top (and like the other answerer says, mainly above android.jar).

I did not need core.jar either, that should not be necessary for the Gallery app. Infact for all my system development I still have not needed to import more than just the frameworks.jar file, I'd be interested to know where you got that piece of information from.

Hopefully this will help you build it as an apk, though you may not be able to install it (I certainly wasn't able to). Since your question is specifically about building though, this should get you started. As an extra, this xda forum has a quick guide on installing an apk that gets the SHARED_USER_INCOMPATIBLE error. It's a hack, but if all you want to do is test some things out then it may be the easiest way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top