Java.Lang.RuntimeException: 'Unable to создать экземпляр активности ComponentInfo{com.mycompany.test_maui/com.mycompany.test_maui.test_maui.MainActivity}:
java.lang.ClassNotFoundException: не найден класс "com.mycompany.test_maui.test_maui.MainActivity" по пути:
DexPathList[[zip file "/data/app/com.mycompany.test_maui-xpJaFrKRoLluech0atEfZQ==/base.apk"],
nativeLibraryDirectories=[/data/app/com.mycompany.test_maui-xpJaFrKRoLluech0atEfZQ ==/lib/arm64,
/data/app/com.mycompany.test_maui-xpJaFrKRoLluech0atEfZQ==/base.apk!/lib/arm64-v8a, /system/lib64, /hw_product/lib64, /system/ Product/lib64, /prets/lib64]]
Я попробовал несколько решений, в том числе убедился, что пространство имен в MainActivity.cs соответствует тому, что указано в AndroidManifest. .xml. Вот соответствующий код из моего файла AndroidManifest.xml и файла MainActivity.cs:
AndroidManifest.xml:
Код: Выделить всё
Код: Выделить всё
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Widget;
namespace test_maui
{
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Check if the activity was started from a link
if (Android.Content.Intent.ActionView.Equals(Intent.Action))
{
// Get the link
var elink = Intent.DataString;
// Display a message on screen with the link
Toast.MakeText(this, "ed2k Link: " + elink, ToastLength.Long).Show();
}
}
}
}
Надеюсь, это поможет вам ответить на вопросы.
Подробнее здесь: https://stackoverflow.com/questions/786 ... dexception