0

From Android Studio, I have imported a previous non-Gradle Android project from Eclipse.

It includes ABS and runs in Eclipse without problem.

It compiles error free in Android Studio. However, every single time I run it, it doesn't just run as it does in Eclipse, it goes into some test mode and gives the following output.

Running tests
Test running startedTest running failed: Unable to find instrumentation info for: ComponentInfo{com.my.package/android.test.InstrumentationTestRunner}
Empty test suite.

Then doesn't open up at all.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
mgibson
  • 6,103
  • 4
  • 34
  • 49
  • Is `com.my.package` your real package name? Verify the package specified in `AndroidManifest.xml` files, it should match in test and app modules and was probably replaced with a dummy one when importing. Compare with your original Eclipse project and fix the manifest files. – CrazyCoder May 28 '13 at 01:01

2 Answers2

0

Try to include word 'test' in your methods I have faced it and have to name all methods like testIfOneIsOne or OneIsOneTest(not sure now what order I used). Also: Are You use same version of junit on both eclipse/intelij?

Axxxon
  • 703
  • 2
  • 11
  • 27
  • Well I ideally don't really want any testing right now, not overly familiar with it and will get some testing going in due time. At the moment, I have deleted the test directory and just want it to go away and be like Eclipse :) Eclipse doesn't show a test directory like Android Studio. You are suggesting I rename all my methods and include "test" in them? Any elaboration on that? Again, I want to try and avoid all testing right now, it is early stages – mgibson May 27 '13 at 19:44
  • @migbson You are using maven or ant to build app? – Axxxon May 27 '13 at 19:48
  • Neither, I had a straightforward Eclipse project which worked great. I imported that project from Existing Source into Android Studio.. however when I run it in AS, It always comes up with these test messages that just don't exist when I run it in Eclipse – mgibson May 27 '13 at 19:50
  • @migbson Have You checked configuration after import(I know that import from eclipse doesn't have to go well), also unchecking test as testfolder in project settings doesn't help(ctrl+alt+shift+s)->sources? – Axxxon May 27 '13 at 19:58
  • I checked the config, test was there in the ABS source albeit red, so I deleted that. Strangely when I look at the src of my app, it is all excluded.. seemingly won't change either. – mgibson May 27 '13 at 20:10
0

try checking my solution here. ABS includes junit which might be running for you. Try following my solution here: Problems importing project into Android Studio regarding ActionBarSherlock

Below is the detail which will hopefully also work in your case. Specifically check step 4)

The steps below allowed me to get ActionBarSherlock running with no issues.

1) Download latest ABS here: [http://actionbarsherlock.com/][1]

2) Extract ABS you should have a directory in there called "actionbarsherlock". Copy that to your Android Studio workspace. and rename to ActionBarSherlock (changed casing) -- > I now have my Android Studio Projects under \*documents*\Android Workspace\ As opposed to \Eclipse Workspace\

So you should now have something like :

\*documents*\Android Workspace\ActionBarSherlock\

Along with your main project maybe:

\*documents*\Android Workspace\TestProject\

3) Open Android Studio load your TestProject then goto File> Import Module... Now navigate to ActionBarSherlock under \*documents*\Android Workspace\ActionBarSherlock\ Click Ok and next all the way to finish. It will ask if you want to set a dependancy to the new Module (or at least mine did) click OK

4) at this point when compiling I was getting errors in \ActionBarSherlock\test\ complaining about Junit. I simply deleted the \Test\ directory from my ABS Module under project view. Right click \test\ > Delete.... You could also include the junit jar file but I don't think its necessary

5) you should now be able to compile without errors

Community
  • 1
  • 1
wired00
  • 13,930
  • 7
  • 70
  • 73