B Buks Member Licensed User Longtime User May 24, 2018 #1 I am trying to run the DroneFirst example which I downloaded from the DJI Drones page. I get the following error when the application starts: **************************** BaseApplication ************************** *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** java.lang.SecurityException: getDeviceId: Neither user 10121 nor current process has android.permission.READ_PHONE_STATE. at android.os.Parcel.readException(Parcel.java:1693) at android.os.Parcel.readException(Parcel.java:1646) at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:5139) at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:914) at dji.internal.e.a.f(Unknown Source) at dji.internal.e.a.c(Unknown Source) at dji.internal.e.a.a(Unknown Source) at dji.internal.e.a$1.run(Unknown Source) ** Activity (main) Pause, UserClosed = true **
I am trying to run the DroneFirst example which I downloaded from the DJI Drones page. I get the following error when the application starts: **************************** BaseApplication ************************** *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** java.lang.SecurityException: getDeviceId: Neither user 10121 nor current process has android.permission.READ_PHONE_STATE. at android.os.Parcel.readException(Parcel.java:1693) at android.os.Parcel.readException(Parcel.java:1646) at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:5139) at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:914) at dji.internal.e.a.f(Unknown Source) at dji.internal.e.a.c(Unknown Source) at dji.internal.e.a.a(Unknown Source) at dji.internal.e.a$1.run(Unknown Source) ** Activity (main) Pause, UserClosed = true **
DonManfred Expert Licensed User Longtime User May 24, 2018 #2 Buks said: current process has android.permission.READ_PHONE_STATE Click to expand... Add Runtimepermissions to your app. Request this permission. The error is not related to DJI Library. Upvote 0
Buks said: current process has android.permission.READ_PHONE_STATE Click to expand... Add Runtimepermissions to your app. Request this permission. The error is not related to DJI Library.
MarkusR Well-Known Member Licensed User Longtime User May 24, 2018 #3 i guess u must request this permission in the manifest file. Upvote 0
B Buks Member Licensed User Longtime User May 24, 2018 #4 This is part of the Manifest file: '************ DJI SDK '************ SetApplicationAttribute(android:name, "anywheresoftware.b4a.objects.BaseApplication") SetApplicationAttribute(android:largeHeap, "true") AddPermission(android.permission.BLUETOOTH) AddPermission(android.permission.BLUETOOTH_ADMIN) AddPermission(android.permission.VIBRATE) AddPermission(android.permission.INTERNET) AddPermission(android.permission.ACCESS_WIFI_STATE) AddPermission(android.permission.WAKE_LOCK) AddPermission(android.permission.ACCESS_COARSE_LOCATION) AddPermission(android.permission.ACCESS_NETWORK_STATE) AddPermission(android.permission.ACCESS_FINE_LOCATION) AddPermission(android.permission.CHANGE_WIFI_STATE) AddPermission(android.permission.MOUNT_UNMOUNT_FILESYSTEMS) AddPermission(android.permission.WRITE_EXTERNAL_STORAGE) AddPermission(android.permission.READ_EXTERNAL_STORAGE) AddPermission(android.permission.SYSTEM_ALERT_WINDOW) AddPermission(android.permission.READ_PHONE_STATE) AddManifestText( Upvote 0
This is part of the Manifest file: '************ DJI SDK '************ SetApplicationAttribute(android:name, "anywheresoftware.b4a.objects.BaseApplication") SetApplicationAttribute(android:largeHeap, "true") AddPermission(android.permission.BLUETOOTH) AddPermission(android.permission.BLUETOOTH_ADMIN) AddPermission(android.permission.VIBRATE) AddPermission(android.permission.INTERNET) AddPermission(android.permission.ACCESS_WIFI_STATE) AddPermission(android.permission.WAKE_LOCK) AddPermission(android.permission.ACCESS_COARSE_LOCATION) AddPermission(android.permission.ACCESS_NETWORK_STATE) AddPermission(android.permission.ACCESS_FINE_LOCATION) AddPermission(android.permission.CHANGE_WIFI_STATE) AddPermission(android.permission.MOUNT_UNMOUNT_FILESYSTEMS) AddPermission(android.permission.WRITE_EXTERNAL_STORAGE) AddPermission(android.permission.READ_EXTERNAL_STORAGE) AddPermission(android.permission.SYSTEM_ALERT_WINDOW) AddPermission(android.permission.READ_PHONE_STATE) AddManifestText(
MarkusR Well-Known Member Licensed User Longtime User May 24, 2018 #5 in newer android os its possible to overwrite this permissions and the app did not get this. hmm, try this Runtimepermissions that Manfred mentioned. Last edited: May 24, 2018 Upvote 0
in newer android os its possible to overwrite this permissions and the app did not get this. hmm, try this Runtimepermissions that Manfred mentioned.
Erel B4X founder Staff member Licensed User Longtime User May 24, 2018 #6 Quoting the tutorial: Two examples are attached: DroneFirst - A basic example for generic flights. DroneMission - Example of using WaypointMissionOperator to create a waypoint mission. The DroneMission demonstrates how to request the permissions when setting targetSdkVersion to 26. Upvote 0
Quoting the tutorial: Two examples are attached: DroneFirst - A basic example for generic flights. DroneMission - Example of using WaypointMissionOperator to create a waypoint mission. The DroneMission demonstrates how to request the permissions when setting targetSdkVersion to 26.
B Buks Member Licensed User Longtime User May 25, 2018 #7 Thank you very much. I managed to solve the permissions issue. Upvote 0