Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
klaus_kobald_9's avatar
6 years ago

All of a sudden! Build for Android fails: Specified cast is not valid.

I did not change anything that I am aware of and get now.

Specified cast is not valid.
UnityEngine.Debug:LogError(Object)
OVRGradleGeneration:PatchAndroidManifest(String) (at Assets/Oculus/VR/Editor/OVRGradleGeneration.cs:348)
OVRGradleGeneration:OnPostGenerateGradleAndroidProject(String) (at Assets/Oculus/VR/Editor/OVRGradleGeneration.cs:170)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:442)

I found out that OVRGradleGeneration : 296 throws an error on the 3rd element when iterating
                     foreach (XmlElement e in appNodeList)

Unity 2019.3.0f5
latest Oculus Android Package: 2.38.6
NDK, Gradle, JDK from 2019.3.0f5 installation 
android sdk: level 25

2 Replies

Replies have been turned off for this discussion
  • I had same issue and the problem was the comments which I had inside application tag from AndroidManifest.xml 
  • ft1825's avatar
    ft1825
    Honored Guest
    I had the same issue and removing the commented out code worked! Thanks.