Android Question (ERROR solved) animated counter , when I put in the manifest targetSdkVersion="28"

EdisonMales

Member
Licensed User
use the example that this post https://www.b4x.com/android/forum/t...ss-platform-views-and-dialogs.100836/#content and I have an error when I upload the targetSdkVersion to 28
I use b4a 9.00

I'm going up to api 28 because google play store since August of this year will be mandatory requirement.

ERROR
--------- beginning of system
--------- beginning of main
Copying updated assets files (11)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Index time: 38 ms (139 Items)
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 87 (AnimatedCounter)
java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
at android.view.View.sanitizeFloatPropertyValue(View.java:15425)
at android.view.View.sanitizeFloatPropertyValue(View.java:15399)
at android.view.View.setScaleX(View.java:14788)
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.B4XViewWrapper.SetLayoutAnimated(B4XViewWrapper.java:158)
at b4a.example.animatedcounter._setvalue(animatedcounter.java:82)
at b4a.example.animatedcounter._designercreateview(animatedcounter.java:394)
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 anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:61)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at b4a.example.main._activity_create(main.java:413)
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 b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.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:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
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:858)
** Activity (main) Resume **
Manifest

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
 

jimmyF

Active Member
Licensed User
I can't offer you up any solution to your actual problem but I don't think it stems from the animated counter.

I just set the targetSdkVersion="28" in the manifest editor and loaded the XUI Views Example app on my device.

Runs like a charm!

Don't know if this could be an issue but my XUI Views version is 2.00. Have you checked yours?

-j
 

EdisonMales

Member
Licensed User
I can't offer you up any solution to your actual problem but I don't think it stems from the animated counter.

I just set the targetSdkVersion="28" in the manifest editor and loaded the XUI Views Example app on my device.

Runs like a charm!

Don't know if this could be an issue but my XUI Views version is 2.00. Have you checked yours?

-j
thanks for the reply

where can I get version 2.00? I can not find it
 

jimmyF

Active Member
Licensed User
In Configure Paths, have you set your android.jar to:

[your drive:] \B4AAndroidSDK\platforms\android-28\android.jar
 

jimmyF

Active Member
Licensed User
You should use targetsdk 26 for now in the manifest.
This is a good point though I did experiment with setting it to "28" and the XUI Views Example app ran without any problems.
The problem must be elsewhere, I think.
 

EdisonMales

Member
Licensed User
You should use targetsdk 26 for now in the manifest.
I have other applications with animated counter with targetsdk 26 in the manifest. I'm starting another application and I'm thinking of saving time by switching to targetsdk 28 because from August to upload an application to google play store will be mandatory requirement.
 

jimmyF

Active Member
Licensed User
I'm thinking of saving time by switching to targetsdk 28 because from August to upload an application to google play store will be mandatory requirement.
I think it may be premature to do so now though @DonManfred would be much better qualified than I to comment on that.
 

EdisonMales

Member
Licensed User
This is a good point though I did experiment with setting it to "28" and the XUI Views Example app ran without any problems.
The problem must be elsewhere, I think.
download the example of the first post https://www.b4x.com/android/forum/threads/b4x-xui-views-cross-platform-views-and-dialogs.100836/ and change the targetsdk from 26 to 28 and the error came out, as I mentioned above only on the device with android 9 (Api 28) I have problems. No problem in android 8.1 and earlier
 

EdisonMales

Member
Licensed User
Thanks everyone for your help.we will continue anxiously waiting. For the moment I will continue with targetSdkVersion = 26.
 
Top