Hm, so I spent some more time on this. I think what I need to do is to
figure out how to tell ant to not re-build the
com.google.common.annotations.GwtCompatible when it compiles the
core.xml, and to instead use the one that is already compiled in the
google-collect-1.0-rc1.jar

Not sure why plain old java can handle this re-declaration with no
problems, while the dalvik converter fails

If anyone has a good link for how to do this in ant, that would be
awesome. I am totally new to it so it might take me a day or so to
figure this out :(


Hamy

On May 26, 11:41 pm, Hamy <[email protected]> wrote:
> Hey all,
>
> I am trying to use the GData libs on android. I have created a Java
> project in eclipse that runs perfectly. However, whenever I try to
> create an android project, I get a conversion failed error, due to a
> class being included twice. I think this is more likely something to
> do with my GData build having two jars, both of which are required,
> but which re-declare the same class. I would love any help - below are
> all project details.
>
> This is definitely something specific to android, but as it seems that
> I may have to modify the GData source a bit to get it to work, I was
> hoping someone could give a workaround.
>
> Thanks,
> hamilton
>
> Code:
> package org.test.documents;
>
> import java.net.URL;
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.widget.TextView;
>
> import com.google.gdata.client.calendar.CalendarService;
> import com.google.gdata.data.calendar.CalendarEntry;
> import com.google.gdata.data.calendar.CalendarFeed;
>
> public class Sample extends Activity {
>         /** Called when the activity is first created. */
>         @Override
>         public void onCreate(Bundle savedInstanceState) {
>                 super.onCreate(savedInstanceState);
>                 setContentView(R.layout.main);
>
>                 String out = "";
>                 try {
>                         CalendarService myService = new CalendarService(
>                                         "exampleCo-exampleApp-1.0");
>                         myService.setUserCredentials("[email protected]", 
> "crabpot9");
>
>                         URL feedUrl = new URL(
>                                         
> "http://www.google.com/calendar/feeds/default/allcalendars/
> full");
>                         CalendarFeed resultFeed = myService.getFeed(feedUrl,
>                                         CalendarFeed.class);
>
>                         out += "Your calendars:\n\n";
>
>                         for (int i = 0; i < resultFeed.getEntries().size(); 
> i++) {
>                                 CalendarEntry entry = 
> resultFeed.getEntries().get(i);
>                                 out += "\t" + entry.getTitle().getPlainText() 
> + "\n";
>                         }
>                 } catch (Exception e) {
>                                 out = "No good";
>                 }
>
>                 TextView tv = (TextView)findViewById(R.id.text);
>                 tv.setText(out);
>                 tv.invalidate();
>
>         }
>
> }
>
> Jars added:
> gdata-calendar-2.0
> gdata-calendar-meta-2.0
> gdata-core-1.0
> google-collect-1.0-rc1
>
> Errors:
> [2009-05-26 23:40:30 - google-docs-test-android]
> UNEXPECTED TOP-LEVEL EXCEPTION:
> java.lang.IllegalArgumentException: already added: Lcom/google/common/
> annotations/GwtCompatible;
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:
> 123)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.dex.file.DexFile.add(DexFile.java:143)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.command.dexer.Main.processClass(Main.java:299)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.command.dexer.Main.access$100(Main.java:56)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.cf.direct.ClassPathOpener.processArchive
> (ClassPathOpener.java:245)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.cf.direct.ClassPathOpener.processOne
> (ClassPathOpener.java:130)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:
> 108)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.command.dexer.Main.processOne(Main.java:245)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.dx.command.dexer.Main.run(Main.java:139)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> java.lang.reflect.Method.invoke(Method.java:585)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown Source)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:
> 633)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.BuildManager.basicBuild
> (BuildManager.java:170)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.BuildManager.basicBuild
> (BuildManager.java:201)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:
> 253)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.BuildManager.basicBuild
> (BuildManager.java:256)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.BuildManager.basicBuildLoop
> (BuildManager.java:309)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:
> 341)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.AutoBuildJob.doBuild
> (AutoBuildJob.java:140)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:
> 238)
> [2009-05-26 23:40:30 - google-docs-test-android]        at
> org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> [2009-05-26 23:40:30 - google-docs-test-android] 1 error; aborting
> [2009-05-26 23:40:30 - google-docs-test-android] Conversion to Dalvik
> format failed with error 1
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data Protocol" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to