Skip to content

Commit 4a0b079

Browse files
committed
Clarify android NDK setup.
1 parent a725c44 commit 4a0b079

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,34 @@ the platform name (Android or iOS). You can click on its icon to expand it.
7575
file (you can access the Unity packages in the [*unitypackages*](https://github.com/juicycleff/flutter-unity-view-widget/tree/master/unitypackages) folder too)
7676
Remeber to always check the match unitypackage for your project.
7777

78-
#### NDK
78+
#### Android NDK
7979

80-
If your project requires Android NDK, you have to setup following:
80+
You will most likely need to define which Android NDK should be used.
8181

82-
Your android project needs to know the path of the NDK Unity uses. You can find the path to the NDK under `Preferences -> External Tools`:
82+
If you have Unity and Flutter installed on the same machine, the easiest approach is to use the path of the NDK Unity uses. You can find the path to the NDK in Unity under `Edit -> Preferences -> External Tool`:
8383

8484
![NDK Path](files/ndkPath.png)
8585

86-
Copy the path by right click and paste the path here in your `android/local.properties`:
87-
86+
Copy the path and paste it into `android/local.properties`:
87+
For windows you will need to replace `\` with `\\`.
8888
```properties
89+
// mac
8990
ndk.dir=/Applications/Unity/Hub/Editor/2020.3.19f1/PlaybackEngines/AndroidPlayer/NDK
91+
// windows
92+
ndk.dir=C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.13f1\\Editor\\Data\\PlaybackEngines\\AndroidPlayer\\NDK
9093
```
9194

92-
That's it! You don't need to tell your Android App in your `app/build.gradle` the NDK version or other NDK settings. It's all connected to Unity now.
95+
With the above setup, you shouldn't have to define any NDK version or setting in gradle files.
96+
97+
If you don't have Unity on the same device or require a specific version, you can instead define it in 'android/app/build.gradle'
98+
```gradle
99+
100+
android {
101+
102+
ndkVersion "21.3.6528147"
103+
}
104+
```
105+
To find the exact version that Unity uses, check `source.properties` at the NDK path described above.
93106

94107
### Steps
95108

0 commit comments

Comments
 (0)