triniwiz / nativescript-youtubeplayer

Apache License 2.0
35 stars 18 forks source link

"An error occurred while initializing the YouTube Player" with Android API Level 30 #66

Open Universi opened 3 years ago

Universi commented 3 years ago

I've been using this great plugin in an app for several months without any problem on Android and iOS, but recently I get this message on Android devices with api level 30: "An error occurred while initializing the YouTube Player", while it still works fine on Android devices with lower level api. I know there is a new version of the plugin, but I can't migrate my app to NS 8 yet.

On StackOverflow, some people mention a problem with the visibility restrictions in Android 11 package, but I haven't found a solution a solution that works yet.

nativescript-youtubeplayer: 3.0.1 nativescript: 8.0.1 tns-core-module : 6.5.27 tns-android: 6.5.3

Is there a particular reference to add to the manifest or something else to do?

One of my android testers was able to capture this:

2021-05-10 13:51:16.232 504-504/? E/audit: type=1400 audit(1620647476.225:645214): avc:  denied  { read } for  pid=1007 comm=43464D532048616E646C6572205468 name="heavy_task_cpu" dev="sysfs" ino=53251 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 SEPF_SM-G973F_11_0009 audit_filtered
2021-05-10 13:51:16.232 504-504/? E/audit: type=1300 audit(1620647476.225:645214): arch=c00000b7 syscall=56 success=no exit=-13 a0=ffffff9c a1=77c02408b0 a2=0 a3=0 items=0 ppid=531 pid=1007 auid=4294967295 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=4294967295 comm=43464D532048616E646C6572205468 exe="/system/bin/app_process64" subj=u:r:system_server:s0 key=(null)
2021-05-10 13:51:16.232 504-504/? E/audit: type=1327 audit(1620647476.225:645214): proctitle="system_server"
2021-05-10 13:51:16.433 504-504/? E/audit: type=1400 audit(1620647476.429:645215): avc:  denied  { read } for  pid=1007 comm=43464D532048616E646C6572205468 name="heavy_task_cpu" dev="sysfs" ino=53251 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 SEPF_SM-G973F_11_0009 audit_filtered
2021-05-10 13:51:16.507 625-642/? E/BufferQueueProducer: [com.christophegarreau.minipaints/com.tns.NativeScriptActivity$_4951#2](id:27100002cba,api:0,p:-1,c:625) disconnect: not connected (req=1)
2021-05-10 13:51:16.561 565-565/? E/HYPER-HAL: [HyPerManager.cpp]getSupportedFrequency(): mRscManager is NULL
2021-05-10 13:51:16.561 565-565/? E/HYPER-HAL: [HyPer.cpp]getSupportedFrequency(): AIDL getTable is NULL
2021-05-10 13:51:16.585 1447-1620/? E/CscParser: update(): xml file exist
2021-05-10 13:51:16.682 1007-1048/? E/WindowManager: win=Window{8bd461e u0 com.christophegarreau.minipaints/com.tns.NativeScriptActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.ActivityRecord.destroySurfaces:5251 com.android.server.wm.ActivityRecord.destroySurfaces:5232 com.android.server.wm.WindowState.onExitAnimationDone:5617 com.android.server.wm.WindowStateAnimator.onAnimationFinished:332 com.android.server.wm.WindowState.onAnimationFinished:6082 com.android.server.wm.-$$Lambda$dwJG8BAnLlvKNGuDY9U3-haNY4M.onAnimationFinished:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0$SurfaceAnimator:112
triniwiz commented 3 years ago

You can check this for the visibility, the v4 of this should work fine but it's {N} v7+

Universi commented 3 years ago

Thank you for the quick response. Is it not possible to use android.support.v4.app.FragmentManagerwith {N} 6?

triniwiz commented 3 years ago

I rewrote the new plugin it does not use that it's @triniwiz/nativescript-youtubeplayer

Whip commented 3 years ago

Still getting this error with v4.1.3 on NS8.

ittrad-mobile-lab commented 3 years ago

I got the same problem both IOS and Android . Any improvement? I'm using {N} v7+

leocrawf commented 3 years ago

I got the same problem with NS 6.8 core. I have seen in many places where this:

 <queries>
    <intent>
     <action android:name="com.google.android.youtube.api.service.START"/>
    </intent>
 </queries>

solved the issue if copied in the manifest file but it did not work for me. My error was: error: unexpected element queries found in manifest.