I'm trying to implement maven into an existing android project.
I've done so through the context menu > Configure
> Convert to Maven project
. And everything seems okay, no warnings or errors.
But when I try to run the app (just like before) I get:
12-31 10:16:57.423: E/AndroidRuntime(14242): java.lang.RuntimeException:
Unable to instantiate activity ComponentInfo{xxx/xxx.MainActivity}:
java.lang.ClassNotFoundException: xxx.MainActivity
I've followd all the instructions on implementing m2e and everything looks like it should work.
If I don't convert the project to a maven project, the app runs fine.
Any suggestions where I'm failing?
This is what my pom.xml looks like: http://pastebin.com/ByXA0BP4
This took me ages to resolve and it was the OP's answer which guided me.
After enabling Maven for the project, you need to disable "Allow output folders for source folders"
Steps:
Project Properties
-> Java Build Path
-> Source Tab
-> Untick "Allow output folders for source folders"
-> Click OK
I also noticed that I got the following message in the console, which led me down a rabbit warren of false leads:
trouble writing output: already prepared
I figured it out myself.
After converting the project to a maven project, right click on the 'src' folder and chose Build path
> Use as Source Folder
Now the project runs fine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With