Android Question ExoPlayer does not work

AlfaizDev

Well-Known Member
Licensed User
It does not work
Please Help

I have attached the program below


B4X:
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 35 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.question100.Alimad.main._activity_create(main.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.question100.Alimad.main.afterFirstLayout(main.java:104)
    at com.Alfaiz.question100.Alimad.main.access$000(main.java:17)
    at com.Alfaiz.question100.Alimad.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:71)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.DesignerCreateView(SimpleExoPlayerViewWrapper.java:59)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at java.lang.Class.getField(Class.java:1143)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
    ... 24 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 35 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.question100.Alimad.main._activity_create(main.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.question100.Alimad.main.afterFirstLayout(main.java:104)
    at com.Alfaiz.question100.Alimad.main.access$000(main.java:17)
    at com.Alfaiz.question100.Alimad.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:71)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.DesignerCreateView(SimpleExoPlayerViewWrapper.java:59)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at java.lang.Class.getField(Class.java:1143)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
    ... 24 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 35 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.question100.Alimad.main._activity_create(main.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.question100.Alimad.main.afterFirstLayout(main.java:104)
    at com.Alfaiz.question100.Alimad.main.access$000(main.java:17)
    at com.Alfaiz.question100.Alimad.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:71)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.DesignerCreateView(SimpleExoPlayerViewWrapper.java:59)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at java.lang.Class.getField(Class.java:1143)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
    ... 24 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 35 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.question100.Alimad.main._activity_create(main.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.question100.Alimad.main.afterFirstLayout(main.java:104)
    at com.Alfaiz.question100.Alimad.main.access$000(main.java:17)
    at com.Alfaiz.question100.Alimad.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:71)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.DesignerCreateView(SimpleExoPlayerViewWrapper.java:59)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at java.lang.Class.getField(Class.java:1143)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
    ... 24 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 35 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.question100.Alimad.main._activity_create(main.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.question100.Alimad.main.afterFirstLayout(main.java:104)
    at com.Alfaiz.question100.Alimad.main.access$000(main.java:17)
    at com.Alfaiz.question100.Alimad.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:71)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.DesignerCreateView(SimpleExoPlayerViewWrapper.java:59)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at java.lang.Class.getField(Class.java:1143)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
    ... 24 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 35 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.question100.Alimad.main._activity_create(main.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.question100.Alimad.main.afterFirstLayout(main.java:104)
    at com.Alfaiz.question100.Alimad.main.access$000(main.java:17)
    at com.Alfaiz.question100.Alimad.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:71)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.DesignerCreateView(SimpleExoPlayerViewWrapper.java:59)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at java.lang.Class.getField(Class.java:1143)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
    ... 24 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 35 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Alfaiz.question100.Alimad.main._activity_create(main.java:404)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    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 java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.Alfaiz.question100.Alimad.main.afterFirstLayout(main.java:104)
    at com.Alfaiz.question100.Alimad.main.access$000(main.java:17)
    at com.Alfaiz.question100.Alimad.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6918)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:71)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.DesignerCreateView(SimpleExoPlayerViewWrapper.java:59)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    ... 21 more
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
    at java.lang.Class.getField(Class.java:1143)
    at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
    ... 24 more
** Activity (main) Resume **
557.png
4774.png
557.png557.png4774.png557.png
 

Attachments

  • 1.zip
    9.2 KB · Views: 178
Last edited:

ac9ts

Active Member
Licensed User
Longtime User
Maybe a bug with the designer?

Your code works with the layout (1.bal) from the ExoPlayer example. https://www.b4x.com/android/forum/threads/exoplayer-mediaplayer-videoview-alternative.72652/

If you create a new layout and set all the same parameters, the layout fails with:
B4X:
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchFieldException: RESIZE_MODE_null

Using the BalConverter on the original, there is a section:
B4X:
"javaType": ".CustomViewWrapper",
                "typeface": "DEFAULT",
                "customType": "anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper",
                "customProperties": {
                    "customType": "anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper",
                    "csType": "Dbasic.Designer.MetaCustomView+CustomDataGrid",
                    "shortType": "SimpleExoPlayerView",
                    "ResizeMode": "FIT",
                    "ControllerTimeout": 5000,
                    "UseController": true,
                    "type": ""
                },

where a similar section in yours:
B4X:
"javaType": ".CustomViewWrapper",
                "typeface": "DEFAULT",
                "customType": "anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper",
                "customProperties": {
                    "customType": "anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper",
                    "csType": "Dbasic.Designer.MetaCustomView+CustomDataGrid",
                    "shortType": "SimpleExoPlayerView",
                    "type": ""
                },

I haven't really used custom views so there may be a way to set the missing properties. Short term, maybe use the layout from the example and modify it as needed.....but don't delete the ExoPlayer custom view.
 
Upvote 0

AlfaizDev

Well-Known Member
Licensed User
This is related to a bug in ExoPlayer v1.40. Update to v1.41, refresh the libraries and click on the ExoPlayer view. It will add the missing properties.
Thanks Erel
I did it and it works so well now
 

Attachments

  • يليل.png
    يليل.png
    3.2 KB · Views: 170
Last edited:
Upvote 0
Top