Android Question Issues with the Android Things

DC1

Member
Licensed User
Longtime User
I have sucessfully built, complied and tested the

So now moved on to this thread :-


using the that code and Manifest detail, I get the following error :-

Logger connected to: Android.local:5555
--------- beginning of main
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
(ArrayList) [BCM10, BCM11, BCM12, BCM13, BCM14, BCM15, BCM16, BCM17, BCM18, BCM19, BCM2, BCM20, BCM21, BCM22, BCM23, BCM24, BCM25, BCM26, BCM27, BCM3, BCM4, BCM5, BCM6, BCM7, BCM8, BCM9]
main_activity_create (java line: 362)
java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO
at android.os.Parcel.readException(Parcel.java:2013)
at android.os.Parcel.readException(Parcel.java:1959)
at com.google.android.things.pio.IPeripheralManagerClient$Stub$Proxy.GetGpioClient(IPeripheralManagerClient.java:759)
at com.google.android.things.pio.GpioImpl.<init>(GpioImpl.java:50)
at com.google.android.things.pio.PeripheralManager.openGpio(PeripheralManager.java:197)
at anywheresoftware.b4a.objects.PeripheralManagerWrapper.OpenGpio(PeripheralManagerWrapper.java:45)
at ph1lj.things4.main._activity_create(main.java:362)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at ph1lj.things4.main.afterFirstLayout(main.java:105)
at ph1lj.things4.main.access$000(main.java:17)
at ph1lj.things4.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
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)


Here is the manifest :-
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

'PER ANDROID THINGS
AddApplicationText(<uses-library android:name="com.google.android.things"/>)

''Launch activity automatically on boot (can remove if not needed)
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
)
AddPermission(com.google.android.things.permission.USE_PERIPHERAL_IO)
AddPermission(com.google.android.things.permission.MANAGE_INPUT_DRIVERS)


As you can see I added the permission for the USE_PERIPHERAL_IO - so what is going on ?

Note I also ensured the instruction are uptodate using v1.10, I'm using B4A v10.0 - and the Android thing v1.0.14

can anyone help ?
 
Last edited:
Top