user1297295
user1297295

Reputation: 101

android class path exception

I downloaded an example pf GLWallpaper, from here. I import the project as the readme file said. However, I got the "class not found" exception.

04-09 22:24:06.281: E/AndroidRuntime(31990): java.lang.RuntimeException: Unable to
instantiate service net.markguerra.android.glwallpaperexample.MyWallpaperService:
java.lang.ClassNotFoundException:
net.markguerra.android.glwallpaperexample.MyWallpaperService in loader
dalvik.system.PathClassLoader[/mnt/asec/net.markguerra.android.glwallpaperexample-1/pkg.apk]

I don't now what's wrong with it. The manifest xml has "MyWallpaperService" already.

<?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" />

I didn't change anything from the example code. and here is part of the "MyWallpaperService" class.

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();
}

Upvotes: 2

Views: 1062

Answers (2)

user1297295
user1297295

Reputation: 101

problem solved. In eclipse ADT17, need to put .jar in "libs" rather than "lib" folder.

Upvotes: 3

Pete
Pete

Reputation: 605

WallpaperService should be MyWallpaperService. try this instead in the manifest:

<intent-filter>
        <action android:name="android.service.wallpaper.MyWallpaperService" />
    </intent-filter>

Upvotes: 0

Related Questions