Android Question [Solved] StdActionBar error in Android 9 Pie

Cebuvi

Active Member
Licensed 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.
 

Cebuvi

Active Member
Licensed 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.
 

Cebuvi

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

Erel

Administrator
Staff member
Licensed User
I'm unable to reproduce it. Can you upload the layout file that causes this issue with targetSdkVersion set to 28?
 

Cebuvi

Active Member
Licensed 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
 

Erel

Administrator
Staff member
Licensed User
I see an error with Google Maps. It is different than the one from the first post. You need to add this to the manifest editor and it will work:
B4X:
AddApplicationText(
<uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />
)
 

Cebuvi

Active Member
Licensed 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.
 

Erel

Administrator
Staff member
Licensed User
The text to be added to the manifest is always added or only when Google Maps is in TabStrip or StdViewPager?
It is only related to Google Maps and always needed with Google Maps (and targetSdkVersion = 28).
 

vikingivesterled

Member
Licensed 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 **
 

Erel

Administrator
Staff member
Licensed User
You should start a new thread and upload a project that demonstrates the issue.
 
Top