I was trying to use https://github.com/charmdev/extension-facebook where for build.gradle they use “api” and “implementation” which is not supported in gradle 2.1.0 , so I update ot latest plugin using this in project.xml
This should works , but two files \bin\android\bin\deps\extesnion-api\build.gradle ( which is ) and \bin\android\bin\build.grade still overwrite with classpath 'com.android.tools.build:gradle:2.1.0' , but correct one is classpath 'com.android.tools.build:gradle:3.5.1' .
I manually add for respository maven.google.com
How to stop to overwrite those files with wrong gradle version ?
P.S. Just as info to works with latest gradle should do this also:
Change wrapper text in lime\7.6.3\templates\android\template\build.gradle with
Just to add something. I search and replace all strings “2.1.0” , also remove anroid folder and compile with openfl test android , but the problem still exist .
The file \bin\android\bin\build.gradle contains classpath 'com.android.tools.build:gradle:2.1.0' .
If this is some kind of cache, I’m not sure how to remove it.
I found 2.1.0 only in AndroidPlatform.hx , so there I replace with : context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "3.5.1"); , but doesn’t help.
Compiled templates in \bin’android\ folder are :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
wrapper {
gradleVersion = '5.6.3'
}
configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('build.xml').exists()}) {
buildscript {
repositories {
maven {
url "http://repo1.maven.org/maven2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
apply plugin: 'android-library'
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':deps:extension-api')
}
}
For both classpath should be classpath 'com.android.tools.build:gradle:3.5.1' not classpath 'com.android.tools.build:gradle:2.1.0' , because I set <android gradle-plugin="3.5.1" />
I removed maven.google.com and all templates in Lime are same as the github version at the moment . Only set gradle versions in project.xml
but as I mention earlier , wrapper and applicationVariants also should be changed.
Also I still not sure from where is set 2.1.0 , because I change AndroidPlatforms.hx
I can make a commit to lime repository with wrapper and applicationVariants to support gradle > 4.4 if you want.
The only problem could be this value 2.1.0 if is set from some class.