Reputation: 7452
I get a Java.Lang.NoClassDefFoundError error when creating an Intent of a custom class (an Activity). According to this tutorial this means that class is not found at run-time. It's certainly found at design-time as the project compiles successfully. I have tried manually setting assemblies' path at Project -> Properties -> Reference Paths but the error doesn't go away. I tried with a simpler project with a custom Activity on the same file as the parent activity and runs fine. Where should I set Java's ClassPath in Mono for Android or what should I do to solve this issue?
Thanks in advance.
Upvotes: 1
Views: 828
Reputation: 10139
It sounds like you haven't registered your activity with the manifest. You can do this manually, but the better approach is to decorate your activity class with ActivityAttribute, like this:
[Activity(Label = "Activity Label", MainLauncher = true)]
public class CustomActivity : Activity
Once you do that, the manifest entry will be generated for you.
Upvotes: 1
Reputation: 12664
It is not a classpath issue. You need to add the class to your manifest file, for example:
<activity android:name="yourpackage.YourClass" android:label="@string/your_title" />
Barry
Upvotes: 1