Android Question [Solved] StdActionBar error in Android 9 Pie

Cebuvi

Active Member
Licensed User
Longtime User
Hello,

Yesterday my smartphone (samsung S8) is updated to Android 9 Pie and applications that use the StdActionBar library give an error and stop.

I have verified that this happens when in the manifest I have: "targetSdkVersion = "28". With targetSdkVersion = "23" , everything works correctly.

This is the error that occurs:

Error occurred on line: 189 (Act_Coordenadas)
java.lang.RuntimeException: java.lang.IllegalArgumentException: Cannot set 'scaleY' to Float.NaN
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at com.tempusumbra.solarwidget.act_coordenadas.afterFirstLayout(act_coordenadas.java:104)
at com.tempusumbra.solarwidget.act_coordenadas.access$000(act_coordenadas.java:17)
at com.tempusumbra.solarwidget.act_coordenadas$WaitForLayout.run(act_coordenadas.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7045)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: java.lang.IllegalArgumentException: Cannot set 'scaleY' to Float.NaN
at android.view.View.sanitizeFloatPropertyValue(View.java:17000)
at android.view.View.sanitizeFloatPropertyValue(View.java:16974)
at android.view.View.setScaleY(View.java:16400)
at android.animation.PropertyValuesHolder.nCallFloatMethod(Native Method)
at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081)
at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227)
at android.animation.AnimatorSet.start(AnimatorSet.java:729)
at android.animation.AnimatorSet.start(AnimatorSet.java:684)
at anywheresoftware.b4a.objects.ViewWrapper.AnimateFrom(ViewWrapper.java:461)
at anywheresoftware.b4a.keywords.LayoutBuilder.animateLayout(LayoutBuilder.java:191)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:165)
... 17 more

It's happening in an application that I have on Google Play. Can someone help me solve the problem?
Thank you.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
Thank you very much for such a quick response.
With max = 26 also works, I'll leave it like this until there's a definitive solution.
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
Hello
I tested with the TabStripViewPager library and max = 28 and it does not work either.
I'll wait.
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
Hello

I had a hard time isolating the problem, but I think I've located it. It is produced when loading a layout where there is a Mapfragment.

With targetSdkVersion set to 26, no problem on Android 8 and android 9. When you switch to targetSdkVersion=28 everything works correctly on Android 8 and a virtual device like Genymotion with Android 9, but on an real S8 smartphone with Android 9 the app stops.

I can't send you an example because the system tells me it's too big (9mb). How can I send it to you?

Thank you
 
Upvote 0

Cebuvi

Active Member
Licensed User
Longtime User
Thank you Erel.

The error message is not always the same. In the last test, there was not even an error log. The app stopped and nothing else.

The text to be added to the manifest is always added or only when Google Maps is in TabStrip or StdViewPager?

Thanks.
 
Upvote 0

vikingivesterled

Active Member
Licensed User
Longtime User
Now Google demands targetversion 28 for its playstore and I am getting the same error when running on my Samsung S10e Android version 9 at the spot of loading the layout, even if I add the recommended AddApplicationText to the manifest.
Have tried it with 2 different apps.
The map is anchored horisontally to both sides.
If I say ok to continue when error comes up on screen, it displays the map in it's window in the initial worldwide stage of before I add points/lines and refocus it.

Error below:

reportupload_activity_create (java line: 462)
java.lang.RuntimeException: java.lang.IllegalArgumentException: Cannot set 'scaleY' to Float.NaN
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at marineloggerplus.moonc.mobi.reportupload._activity_create(reportupload.java:462)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at marineloggerplus.moonc.mobi.reportupload.afterFirstLayout(reportupload.java:104)
at marineloggerplus.moonc.mobi.reportupload.access$000(reportupload.java:17)
at marineloggerplus.moonc.mobi.reportupload$WaitForLayout.run(reportupload.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7037)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Caused by: java.lang.IllegalArgumentException: Cannot set 'scaleY' to Float.NaN
at android.view.View.sanitizeFloatPropertyValue(View.java:17006)
at android.view.View.sanitizeFloatPropertyValue(View.java:16980)
at android.view.View.setScaleY(View.java:16406)
at android.animation.PropertyValuesHolder.nCallFloatMethod(Native Method)
at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
at android.animation.ValueAnimator.startWithoutPulsing(ValueAnimator.java:1081)
at android.animation.AnimatorSet.handleAnimationEvents(AnimatorSet.java:1142)
at android.animation.AnimatorSet.startAnimation(AnimatorSet.java:1227)
at android.animation.AnimatorSet.start(AnimatorSet.java:729)
at android.animation.AnimatorSet.start(AnimatorSet.java:684)
at anywheresoftware.b4a.objects.ViewWrapper.AnimateFrom(ViewWrapper.java:461)
at anywheresoftware.b4a.keywords.LayoutBuilder.animateLayout(LayoutBuilder.java:191)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:165)
... 14 more
java.lang.RuntimeException: java.lang.IllegalArgumentException: Cannot set 'scaleY' to Float.NaN
** Activity (reportupload) Resume **
 
Upvote 0

Ganiadi

Active Member
Licensed User
Longtime User
Hi Erel,

I have below code that works fine on targetSDK = 26

GetSignKey:
Sub GetSignKey()
Dim lJson As String= "{""privatkey"": ""A79AAA9D10BE3D4386D10144E267B683"",    ""password"": ""A9CCF3EAC9A4901908C5159B8E1CBC1D""}"
Dim job2 As HttpJob
Dim Json As JSONParser
Dim Map1 As Map
cToken = ""
Try
    job2.Initialize("Job2", Me)
    job2.PostString("http://xxxxx/getapiauth/getencryptsign.ashx", lJson)
    job2.GetRequest.SetContentType("application/json")
    wait for (job2) JobDone(job2 As HttpJob)
    Log(job2.Success)
    Log("Result : " & job2.GetString)
    If job2.Success Then
        Json.Initialize (job2.GetString)
        Map1 = Json.NextObject
        cToken = Map1.get("sign")
    End If
        
Catch
    Log(LastException)
End Try
job2.release

End Sub


But when i want to upload to APP Store i have to change it to targetSDK=28
and job2.Success always return false ( error ).

Pls advice..


Tks
 
Upvote 0

Ganiadi

Active Member
Licensed User
Longtime User
Hi Erel,

I have below code that works fine on targetSDK = 26

GetSignKey:
Sub GetSignKey()
Dim lJson As String= "{""privatkey"": ""A79AAA9D10BE3D4386D10144E267B683"",    ""password"": ""A9CCF3EAC9A4901908C5159B8E1CBC1D""}"
Dim job2 As HttpJob
Dim Json As JSONParser
Dim Map1 As Map
cToken = ""
Try
    job2.Initialize("Job2", Me)
    job2.PostString("http://xxxxx/getapiauth/getencryptsign.ashx", lJson)
    job2.GetRequest.SetContentType("application/json")
    wait for (job2) JobDone(job2 As HttpJob)
    Log(job2.Success)
    Log("Result : " & job2.GetString)
    If job2.Success Then
        Json.Initialize (job2.GetString)
        Map1 = Json.NextObject
        cToken = Map1.get("sign")
    End If
       
Catch
    Log(LastException)
End Try
job2.release

End Sub


But when i want to upload to APP Store i have to change it to targetSDK=28
and job2.Success always return false ( error ).

Pls advice..


Tks

Hi Erel,

Please disregard, i have solved it by adding below script into manifest editor

SetApplicationAttribute(android:networkSecurityConfig, @xml/network_security_config)
CreateResource(xml, network_security_config.xml,
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>

)

[SOLVED]
 
Upvote 0
Top