2016-01-08 17:36:44 +01:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
2017-10-06 11:08:57 +02:00
|
|
|
$$GRADLE_REPOSITORY_URLS$$
|
2016-01-08 17:36:44 +01:00
|
|
|
}
|
|
|
|
dependencies {
|
2017-07-30 06:30:20 +02:00
|
|
|
classpath 'com.android.tools.build:gradle:2.3.3'
|
2017-03-06 11:04:21 +01:00
|
|
|
$$GRADLE_CLASSPATH$$
|
2016-01-08 17:36:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
repositories {
|
2017-03-25 13:11:20 +01:00
|
|
|
jcenter()
|
2016-01-08 17:36:44 +01:00
|
|
|
mavenCentral()
|
2016-01-09 14:21:22 +01:00
|
|
|
$$GRADLE_REPOSITORY_URLS$$
|
2016-01-08 17:36:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2016-05-25 15:19:37 +02:00
|
|
|
compile 'com.android.support:support-v4:23.+' // can be removed if minSdkVersion 16 and modify DownloadNotification.java & V14CustomNotification.java
|
2016-06-25 13:39:03 +02:00
|
|
|
$$GRADLE_DEPENDENCIES$$
|
2016-01-08 17:36:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
Supporting Android API 23 (Android 6.0)
If we update build gradle to use ``compileSdkVersion 23``,
``org.apache.http`` package causes error. (issue #4711)
We need to use ``useLibrary 'org.apache.http.legacy'`` to solve this problem.
To use ``useLibrary``, we need to use latest gradle also.
And now, we faced another problem with ``APK Expansion`` java sources.
```
/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
137 : mCurrentNotification.setLatestEventInfo(mContext, mCurrentTitle, mCurrentText, mContentIntent); // causes error
```
So, some of APK Expansion java sources are updated by referencing commits from https://github.com/danikula/Google-Play-Expansion-File
And dropped V3CustomNotification.java which was for android 3.0, since godot supports android 14 (4.0) above officially.
Unfortunately, another problem, The 'MissingTranslation' error was occurred.
So, build.gradle is updated to use ``disable 'MissingTranslation'``
Additionally, I updated ``buildToolsVersion``, ``targetSdkVersion`` to latest version.
I tested APK Expansion funtionality on Android 6.0 (Nexus 9, Nexus 6p) and Android 4.4 (Galaxy Note 2) with Google Developer console.
2016-05-20 15:57:49 +02:00
|
|
|
disable 'MissingTranslation'
|
2016-01-08 17:36:44 +01:00
|
|
|
}
|
|
|
|
|
2017-12-06 16:34:42 +01:00
|
|
|
compileSdkVersion 26
|
2017-07-30 06:30:20 +02:00
|
|
|
buildToolsVersion "26.0.1"
|
Supporting Android API 23 (Android 6.0)
If we update build gradle to use ``compileSdkVersion 23``,
``org.apache.http`` package causes error. (issue #4711)
We need to use ``useLibrary 'org.apache.http.legacy'`` to solve this problem.
To use ``useLibrary``, we need to use latest gradle also.
And now, we faced another problem with ``APK Expansion`` java sources.
```
/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
137 : mCurrentNotification.setLatestEventInfo(mContext, mCurrentTitle, mCurrentText, mContentIntent); // causes error
```
So, some of APK Expansion java sources are updated by referencing commits from https://github.com/danikula/Google-Play-Expansion-File
And dropped V3CustomNotification.java which was for android 3.0, since godot supports android 14 (4.0) above officially.
Unfortunately, another problem, The 'MissingTranslation' error was occurred.
So, build.gradle is updated to use ``disable 'MissingTranslation'``
Additionally, I updated ``buildToolsVersion``, ``targetSdkVersion`` to latest version.
I tested APK Expansion funtionality on Android 6.0 (Nexus 9, Nexus 6p) and Android 4.4 (Galaxy Note 2) with Google Developer console.
2016-05-20 15:57:49 +02:00
|
|
|
useLibrary 'org.apache.http.legacy'
|
2016-01-08 17:36:44 +01:00
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/NOTICE'
|
|
|
|
}
|
|
|
|
defaultConfig {
|
2016-07-06 21:03:50 +02:00
|
|
|
$$GRADLE_DEFAULT_CONFIG$$
|
2016-01-08 17:36:44 +01:00
|
|
|
}
|
2016-06-15 15:21:18 +02:00
|
|
|
// Both signing and zip-aligning will be done at export time
|
|
|
|
buildTypes.all { buildType ->
|
|
|
|
buildType.zipAlignEnabled false
|
|
|
|
buildType.signingConfig null
|
|
|
|
}
|
2016-01-08 17:36:44 +01:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
manifest.srcFile 'AndroidManifest.xml'
|
2016-01-08 21:55:13 +01:00
|
|
|
java.srcDirs = ['src'
|
2016-06-25 13:39:03 +02:00
|
|
|
$$GRADLE_JAVA_DIRS$$
|
2016-01-08 17:36:44 +01:00
|
|
|
]
|
2017-01-24 16:29:09 +01:00
|
|
|
res.srcDirs = [
|
2016-01-08 17:36:44 +01:00
|
|
|
'res'
|
2017-10-06 11:08:57 +02:00
|
|
|
$$GRADLE_RES_DIRS$$
|
2016-01-08 17:36:44 +01:00
|
|
|
]
|
|
|
|
aidl.srcDirs = [
|
|
|
|
'aidl'
|
2017-10-06 11:08:57 +02:00
|
|
|
$$GRADLE_AIDL_DIRS$$
|
2016-01-08 17:36:44 +01:00
|
|
|
]
|
|
|
|
assets.srcDirs = [
|
|
|
|
'assets'
|
2016-06-25 13:39:03 +02:00
|
|
|
$$GRADLE_ASSET_DIRS$$
|
2016-01-08 17:36:44 +01:00
|
|
|
]
|
|
|
|
}
|
2016-06-15 15:21:18 +02:00
|
|
|
debug.jniLibs.srcDirs = [
|
|
|
|
'libs/debug'
|
|
|
|
$$GRADLE_JNI_DIRS$$
|
|
|
|
]
|
|
|
|
release.jniLibs.srcDirs = [
|
|
|
|
'libs/release'
|
|
|
|
$$GRADLE_JNI_DIRS$$
|
|
|
|
]
|
|
|
|
}
|
|
|
|
applicationVariants.all { variant ->
|
|
|
|
// ApplicationVariant is undocumented, but this method is widely used; may break with another version of the Android Gradle plugin
|
|
|
|
variant.outputs.get(0).setOutputFile(new File("${projectDir}/../../../bin", "android_${variant.name}.apk"))
|
2016-01-08 17:36:44 +01:00
|
|
|
}
|
|
|
|
}
|
2017-03-06 11:04:21 +01:00
|
|
|
|
|
|
|
$$GRADLE_PLUGINS$$
|