gpt4 book ai didi

android - 动态壁纸和引擎示例错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:22:19 26 4
gpt4 key购买 nike

我下载了 andengine live wallpaper example但它有一个问题。它显示这些错误:

08-18 04:38:52.606: E/AndroidRuntime(3063): FATAL EXCEPTION: main
08-18 04:38:52.606: E/AndroidRuntime(3063): java.lang.RuntimeException: Unable to instantiate service org.anddev.wallpaper.live.cigarette.LiveWallpaperService: java.lang.ClassNotFoundException: org.anddev.wallpaper.live.cigarette.LiveWallpaperService in loader dalvik.system.PathClassLoader[/data/app/org.anddev.wallpaper.live.cigarette-1.apk]
08-18 04:38:52.606: E/AndroidRuntime(3063): at android.app.ActivityThread.handleCreateService(ActivityThread.java:1950)
08-18 04:38:52.606: E/AndroidRuntime(3063): at android.app.ActivityThread.access$2500(ActivityThread.java:121)
08-18 04:38:52.606: E/AndroidRuntime(3063): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:997)
08-18 04:38:52.606: E/AndroidRuntime(3063): at android.os.Handler.dispatchMessage(Handler.java:99)
08-18 04:38:52.606: E/AndroidRuntime(3063): at android.os.Looper.loop(Looper.java:130)
08-18 04:38:52.606: E/AndroidRuntime(3063): at android.app.ActivityThread.main(ActivityThread.java:3701)
08-18 04:38:52.606: E/AndroidRuntime(3063): at java.lang.reflect.Method.invokeNative(Native Method)
08-18 04:38:52.606: E/AndroidRuntime(3063): at java.lang.reflect.Method.invoke(Method.java:507)
08-18 04:38:52.606: E/AndroidRuntime(3063): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
08-18 04:38:52.606: E/AndroidRuntime(3063): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
08-18 04:38:52.606: E/AndroidRuntime(3063): at dalvik.system.NativeStart.main(Native Method)
08-18 04:38:52.606: E/AndroidRuntime(3063): Caused by: java.lang.ClassNotFoundException: org.anddev.wallpaper.live.cigarette.LiveWallpaperService in loader dalvik.system.PathClassLoader[/data/app/org.anddev.wallpaper.live.cigarette-1.apk]
08-18 04:38:52.606: E/AndroidRuntime(3063): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
08-18 04:38:52.606: E/AndroidRuntime(3063): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
08-18 04:38:52.606: E/AndroidRuntime(3063): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
08-18 04:38:52.606: E/AndroidRuntime(3063): at android.app.ActivityThread.handleCreateService(ActivityThread.java:1947)
08-18 04:38:52.606: E/AndroidRuntime(3063): ... 10 more

这是我的 list :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.anddev.wallpaper.live.cigarette"
android:versionCode="4"
android:versionName="1.0.3">

<uses-sdk android:minSdkVersion="7" />

<uses-feature android:name="android.software.live_wallpaper" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
<service
android:name="LiveWallpaperService"
android:enabled="true"
android:icon="@drawable/icon"
android:label="@string/service_name"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter android:priority="1" >
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/wallpaper" />
</service>
</application>

</manifest>

我不知道这个错误是什么意思。我希望有人可以帮助我在这里运行这个东西..谢谢..

最佳答案

您的错误是 ClassNotFoundException,它与您的动态壁纸有关(org.anddev.wallpaper.live.cigarette)。所以我猜您的动态壁纸声明manifest 中的内容不正确(例如,它可能不在应用程序标签中,...)
您可以在以下页面的 list 中查看有关在 list 中声明服务的更多详细信息:
developer.android.com/guide/components/services.html
developer.android.com/reference/android/app/Service.html

编辑:
我看到了你的 list 。你的项目似乎没有 Main/Launcher Activity。如果你的项目没有 Main/Launcher Activity,你的服务就无法注册,所以当你尝试使用它们时,你获取 ClassNotFoundException
还要确保服务的完全限定类名称是 android.service.wallpaper.WallpaperService

关于android - 动态壁纸和引擎示例错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12015906/

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