Configuration
Last updated
Last updated
It's advised to maintain separate version control for the exported project so you can be aware of what changes being made by the next export attempt and to ensure that the changes from this documentation remain intact.
Now you can export to Android Native. Go to File
> Build Settings
. Select Android
in the Platform list, then check the Export Project
's checkbox. Then click the Export
button.
You will be asked to select a folder before the compiling process starts. Please create one and select it. For this example walkthrough, we named it ExportedAndroidNative
.
Now you have a folder that contains a complete Android Native project.
Please open ExportedAndroidNative
with Android Studio.
If there is SDK difference between the Android Studio's SDK and the project's SDK, please select Use Project's SDK
.
If you encounter any Gradle issues, please fix them before continuing to the next step.
This automation tool only works for the old Gradle version like v6.1.1.
We have provided a tool to ease the integration steps after export in Windows PC. It could automate all the adjustment below in one key strike. The usage is pretty straightforward:
If you prefer manual adjustment, please continue to read Manual Android Native Adjustment.
Find all AndroidManifest.xml
files in the project and remove this line within the file, if any.
Add additional dependencies to build.gradle (Module: unityLibrary):
Also remove this line:
Add this to build.gradle (Module: launcher):
Also remove this line:
Add this to build.gradle (Project: AndroidBuild):
Also remove this line:
Add google-services.json
to launcher
directory.
Then restart Android Studio through File
> Invalidate Cache / Restart
, then click Invalidate and Restart
. The Android Studio should be restarted and all Gradle tasks are resolved.
Then add them to unityLibrary\src\main\java\com\noctua
. Create the directory if it does not exist.
Change main launcher to your MainActivity.java like this
Then please follow the steps in this guide to configure
Add UnitySendMessage
and Send_Message
to Scripting Define Symbols like the picture below.
Export To Native
The developer needs to specify the specific object of the callback result to notify Unity and the specific method of the notification object
Then please follow the steps in this guide to configure
Download link:
Download Noctua's Java class files from this link:
Add the file NoctuaGame.cs
or your script into your Assets unity project. You can download NoctuaGame.cs
Add NoctuaConnector.h
and NoctuaConnector.mm
to the Classes directory. Calling the SDK interface in Unity will eventually call the corresponding OC interface in NoctuaConnector.mm .
You can download NoctuaConnector