Android Question Problems running DJI application

Buks

Member
Licensed User
Longtime User
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
current process has android.permission.READ_PHONE_STATE
Add Runtimepermissions to your app. Request this permission.
The error is not related to DJI Library.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
i guess u must request this permission in the manifest file.
 
Upvote 0

Buks

Member
Licensed User
Longtime User
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

MarkusR

Well-Known Member
Licensed User
Longtime User
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:
Upvote 0
Top