Skip to content

Commit ede176a

Browse files
committed
#1 - Updated plugin to be compatible with released godot version
1 parent 2d73008 commit ede176a

File tree

11 files changed

+34
-83
lines changed

11 files changed

+34
-83
lines changed

Godot/UnityAdsGodot.gdap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[config]
2+
3+
name="UnityAdsGodot"
4+
binary_type="local"
5+
binary="UnityAdsGodot.aar"
6+
7+
[dependencies]
8+
9+
local=["unity-ads.aar"]

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@ Current version of the `UnityAdsGodot.aar` and example project is available for
44

55
## Requirements
66

7-
The new export templates for android was introduced in godot 3.2.1, but we cannot link custom plugins as export settings panel is missing "Plugins" field so the minimum version would be 3.2.2 for this to run.
7+
The new export templates for android was introduced in Godot 3.2.2. So Godot 3.2.2 and up is required
88

99
## Setup
1010

11-
- Open up the Android export template settings by going to `Project -> Export`.
11+
- In Godot open up the Android export template settings by going to `Project -> Export`.
1212
- Select `Android` and enable costom build.
13-
- In plugins feald type in `UnityAdsGodot`.
14-
- Open up the Godots projects `android` folder and create a folder called `plugins`.
15-
- Place the `UnityAdsGodot.aar` inside the freshly created plugins folder.
13+
- Instal custom android build template.
1614
- Download UnityAds Android library from [here](https://github.com/Unity-Technologies/unity-ads-android/releases)
17-
- Place the downloaded `unity-ads.aar` inside `android/build/libs/plugins`
18-
- Check if `android/build/build.gradle` does not have any filters for specific plugins and if theres a filter update the line as folows
19-
20-
```
21-
// Godot prebuilt plugins
22-
implementation fileTree(dir: 'libs/plugins', include: ["*.aar"])
23-
```
15+
- Open up the Godots projects `android` folder and create a folder called `plugins` if it isn't there.
16+
- Place the `UnityAdsGodot.aar` inside the freshly created plugins folder along with `unity-ads.aar` and `UnityAdsGodot.gdap`.
17+
- The min SDK version will need a update so open up the `android\build\config.gradle` and update `minSdkVersion` to 26
18+
- Last thing is to enable this plugin under `Project -> Export -> Android -> Plugins` and check the checkbox besides `Unity Ads Godot`
2419

2520
## Usage
2621

@@ -62,12 +57,18 @@ func _on_showad_pressed():
6257

6358
## Compiling from source
6459

65-
TODO: Describe how to do this.
60+
- Clone out this repo
61+
- Download UnityAds Android library from [here](https://github.com/Unity-Technologies/unity-ads-android/releases) and place it inside `unityadsgodot\libs` folder
62+
- Download corresponding version of `godot-lib.3.2.2.stable.release` from [here](https://godotengine.org/download/) and place it again in `unityadsgodot\libs` folder
63+
- Open the project in android studio and run `gradlew build` from terminal to build the aar libs
64+
- Build results should be located inside `unityadsgodot\build\outputs\aar`
65+
- Build output can be copied to Godot projects `android\plugins` alongside dependencies and plugin description file from `Godot\UnityAdsGodot.gdap`
6666

6767
## TODOs
6868

6969
- [ ] Improve documentation
70-
- [ ] Code/Project cleanup
70+
- [ ] Code cleanup
71+
- [x] Project cleanup
7172
- [ ] Banner ads are not working and seems that api is deprecated. Need to investigate that
7273
- [ ] Improve setup (possibly create a script for that)
7374
- [ ] Update error code reporting to GDScript

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
rootProject.name='UnityAddsGodot'
2-
include ':unityaddsgodot'
2+
include ':unityadsgodot'

unityaddsgodot/src/androidTest/java/com/jandans/unityaddsgodot/ExampleInstrumentedTest.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

unityaddsgodot/src/test/java/com/jandans/unityaddsgodot/ExampleUnitTest.java

Lines changed: 0 additions & 17 deletions
This file was deleted.
File renamed without changes.

unityaddsgodot/build.gradle renamed to unityadsgodot/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ android {
1010
versionCode 1
1111
versionName "1.0"
1212

13-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1413
consumerProguardFiles 'consumer-rules.pro'
1514
}
1615

@@ -26,11 +25,6 @@ android {
2625
dependencies {
2726
implementation fileTree(dir: 'libs', include: ['*.jar'])
2827

29-
testImplementation 'junit:junit:4.12'
30-
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
31-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
32-
33-
compileOnly fileTree(dir: 'libs', include: ['godot-lib*.aar'])
34-
implementation fileTree(dir: 'libs', include: ['unity-ads.aar'])
28+
compileOnly fileTree(dir: 'libs', include: ['*.aar'])
3529
implementation 'androidx.annotation:annotation:1.1.0'
3630
}
File renamed without changes.
File renamed without changes.

unityaddsgodot/src/main/AndroidManifest.xml renamed to unityadsgodot/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<application>
55
<meta-data
66
android:name="org.godotengine.plugin.v1.UnityAdsGodot"
7-
android:value="com.jandans.unityaddsgodot.UnityAddsInterface" />
7+
android:value="com.jandans.unityaddsgodot.UnityAdsInterface" />
88
</application>
99
</manifest>

0 commit comments

Comments
 (0)