When I try to send:
WearService.wear.SendMessage("/MyApp","4e697298","Testing")
java.lang.NullPointerException: Attempt to read from field 'android.content.Context anywheresoftware.b4a.BA.context' on a null object reference
at com.ab.abwearos.ABWearOS$SendMessageThread.run(ABWearOS.java:178)
at java.lang.Thread.run(Thread.java)
** Activity (main) Pause, UserClosed = true **
These are the errors I get at startup:
Logger connected to: 4e697298
--------- beginning of system
--------- beginning of main
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (wearservice) Create ***
** Service (wearservice) Start **
PackageAdded: package:com.ab.weardemo
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (wearservice) Create ***
** Service (wearservice) Start **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (wearservice) Create ***
** Service (wearservice) Start **
Testing ... sent...
java.lang.NullPointerException: Attempt to read from field 'android.content.Context anywheresoftware.b4a.BA.context' on a null object reference
at com.ab.abwearos.ABWearOS$SendMessageThread.run(ABWearOS.java:178)
at java.lang.Thread.run(Thread.java)
** Activity (main) Pause, UserClosed = true **
** Service (wearservice) Destroy **
PackageAdded: package:com.ab.weardemo
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ab.weardemo/com.ab.weardemo.main}: java.lang.IllegalStateException: Could not find wearable shared library classes. Please add <uses-library android:name="com.google.android.wearable" android:required="false" /> to the application manifest
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2661)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.IllegalStateException: Could not find wearable shared library classes. Please add <uses-library android:name="com.google.android.wearable" android:required="false" /> to the application manifest
at android.support.wear.ambient.SharedLibraryVersion.verifySharedLibraryPresent(SharedLibraryVersion.java:57)
at android.support.wear.ambient.WearableControllerProvider.getWearableController(WearableControllerProvider.java:48)
at android.support.wear.ambient.AmbientDelegate.onCreate(AmbientDelegate.java:103)
at android.support.wear.ambient.AmbientModeSupport.onCreate(AmbientModeSupport.java:198)
at android.support.v4.app.Fragment.performCreate(Fragment.java:2414)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:620)
at com.ab.weardemo.main.onStart(main.java:175)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1234)
at android.app.Activity.performStart(Activity.java:6258)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2624)
... 10 more
PackageAdded: package:com.ab.weardemo
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ab.weardemo/com.ab.weardemo.main}: java.lang.IllegalStateException: Could not find wearable shared library classes. Please add <uses-library android:name="com.google.android.wearable" android:required="false" /> to the application manifest
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2661)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.IllegalStateException: Could not find wearable shared library classes. Please add <uses-library android:name="com.google.android.wearable" android:required="false" /> to the application manifest
at android.support.wear.ambient.SharedLibraryVersion.verifySharedLibraryPresent(SharedLibraryVersion.java:57)
at android.support.wear.ambient.WearableControllerProvider.getWearableController(WearableControllerProvider.java:48)
at android.support.wear.ambient.AmbientDelegate.onCreate(AmbientDelegate.java:103)
at android.support.wear.ambient.AmbientModeSupport.onCreate(AmbientModeSupport.java:198)
at android.support.v4.app.Fragment.performCreate(Fragment.java:2414)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:620)
at com.ab.weardemo.main.onStart(main.java:175)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1234)
at android.app.Activity.performStart(Activity.java:6258)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2624)
... 10 more
PackageAdded: package:com.ab.weardemo
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
PackageAdded: package:com.ab.weardemo
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (wearservice) Create ***
** Service (wearservice) Start **
Testing ... sent...
java.lang.NullPointerException: Attempt to read from field 'android.content.Context anywheresoftware.b4a.BA.context' on a null object reference
at com.ab.abwearos.ABWearOS$SendMessageThread.run(ABWearOS.java:178)
at java.lang.Thread.run(Thread.java)
** Activity (main) Pause, UserClosed = true **
** Service (wearservice) Destroy **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (wearservice) Create ***
** Service (wearservice) Start **
PackageAdded: package:com.ab.weardemo
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (wearservice) Create ***
** Service (wearservice) Start **