haipv1108 / androjena

Automatically exported from code.google.com/p/androjena
0 stars 0 forks source link

Build failures of AndroJena on Android #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Follow the readme.txt and add all four libs to android project.
a. I created a "lib" folder, copied androjena_0.2.jar and rest three files into 
that. Configured buildpath accordingly.
2. Since "Build Automatically" is enabled, project will be built.

What is the expected output? What do you see instead?
Project should be successfully built. Currently with Android 2.2, I am getting 
these exceptions:

[2010-11-17 12:31:20 - AndroidReasoning] warning: Ignoring InnerClasses 
attribute for an anonymous inner class that doesn't come with an associated 
EnclosingMethod attribute. (This class was probably produced by a broken 
compiler.)
[2010-11-17 12:33:29 - Dex Loader] Unable to execute dex: null
[2010-11-17 12:33:29 - AndroidReasoning] Conversion to Dalvik format failed: 
Unable to execute dex: null

If you're using a real device and not the emulated AVD, what is the device
model?
-- currently running on Emulator.

What version of Android runs on your device/emulated AVD? (please put an X
next to the correct version)

Android 1.1
Android 1.5 (Cupcake)
Android 1.6 (Donut)
Android 2.0/2.1 (Eclair)
Android 2.2 (Froyo) -- X
Android 2.3 (Gingerbread)
Android 3.0 (Honeycomb)

What version of Android is your application targeting? (please put an X
next to the correct version)

Android 1.1
Android 1.5 (Cupcake)
Android 1.6 (Donut)
Android 2.0/2.1 (Eclair)
Android 2.2 (Froyo) - X
Android 2.3 (Gingerbread)
Android 3.0 (Honeycomb)

What IDE/environment are you developing with? (Eclipse w/ ADT, Android SDK
w/ Apache Ant, ...)

-- Eclipse w/ ADT.

What operating system and hardware is your IDE/development environment
running on?
Windows Vista.

Please attach the following application files (when applicable):

- AndroidManifest.xml
- .classpath
- default.properties
- a full LogCat dump from application launch to exception/crash
- a meaningful portion of the source code where the exception is thrown

Source Code :
Default source code of newly created android app.

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);   
}

Additional Details:
I tried to figure our exactly which library is causing this issue by removing 
one lib at a time and found "icu4j-3.4.4.jar" was causing that exception.

Original issue reported on code.google.com by pramod.w...@gmail.com on 17 Nov 2010 at 5:43

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,
"Ignoring InnerClasses attribute" is not an exception, it's a warning due to 
the fact that the icu4j library is compiled for compatibility with Java version 
1.3. I've just uploaded a new version of Androjena (0.4) featuring a recompiled 
version of icu4j with compatibility with Java 1.5, which eliminates that 
warnings during compilation.
Please try to use that: you have to reference as libraries the following files:
- androjena_0.4.jar
- icu4j_3.4.5.jar
- iri_0.8.jar
- slf4j-android-1.6.1-RC1.jar
DON'T REFERENCE androjena_0.4_sources.jar, it's just the source code! (some 
users did that, and had the same dx failure as you.) 

Anyway, I've just done a test compilation with your very same settings, and 
everything went fine, so it's not icu4j's fault.
The real error, in your case, is the failure of the dex tool, which doesn't 
give any clue about why it fails. You can find (and post here) additonal 
details in the workspace log (workspace_dir/.metadata/.log). Anyway, based on 
my experience, there are 2 possible causes for dx failure when compiling 
androjena:

1. inclusion of androjena sources (see above). Don't do that.
2. changing the build target of a project: the next compilation often results 
in a dx failure. To recover from that, (please try it even if you didn't change 
the build target, it's harmless and can happen in many other cases) follow 
these exact steps:

1. in eclipse, select your project in the package explorer
2. in the Project menu, uncheck the "Build Automatically" option
3. in the Project menu, choose "Clean"
4. Choose "Clean projects selected below", check only your project in the list, 
check "start a build immediately", choose "Build only the selected project"
5. After cleaning up, Eclipse should start a build from scratch, and this time 
it should be successful.

Please let me know if one of these solutions solves your problem, if not please 
post the workspace log and i'll investigate further.

Original comment by loreca...@gmail.com on 18 Nov 2010 at 4:47

GoogleCodeExporter commented 8 years ago
Thanks a lot! I will investigate further with new files.
Also I am not referring/using androjena_0.x_sources.jar file. 

Original comment by pamjag...@gmail.com on 18 Nov 2010 at 4:52

GoogleCodeExporter commented 8 years ago
With new files and following your instructions, I got same exceptions. After 
looking at  workspace log I think its more related with heap space constraints. 
I do have good configuration m/c with 3GB RAM. Please find workspace log file 
attached.

Original comment by pamjag...@gmail.com on 18 Nov 2010 at 5:17

Attachments:

GoogleCodeExporter commented 8 years ago
Yep, seems that Eclipse ran out of space during compilation. This is quite 
common with Android. There are two solutions:
1. If you have two or more open android projects, and they target different 
Android versions, Eclipse has to load and keep in memory all api data of every 
version: this can consume a lot of memory. A solution, quite obvious, is to 
close all projects but one, restart eclipse, and try to compile that single 
open project.
2. Even more obvious solution: give Eclipse more memory. In order to change 
Eclipse's maximum heap size limit, follow directions here: 
http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse
%3F

Anyway, you simply have to open the eclipse.ini file in your Eclipse 
installation directory, and add the following directives (or change them if 
already present):

-vmargs
-Xms128m
-Xmx1024m

These are my settings, and i can compile a huge project that uses androjena 
without problems.
Let me know if something works, bye!

Original comment by loreca...@gmail.com on 18 Nov 2010 at 5:35

GoogleCodeExporter commented 8 years ago
Hi pamjagtap,
did the last suggestion solve your problem? If yes, please tell me so I can 
close this and other related issues.

Original comment by loreca...@gmail.com on 22 Nov 2010 at 4:47

GoogleCodeExporter commented 8 years ago
Hi,

I used your Eclipse settings and it's not throwing that exceptions. I have to 
verify other issues yet but I think this one is closed.

Thanks for sharing ur settings.

Original comment by pamjag...@gmail.com on 22 Nov 2010 at 4:59

GoogleCodeExporter commented 8 years ago

Original comment by loreca...@gmail.com on 22 Nov 2010 at 6:11

GoogleCodeExporter commented 8 years ago

Original comment by loreca...@gmail.com on 23 Nov 2010 at 4:37