react-native-unity-view icon indicating copy to clipboard operation
react-native-unity-view copied to clipboard

FileNotFoundException and nothing exported

Open CurralesDragon opened this issue 3 years ago • 7 comments

Hello!

I'v been using this package for some time, but recently upgraded unity to version 2020 as it was the only way to fix a Unity bug.

But now when exporting android, I receive the error message:

FileNotFoundException: Could not find file "/Users/bla/src/c/packages/c-native/android/UnityExport/build.gradle"
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.StreamReader..ctor (System.String path, System.Boolean detectEncodingFromByteOrderMarks) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.StreamReader..ctor (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string)
System.IO.File.ReadAllText (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Build.DoBuildAndroid (System.String buildPath) (at Assets/Scripts/Editor/Build.cs:64)
Build.DoBuildAndroidLibrary () (at Assets/Scripts/Editor/Build.cs:25)

Is this error causing the export to fail or is the error appearing because nothing is exported (there's noting in the UnityExport folder)

CurralesDragon avatar Jul 20 '21 09:07 CurralesDragon

@nicwhitts did you run the React Native export from within Unity?

srepollock avatar Sep 17 '21 07:09 srepollock

Hey, I'm having the same issue, any update @nicwhitts ?

Arnaod avatar Dec 08 '21 13:12 Arnaod

Let me try and remember what happened here. Iv been using it again successfully.

CurralesDragon avatar Dec 08 '21 15:12 CurralesDragon

Post your Build.cs script and il take a look

CurralesDragon avatar Dec 08 '21 15:12 CurralesDragon

Actually, it could of been this fix in build.gradle:

flatDir {
            dirs "${project(':unityLibrary').projectDir}/libs"
        }

Changing to unityLibrary instead of unityExport

There may be some other places I had to change this if i remember correctly. But maybe not! Let me know

CurralesDragon avatar Dec 08 '21 15:12 CurralesDragon

Hi, thank you for your answers.

So far I changed it in the build.gradle :

include ":unityLibrary" project(":unityLibrary").projectDir = file("./UnityExport")

As well as settings.gradle:

flatDir { dirs "${project(':unityLibrary').projectDir}/libs" }

But still, I need to check "Export Project" for my build to work.

Arnaod avatar Dec 09 '21 10:12 Arnaod

Hi, @nicwhitts , or @Arnaod have you made it work already? I've tried Arnaod's changes but no luck

bll-manapulian avatar Mar 15 '22 16:03 bll-manapulian