Android thing run time exception:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/things/pio/PeripheralManager;
Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidthings.simplepio">
<application android:allowBackup="true" android:icon="@android:drawable/sym_def_app_icon"
android:name="android.support.multidex.MultiDexApplication"
android:label="@string/app_name">
<uses-library android:name="com.google.android.things"/>
<activity android:name=".BlinkActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Launch activity automatically on boot -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.IOT_LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
This is my code, I got this from this Link, I just clone it nothing changed.
Error logcat:
01-01 00:00:53.293 1326-1326/com.example.androidthings.simplepio E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.androidthings.simplepio, PID: 1326
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/things/pio/PeripheralManager;
at com.example.androidthings.simplepio.BlinkActivity.onCreate(BlinkActivity.java:51)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Activity.performCreate(Activity.java:6991)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.things.pio.PeripheralManager" on path: DexPathList[[zip file "/system/framework/com.google.android.things.jar", zip file "/data/app/com.example.androidthings.simplepio-y-kMOBHPpOQbWFdWf4QeXw==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.androidthings.simplepio-y-kMOBHPpOQbWFdWf4QeXw==/lib/arm, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.example.androidthings.simplepio.BlinkActivity.onCreate(BlinkActivity.java:51)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Activity.performCreate(Activity.java:6991)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteIncode,807)
01-01 00:00:53.446 1326-1326/com.example.androidthings.simplepio I/Process: Sending signal. PID: 1326 SIG: 9
Please help me in solving this problem.