Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Error using InstrumentationTestRunner with multiple projects
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
takashi  
View profile  
 More options Oct 8 2009, 1:42 am
From: takashi <t.hag...@gmail.com>
Date: Wed, 7 Oct 2009 22:42:41 -0700 (PDT)
Local: Thurs, Oct 8 2009 1:42 am
Subject: Error using InstrumentationTestRunner with multiple projects
My application is seperated into three projects in eclipse.
The first one is a client Android Project called "Project A".
The second is a server Android Project called "ProjectB".
Lastly, I have "ProjectATest" for testing that has references
dependencies to "ProjectA" and "ProjectB".

When excuting InstrumentationTestRunner in "ProjectATest," I get the
following error message:

[2009-10-08 13:11:47 - ProjectATest]Launching instrumentation
android.test.InstrumentationTestRunner on device emulator-5554
[2009-10-08 13:12:01 - ProjectATest]Test run failed: cross-loader
access from pre-verified class

This is the error as pulled from LogCat:

10-08 04:11:44.089: ERROR/AndroidRuntime(760): Uncaught handler:
thread main exiting due to uncaught exception
10-08 04:11:44.110: ERROR/AndroidRuntime(760):
java.lang.IllegalAccessError: cross-loader access from pre-verified
class
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
org.gynoid.db.ClassMetadata.initRelation(ClassMetadata.java:181)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
org.gynoid.GynApplication.onCreate(GynApplication.java:41)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
android.app.Instrumentation.callApplicationOnCreate
(Instrumentation.java:1045)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:
3622)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
android.app.ActivityThread.access$2500(ActivityThread.java:112)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1729)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
android.os.Handler.dispatchMessage(Handler.java:99)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
android.os.Looper.loop(Looper.java:123)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
android.app.ActivityThread.main(ActivityThread.java:3948)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
java.lang.reflect.Method.invokeNative(Native Method)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
java.lang.reflect.Method.invoke(Method.java:521)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
10-08 04:11:44.110: ERROR/AndroidRuntime(760):     at
dalvik.system.NativeStart.main(Native Method)

Has anyone been able to accomplish this or have any suggestions as to
what I am doing wrong?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brett Chabot  
View profile  
 More options Oct 13 2009, 11:31 pm
From: Brett Chabot <brettcha...@android.com>
Date: Tue, 13 Oct 2009 20:31:25 -0700
Local: Tues, Oct 13 2009 11:31 pm
Subject: Re: [android-developers] Error using InstrumentationTestRunner with multiple projects
I'm not sure what that exact error message means, but my guess is the
problem has to do with your test to project mapping. An
instrumentation (which is what your test project uses to access
classes in your project under test), can only be targeted to one
android application. Try splitting up your test project into
ProjectATest and ProjectBTest, and see if that helps.

Regards,
Brett.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carl H.  
View profile  
 More options Oct 19 2009, 12:27 pm
From: "Carl H." <charr...@gmail.com>
Date: Mon, 19 Oct 2009 09:27:07 -0700 (PDT)
Local: Mon, Oct 19 2009 12:27 pm
Subject: Re: Error using InstrumentationTestRunner with multiple projects
I get this error as well, I believe it depends on the order of imports
within your test project. If you have lib1 added to both the test and
tested project, you ll get something of that sort.... Still trying to
sort it out.

On Oct 14, 4:31 am, Brett Chabot <brettcha...@android.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ty  
View profile  
 More options Oct 25 2009, 3:37 pm
From: Ty <tseque...@hotmail.com>
Date: Sun, 25 Oct 2009 12:37:38 -0700 (PDT)
Local: Sun, Oct 25 2009 3:37 pm
Subject: Re: Error using InstrumentationTestRunner with multiple projects
Exactly...

Let me give you my example (and you can extrapolate it to your
situation)

I had project B that depends on project A (a set of exception classes
exported as an external jar)
Android Test project C called classes in project B and raised expected
exceptions defined in project A (depending on project A as an external
jar) which caught (as negative tests)

When I ran these tests (as Android JUnit tests) I got the same (cross-
loader) error

I removed external jar dependency of A from project C and everything
ran perfectly after that

Regards

Ty

On Oct 19, 9:27 am, "Carl H." <charr...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
takashi  
View profile  
 More options Nov 2 2009, 2:39 am
From: takashi <t.hag...@gmail.com>
Date: Sun, 1 Nov 2009 23:39:09 -0800 (PST)
Local: Mon, Nov 2 2009 2:39 am
Subject: Re: Error using InstrumentationTestRunner with multiple projects
Thank you everyone for your replies.

I was able to resolve this error. As hinted above, the problem lied in
my project settings.
In my test project, instead of referencing project B directly, I was
able to export the class files from project A.
(Under the "Order and Export" tab in the "Java Build Path" pane.)

This gave me access to all the classes I needed in my test project.

Thanks again for everyone's help.

takashi

On 10月26日, 午前4:37, Ty <tseque...@hotmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »