我正在尝试运行一些Android动态壁纸教程示例,但总是出现以下错误:
09-28 16:13:30.729: E/AndroidRuntime(408): java.lang.RuntimeException: 无法实例化服务 net.markguerra.android.glwallpaperexample.MyWallpaperService: java.lang.ClassNotFoundException: net.markguerra.android.glwallpaperexample.MyWallpaperService在加载器中不存在 dalvik.system.PathClassLoader[/data/app/net.markguerra.android.glwallpaperexample-1.apk]
这是我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.markguerra.android.glwallpaperexample"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<service android:label="@string/service_label" android:name=".MyWallpaperService"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data android:name="android.service.wallpaper"
android:resource="@xml/myglwallpaper" />
</service>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
我创建的壁纸服务
package net.markguerra.android.glwallpaperexample;
import net.rbgrn.android.glwallpaperservice.*;
// Original code provided by Robert Green
// http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers
public class MyWallpaperService extends GLWallpaperService {
public MyWallpaperService() {
super();
}
public Engine onCreateEngine() {
MyEngine engine = new MyEngine();
return engine;
}
class MyEngine extends GLEngine {
MyRenderer renderer;
public MyEngine() {
super();
// handle prefs, other initialization
renderer = new MyRenderer();
setRenderer(renderer);
setRenderMode(RENDERMODE_CONTINUOUSLY);
}
public void onDestroy() {
super.onDestroy();
if (renderer != null) {
renderer.release();
}
renderer = null;
}
}
}
这是我的项目结构:
我无法确定其中的问题,出现了什么错误?任何建议都将对我有很大帮助。
在堆栈上找到了一些相关问题,但与动态壁纸无关。