You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
[edited] @Extra fields should be updated when setIntent() is called #166
Probably the instructions are a little bit outdated, because naming of projects does not really match is seems, amongst other things.
For example have not "rest-api-test-1-5" project, but i do have a functional-test-1-5-tests instead. Is this the same?
Anyway, after a lot of fiddling, i managed to get junit to run tests, but now they fail because R is not found:
java.lang.Error: Unresolved compilation problems:
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
R cannot be resolved to a variable
at com.googlecode.androidannotations.test15.TouchesHandledActivity.<init>(TouchesHandledActivity.java:24)
at com.googlecode.androidannotations.test15.TouchesHandledActivity_.<init>(TouchesHandledActivity_.java:18)
at com.googlecode.androidannotations.test15.TouchesHandledActivityTest.setup(TouchesHandledActivityTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at com.xtremelabs.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:206)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Not build errors reported by eclise,
aa classes are generated fine
android generated files are on classpath
any ideas?
Any chance of looking through the instructions with todays code and update it? Im unfortunately not qualified myself at this point to know whats right and wrong here :)
You're definitely right : the documentation is not up to date. I have to rewrite them, and that means downloading a new clean eclipse, updating to the last version of all the maven / android / etc plugins, and carefully writing down each step.
I'll try to do that in the coming weeks, because I'd really like to get more contributions :) .
So, you seem to have a "R" not found when running the tests with robolectric. Is the R class actually generated in the first project?
Warning: an error occurred while binding shadow class: ShadowBluetoothAdapter
Warning: an error occurred while binding shadow class: ShadowBluetoothDevice
Warning: an error occurred while binding shadow class: ShadowGeoPoint
Warning: an error occurred while binding shadow class: ShadowItemizedOverlay
Warning: an error occurred while binding shadow class: ShadowMapController
Warning: an error occurred while binding shadow class: ShadowMapActivity
Warning: an error occurred while binding shadow class: ShadowMapView
Warning: an error occurred while binding shadow class: ShadowOverlayItem
Warning: an error occurred while binding shadow class: ShadowZoomButtonsController
Maybe this is a roboguice issue, it hangs on the sdk-line.. notice the comment
// Should always work from the command line. Often fails in IDEs because they don't pass the full PATH in the environment
try {
Process process = Runtime.getRuntime().exec(new String[]{"which", "android"});
String sdkPath = new BufferedReader(new InputStreamReader(process.getInputStream())).readLine();
sorry for spamming the thread, but after looking at that code it will obviously not work on windows. i will investigate this a bit myself, no need fgor you to waste time right now.
Ok, this was indeed the cause of the freeze.
After examinigng roboguice code a bit, it came clear that setting ANDROID_HOME was sufficient and now my tests run and pass (and apparently made my phone reboot :-)
Ok, I sent a pull request, lets hope for the best ;-)
Anyway, I saw this comment on the page that describes setting up dev env:
To see your changes in the code, you have to restart the 2nd eclipse. We didn't find any better solution, but tell us if you do!
I just run second eclipse in debug mode, then hot code replace will work and upon changes in code you can just clean the test projects or other projects you have in second eclipse.
You're right regarding the comment, I need to clean up things there :) . Hot code replace works, but only inside methods, if you modify signatures you need to restart it. I should give JRebel a try :) .
Activity
pyricau commentedon Apr 13, 2012
You are perfectly right. That's a bug, we need to fix it :) .
Brimstedt commentedon Apr 19, 2012
So, I thought Id have a go at this, but following the instructions on https://github.com/excilys/androidannotations/wiki/InstallingEnvironment I didnt manage to get things set up..
Probably the instructions are a little bit outdated, because naming of projects does not really match is seems, amongst other things.
For example have not "rest-api-test-1-5" project, but i do have a functional-test-1-5-tests instead. Is this the same?
Anyway, after a lot of fiddling, i managed to get junit to run tests, but now they fail because R is not found:
Not build errors reported by eclise,
aa classes are generated fine
android generated files are on classpath
any ideas?
Any chance of looking through the instructions with todays code and update it? Im unfortunately not qualified myself at this point to know whats right and wrong here :)
pyricau commentedon Apr 19, 2012
You're definitely right : the documentation is not up to date. I have to rewrite them, and that means downloading a new clean eclipse, updating to the last version of all the maven / android / etc plugins, and carefully writing down each step.
I'll try to do that in the coming weeks, because I'd really like to get more contributions :) .
So, you seem to have a "R" not found when running the tests with robolectric. Is the R class actually generated in the first project?
Brimstedt commentedon Apr 20, 2012
I see, and I understand if its not top priority.
Anyway, I got past the R problem too somehow (probably after messing with classpath, not sure :-P)
Now everything seems fine, except when I run unit tests they freeze.
for example the first one, has in its setup:
when TouchesHandledActivity_.onCreate calls its super method, then everything hangs on
any idea on this one? :)
Tried googling it a bit but didnt find anything that helped :-P
/L
Brimstedt commentedon Apr 20, 2012
I also get warnings like below, is this normal?
Warning: an error occurred while binding shadow class: ShadowBluetoothAdapter
Warning: an error occurred while binding shadow class: ShadowBluetoothDevice
Warning: an error occurred while binding shadow class: ShadowGeoPoint
Warning: an error occurred while binding shadow class: ShadowItemizedOverlay
Warning: an error occurred while binding shadow class: ShadowMapController
Warning: an error occurred while binding shadow class: ShadowMapActivity
Warning: an error occurred while binding shadow class: ShadowMapView
Warning: an error occurred while binding shadow class: ShadowOverlayItem
Warning: an error occurred while binding shadow class: ShadowZoomButtonsController
/L
Brimstedt commentedon Apr 20, 2012
Maybe this is a roboguice issue, it hangs on the sdk-line.. notice the comment
Brimstedt commentedon Apr 20, 2012
sorry for spamming the thread, but after looking at that code it will obviously not work on windows. i will investigate this a bit myself, no need fgor you to waste time right now.
Brimstedt commentedon Apr 20, 2012
Ok, this was indeed the cause of the freeze.
After examinigng roboguice code a bit, it came clear that setting ANDROID_HOME was sufficient and now my tests run and pass (and apparently made my phone reboot :-)
thanks for your patiance
Brimstedt commentedon Apr 20, 2012
I did not mean to close the issue.
pyricau commentedon Apr 20, 2012
Wow. You seem to progress quite well :) Sorry for not answering any earlier, I'm at a conference those days (Devoxx France).
Running the tests made your phone reboot ? That's quite unexpected. Are you running the tests on your phone ?
Brimstedt commentedon Apr 20, 2012
No need for appologies, hope youre having a good conference!
Now that i got things to compile and run, im halfway done with a fix of the
original issue. :)
/L
On Apr 20, 2012 1:49 PM, "Pierre-Yves Ricau" <
reply@reply.github.com>
wrote:
Brimstedt commentedon Apr 22, 2012
Ok, I sent a pull request, lets hope for the best ;-)
Anyway, I saw this comment on the page that describes setting up dev env:
I just run second eclipse in debug mode, then hot code replace will work and upon changes in code you can just clean the test projects or other projects you have in second eclipse.
pyricau commentedon Apr 23, 2012
I'll have a look at that :) .
You're right regarding the comment, I need to clean up things there :) . Hot code replace works, but only inside methods, if you modify signatures you need to restart it. I should give JRebel a try :) .
pyricau commentedon May 10, 2012
This issue was closed by 85da1fc.
We override
setIntent(). If a user wants to reinject the extras, he should overrideonNewIntent()and callsetIntent()from there.Also note that
@Extracan now only be used in Activities.Fixing a forgotten test that failed due to a rule change in #166.