Android的记事本提供ClassNotFound的错误荷兰国际集团谷歌驱动器SDK范例 [英] Android Notepad provider classnotfound error ing google drive sdk examples

查看:197
本文介绍了Android的记事本提供ClassNotFound的错误荷兰国际集团谷歌驱动器SDK范例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从机器人研究谷歌驱动器快速入门后。我下载了他们的榜样,并得到这个错误:

After studying the google drive quickstart from android. I downloaded their example and got this error:

01-13 03:38:39.039: E/AndroidRuntime(29967): java.lang.RuntimeException: Unable to get provider com.example.android.notepad.NotePadProvider: java.lang.ClassNotFoundException: com.example.android.notepad.NotePadProvider in loader dalvik.system.PathClassLoader[/data/app/com.example.android.notepad-1.apk]
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.app.ActivityThread.installProvider(ActivityThread.java:3561)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.app.ActivityThread.installContentProviders(ActivityThread.java:3313)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3269)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.app.ActivityThread.access$2200(ActivityThread.java:117)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:973)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.os.Looper.loop(Looper.java:130)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.app.ActivityThread.main(ActivityThread.java:3687)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at java.lang.reflect.Method.invokeNative(Native Method)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at java.lang.reflect.Method.invoke(Method.java:507)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at dalvik.system.NativeStart.main(Native Method)
01-13 03:38:39.039: E/AndroidRuntime(29967): Caused by: java.lang.ClassNotFoundException: com.example.android.notepad.NotePadProvider in loader dalvik.system.PathClassLoader[/data/app/com.example.android.notepad-1.apk]
01-13 03:38:39.039: E/AndroidRuntime(29967):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
01-13 03:38:39.039: E/AndroidRuntime(29967):    at android.app.ActivityThread.installProvider(ActivityThread.java:3546)
01-13 03:38:39.039: E/AndroidRuntime(29967):    ... 12 more

我跟着指示这里。我在想什么吗?

I followed the instructions here. What am I missing here?

推荐答案

机会是你的Andr​​oid版本是旧的,因为这样的 ContentProvider.PipeDataWriter 加入到API 11向上又名蜂窝和更高版本。

Chances are your Android version is old, as this ContentProvider.PipeDataWriter was added into API 11 upwards aka Honeycomb and later.

注意在关键的行<一href="https://$c$c.google.com/p/google-drive-sdk-samples/source/browse/android/src/com/example/android/notepad/NotePadProvider.java#51"相对=nofollow>示例源

public class NotePadProvider extends ContentProvider 
                            implements 
                            PipeDataWriter<Cursor> {
    // SNIP 
}

纵观<一href="https://$c$c.google.com/p/google-drive-sdk-samples/source/browse/android/AndroidManifest.xml#30"相对=nofollow>样本的的Andr​​oidManifest.xml 决定所需的SDK的最低版本原始来源是16(即安卓冰淇淋三明治或更高版本)

Looking at the original source of the sample's AndroidManifest.xml dictates the minimum version of the SDK required is 16 (i.e. Android Ice Cream Sandwich or later)

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

在Android上的旧版本中运行它,即使最低版本改为反映当前的Andr​​oid版本,如SDK 9姜饼,8升级Froyo或7的巧克力慕斯蛋糕,将可怕的失败与 ClassNotFoundException的的ContentProvider 不执行 PipeDataWriter 早期版本的Andr​​oid系统。

Running it on a older version of Android even if the minimum version was changed to reflect your current Android version, such as SDK 9 for Gingerbread, 8 for Froyo or 7 for Eclair, it will fail horribly with the ClassNotFoundException as the ContentProvider does not implement PipeDataWriter due to being non-existant in earlier versions of Android.

这篇关于Android的记事本提供ClassNotFound的错误荷兰国际集团谷歌驱动器SDK范例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆