Android Question Compile B4A 6.30

MarcoRome

Expert
Licensed User
Longtime User
Hi Erel, all.
I have a app that when i compile in B4A 6.00 also with targetSdkVersion = 23 about device with Android 6.0.1 ( Samsung S7 )
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
run without problem.

If i compile with B4A 6.30 i have crash this app and this error:

LogCat connected to: ce0616068410b73802
--------- beginning of main
** Activity (main) Pause, UserClosed = false **
** Activity (act_richiesta_nuova_registrazione) Create, isFirst = true **
** Activity (act_richiesta_nuova_registrazione) Resume **
** Activity (act_richiesta_nuova_registrazione) Pause, UserClosed = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
--------- beginning of system
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 360)
java.lang.SecurityException: getDeviceId: Neither user 10223 nor current process has android.permission.READ_PHONE_STATE.
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:5371)
at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:812)
at anywheresoftware.b4a.phone.Phone$PhoneId.GetDeviceId(Phone.java:424)
at it.vendingmanager.distributori.automatici.main._activity_create(main.java:360)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at it.vendingmanager.distributori.automatici.main.afterFirstLayout(main.java:102)
at it.vendingmanager.distributori.automatici.main.access$000(main.java:17)
at it.vendingmanager.distributori.automatici.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Now understand that problem is this:
java.lang.SecurityException: getDeviceId: Neither user 10223 nor current process has android.permission.READ_PHONE_STATE

and i can correct this with Runtime Permission or if i insert targetSdkVersion = 22

But the question is why about B4A 6.00 is ok (same code ) and B4A 6.30 crash ??
Thank you
 

MarcoRome

Expert
Licensed User
Longtime User
Maybe you are right.
The strain think is this: yesterday I compiled with B4a 6.0. And targetsdk 23.
With Samsung s7 android 6.01 all work when I compiled ( note I have device connect with b4a in USB port ).
After that I publish this app in play store. If I try install.... crash again.
Any idea ? Maybe in "local" run because haven't need this permission ( with connect USB)
Anyway this moorning I compiled with 6.30 and targetsdk 22. I post this in play store we will see what happen.
Thank you
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Well... when compile with USB connect all permission you already have.
And B4A 6.30 work very well
That all
Welcome Great B4A 6.30
 
Upvote 0
Top