-
-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android.view.InflateException: Binary XML file line #27: Error inflating class com.pierfrancescosoffritti.androidyoutubeplayer.player.YouTubePlayerView #504
Comments
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1' |
Why are you using such an old version? |
Same problem on API level 22 any solution? android.view.InflateException: Binary XML file line #93: Error inflating class com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView |
I have updated to 10.0.5 version still the issue exists on android 5 |
Maybe related to #543 |
Can't reproduce the errors with
@StevenNick88 , @jerrymani33 and @pluzmedia can you provide a setup for reproducing this error to track it back? |
Same issue on @malliaridis It occurs very first time while opening activity/fragment |
@Meenu1401 do you have any setup to reproduce the error? It really sounds like there is a wrong configuration (no video id available at the moment of instantiation). |
This is the setup xml
<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
android:id="@+id/youtubeVideoFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:autoPlay="true"
app:enableAutomaticInitialization="true"
app:showFullScreenButton="false"
app:videoId="ep5ZWmpcxHA" />
and initializing this way in fragment
class WelcomeFragment : BaseFragment(), View.OnClickListener {
private val binding: FragmentWelcomeBinding by lazy {
FragmentWelcomeBinding.inflate(LayoutInflater.from(context))
}
}
…On Sun, Jan 3, 2021 at 11:57 PM Christos Malliaridis < ***@***.***> wrote:
@Meenu1401 <https://github.com/Meenu1401> do you have any setup to
reproduce the error? It really sounds like there is a wrong configuration
(no video id available at the moment of instantiation).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#504 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSIEZRNI5JTUM5PVVR2F7TSYCZIRANCNFSM4J7UTRVA>
.
|
@malliaridis Getting these logs
|
Can you provide the whole stacktrace @Meenu1401? It seems like the important part is missing (The lines starting with "Caused by.. " |
Caused by: java.lang.RuntimeException: Using WebView from more than one process at once with the same data directory is not supported. https://crbug.com/558377 |
@malliaridis Please check above logs |
@Meenu1401 It seems like you are trying to make a data / view binding (correct me if I'm wrong). Data binding is not working as reported in #523. With my following setup I was able to start it. Can you see if this works for you too? MainA class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val binding = ActivityMainBinding.inflate(LayoutInflater.from(this))
setContentView(binding.root)
supportFragmentManager.beginTransaction()
.replace(binding.flContainer.id, WelcomeFragment())
.commit()
}
}
class WelcomeFragment : Fragment() {
private val binding: FragmentWelcomeBinding by lazy {
FragmentWelcomeBinding.inflate(LayoutInflater.from(context))
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
return binding.root
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<FrameLayout
android:id="@+id/fl_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:id="@+id/youtube_player_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:videoId="S0Q4gqBUs7c"
app:autoPlay="true"
app:showFullScreenButton="false" />
</androidx.constraintlayout.widget.ConstraintLayout>
android {
...
buildFeatures {
viewBinding true
}
...
} Notice that there is no data binding used, only view binding. It also works with build feature dataBinding, but without binding the video URL (not tested however). Once you try to bind the video URL it fails on compilation or on execution. |
@malliaridis Thank you for the help. It is working fine for me as well. Issue was related to cache of webview not with the player. |
Hello @Meenu1401 facing the exact same issue in my app also. could you just elaborate what was the issue with webview cache? sharing my logs and details for everyone reference Android API 22 & Android API 21 07-21 08:39:06.905 E/art (28194): dlopen("/data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so", RTLD_LAZY) failed: dlopen failed: "/data/app/com.google.android.webview-1/lib/arm/libwebviewchromium.so" is 32-bit instead of 64-bit android.view.InflateException: Binary XML file line #23: Error inflating class com.pierfrancescosoffritti.androidyoutubeplayer.player.YouTubePlayerView |
您好,您的邮件已收到,感谢您的来信。祝您生活愉快!
|
12-27 03:52:31.506 7003-7003/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.afmobi.boomplayer, PID: 7003
android.view.InflateException: Binary XML file line #27: Error inflating class com.pierfrancescosoffritti.androidyoutubeplayer.player.YouTubePlayerView
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at com.chad.library.adapter.base.BaseQuickAdapter.getItemView(BaseQuickAdapter.java:1630)
at com.chad.library.adapter.base.BaseQuickAdapter.createBaseViewHolder(BaseQuickAdapter.java:1131)
at com.chad.library.adapter.base.BaseMultiItemQuickAdapter.onCreateDefViewHolder(BaseMultiItemQuickAdapter.java:51)
at com.chad.library.adapter.base.BaseQuickAdapter.onCreateViewHolder(BaseQuickAdapter.java:832)
at com.tecno.boomplayer.newUI.adpter.DisCoverMusicAdapter.onCreateViewHolder(DisCoverMusicAdapter.java:316)
at com.tecno.boomplayer.newUI.adpter.DisCoverMusicAdapter.onCreateViewHolder(DisCoverMusicAdapter.java:94)
at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:7078)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6235)
at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288)
at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345)
at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361)
at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368)
at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5631)
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:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
Using implementation 'com. Pierfrancescosoffritti. Android YouTube player: Core: 8.0.1', the above problems appear on Android 5.1 mobile phones,Please help.
The text was updated successfully, but these errors were encountered: