Je cherchais partout mais je n'ai pas trouvé de solution pour cette erreur.
J'utilise ExoPlayer pour la diffusion vidéo en direct. Et mon application se bloque chaque fois que je l'exécute. Si vous pouvez m'aider, je serai heureux. P>
Je suppose que cela devrait être quelque part dans le fichier XML, mais je ne peux pas comprendre ce qui signifie que toute cette erreur. XML: P>
Process: rusiptv.net, PID: 25782 java.lang.RuntimeException: Unable to start activity ComponentInfo{rusiptv.net/rusiptv.net.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class com.devbrackets.android.exomedia.ui.widget.VideoView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class com.devbrackets.android.exomedia.ui.widget.VideoView Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class com.devbrackets.android.exomedia.ui.widget.VideoView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:334) at android.view.LayoutInflater.createView(LayoutInflater.java:647) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at rusiptv.net.MainActivity.onCreate(MainActivity.java:42) at android.app.Activity.performCreate(Activity.java:7009) at android.app.Activity.performCreate(Activity.java:7000) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
VideoView VideoView = FindViewyID (r.id.video_view); Code> Li>
- et j'ai changé de chemin pour VideoView selon My Packagename. Li>
ul> p>
4 Réponses :
Veuillez vérifier si le chemin
<com.devbrackets.android.exomedia.ui.widget.VideoView android:id="@+id/video_view" android:layout_width="match_parent" android:layout_height="match_parent" app:useDefaultControls="true"/>
Comment puis-je vérifier si le chemin de VideoView est correct selon votre nom Packagename?
Avez-vous VideoView comme classe Java dans votre projet?
Oui j'ai vidéovision
Maintenant quel est le nom du paquet en haut de cette classe?
paquet = "rusiptv.net">
Ensuite, comment pouvez-vous trouver com.devebrackets.android.exomedia.ui.widget.videoView b> en XML? Vous devez fournir votre nom de package comme rusiptv.net.videoView b>
Assurez-vous également que RUSIPTV.NET B> Ce nom du package est un chemin approprié pour la classe VideoView. Il n'y a pas de sous-paquet de la classe VideoView
Donc, j'ai besoin d'écrire package = "rusiptv.net.videoView"> b> au lieu de package = "rusiptv.net"> b> dans le fichier androidmanifest.xml?
Non non, vous devez écrire rusiptv.net.videoView b> au lieu de com.devebrakets.android.exomedia.ui.widget.videoview B> in XML
Votre vision personnalisée doit être fournie avec un chemin approprié dans XML afin de trouver par classe Java
Vérifiez le nom du package de la classe VideoView non du fichier manifeste
Je suis tellement stupide ... Comment je peux vérifier le nom du package de la classe VideoView?
Comme je vérifie que ce fichier n'est pas terminé en mode de réaction de l'utilisateur, essayez une autre vue vidéo comme celle-ci
<VideoView android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/VideoView" />
Mais j'utilise ExoPlayer et j'ai besoin exactement de cette vidéo VideoView de la bibliothèque d'ExoPlayer
Assurez-vous d'ajouter la dépendance de la bibliothèque et doit être ajouté cette ligne avant utilisation
VideoView Vedioview = FindViewyID (r.id.video_view); code> Ajoutez-vous cette ligne
Vous devez remplacer le constructeur Cela résoudra votre problème. p> p>
Vous devriez FOOTVIEWBYID avant d'utiliser (
videoView code>).