gpt4 book ai didi

android - 由 : java. lang.ClassNotFoundException: Didn't find class "com.example.aol.Application"on path: DexPathList error flutter 引起

转载 作者:行者123 更新时间:2023-12-03 23:45:21 28 4
gpt4 key购买 nike

我正在尝试运行一个项目,但我发现了一个错误:

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.aol.Application" on path: DexPathList[[zip file "/data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/lib/arm64, /data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]

那么有没有人知道以下错误:

error

这是相关的 list

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.aol" xmlns:tools="http://schemas.android.com/tools">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<application
android:name=".Application"
tools:replace="android:label"
android:label="aol"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

</activity>
<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="${applicationId}.braintree" />
</intent-filter>
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<!-- TODO: Replace with your real AdMob app ID -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value= "@string/android__admob_ads_id_key" />
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
</application>
</manifest>


这是完整的错误:

Launching lib\main.dart on Redmi 5 in debug mode...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk... 38.0s
E/AndroidRuntime(14356): FATAL EXCEPTION: main
E/AndroidRuntime(14356): Process: com.example.aol, PID: 14356
E/AndroidRuntime(14356): java.lang.RuntimeException: Unable to instantiate application com.example.aol.Application: java.lang.ClassNotFoundException: Didn't find class "com.example.aol.Application" on path: DexPathList[[zip file "/data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/lib/arm64, /data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
E/AndroidRuntime(14356): at android.app.LoadedApk.makeApplication(LoadedApk.java:993)
E/AndroidRuntime(14356): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5801)
E/AndroidRuntime(14356): at android.app.ActivityThread.-wrap1(Unknown Source:0)
E/AndroidRuntime(14356): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1685)
E/AndroidRuntime(14356): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(14356): at android.os.Looper.loop(Looper.java:176)
/AndroidRuntime(14356): at android.app.ActivityThread.main(ActivityThread.java:6651)
E/AndroidRuntime(14356): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14356): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
E/AndroidRuntime(14356): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
E/AndroidRuntime(14356): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.aol.Application" on path: DexPathList[[zip file "/data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/lib/arm64, /data/app/com.example.aol-1JWhf7hk26dkh1US0WG4tg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
E/AndroidRuntime(14356): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
E/AndroidRuntime(14356): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(14356): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(14356): at android.app.Instrumentation.newApplication(Instrumentation.java:1088)
E/AndroidRuntime(14356): at android.app.LoadedApk.makeApplication(LoadedApk.java:987)
E/AndroidRuntime(14356): ... 9 more

最佳答案

我遇到了同样的错误。在我的例子中,Application.java 文件位于 main/java/ 下。我通过在 java 文件夹下创建另一个文件夹来解决它,并将应用程序文件放入其中,因此路径如下; main/java/your_folder_name/Application.java。不要忘记更新 AndroidManifest 文件中的新路径,这样它就变成了这样的:

.
.
.
<application
<!--Here-->
android:name=".your_folder_name.Application"
tools:replace="android:label"
android:label="aol"
android:icon="@mipmap/ic_launcher">

另一个原因,也可能是因为您的 Application.java 与您在 AndroidManifest 中指定的包不同。

关于android - 由 : java. lang.ClassNotFoundException: Didn't find class "com.example.aol.Application"on path: DexPathList error flutter 引起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63158633/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com