Hello,
Welcome to our Microsoft Q&A platform!
Unable to instantiate activity ComponentInfo{com.companyname.appname/appname.Droid.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "appname.Droid.MainActivity"
You can try to open up your MainActivity and within the ActivityAttribute
on your MainActvity
class, add a fully qualified name within a Name
parameter of that attribute, this will force the Xamarin.Android build process to use a Java-class name of your choosing vs. the MD5-based one and thus it will match your manifest entry.
Example:
[Activity(Name = "MyApp.Mobile.Droid.MainActivity", Label = "MyApp", MainLauncher = true, Icon = "@mipmap/icon")]
public class MainActivity : Activity
{
//...
}
For more details, you can check: https://learn.microsoft.com/en-us/xamarin/android/platform/android-manifest
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.