Related
I have a java Android project and I am trying to include Kotlin/Convert some of the java classes to Kotlin.
Project's build.gradle:
Here I have introduced a variable for Kotlin version 1.6.10 and kotlin gradle plugin.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import com.tcs.dev.Repo
import org.gradle.wrapper.SystemPropertiesHandler
buildscript {
ext.kotlin_version = '1.6.10'
// load local.properties file like gradle.properties
System.getProperties().putAll(SystemPropertiesHandler.getSystemProperties(file('local.properties')))
Properties properties = new Properties()
if (file("local.properties").exists()) {
properties.load(file('local.properties').newDataInputStream())
}
if (project.hasProperty('propfile')) {
properties.load(file(propfile).newDataInputStream())
}
properties.each { k, v -> ext[k] = v }
repositories {
google()
maven Repo.config(project)
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // For Spoon snapshot, until 2.0.0 is released
jcenter()
}
dependencies {
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
App's build.gradle:
Here I have introduced the Kotlin plugin and two more Kotlin libraries in the implementation section.
import com.tcs.dev.BuildVars
import com.tcs.dev.FileExtension
import com.tcs.dev.PropertiesFile
import com.tcs.dev.Repo
import com.tcs.dev.Shell
import com.tcs.dev.Version
import java.nio.file.Files
import java.nio.file.Paths
import java.util.regex.Pattern
buildscript {
// Items referenced both in and outside of the buildscript block
ext {
buildToolsDir = System.env.get('HOME') + "/build_tools"
localProperties = new File(rootProject.projectDir, "local.properties")
}
// SDK - needs to be done by buildscript because the android-sdk-manager plugin requires it on apply
def androidSdkName = getProperty('systemProp.tcs.dev.android.sdk.name')
def androidSdkVersion = getProperty('systemProp.tcs.dev.android.sdk.version')
def androidSdkClassifier = "darwin-x86_64"
def androidSdkExt = "tgz"
repositories {
jcenter()
google()
maven Repo.config(project)
}
dependencies {
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
classpath group: 'com.google', name: androidSdkName,
version: androidSdkVersion, ext: androidSdkExt, classifier: androidSdkClassifier
}
PropertiesFile.addOrChangeKey(project.localProperties, "sdk.dir", androidSdkDir)
// This should already exist, but just in case not
FileExtension.mkdirs(project.buildToolsDir)
// Extract the Android SDK
if (! new File(sdkBomFile).exists()) {
def sdkFile = sprintf("%s-%s-%s.%s", androidSdkName, androidSdkVersion, androidSdkClassifier, androidSdkExt)
def sdkFullFile = buildscript.configurations.classpath.files.find {
if (it.getName() == sdkFile) return it.getAbsoluteFile()
}
println "Extracting Android SDK"
def cmd = "tar -zxf ${sdkFullFile} -C ${project.buildToolsDir}"
def (exitValue, output) = Shell.shellCommandReturningExitValueAndOutput(cmd)
if (exitValue != 0) {
throw new Exception("Extract command exited with '${exitValue}': ${cmd}")
}
if (! new File(sdkBomFile).exists()) {
throw new Exception("Extract command did not create file '${sdkBomFile}': ${cmd}")
}
println "Accepting license agreements"
cmd = "yes | ${androidSdkDir}/tools/bin/sdkmanager --sdk_root=${androidSdkDir} --licenses"
(exitValue, output) = Shell.shellCommandReturningExitValueAndOutput(cmd)
}
}
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.firebase.crashlytics'
id 'com.google.gms.google-services'
}
// NDK
def androidNdkName = getProperty('systemProp.tcs.dev.android.ndk.name')
def androidNdkVersion = getProperty('systemProp.tcs.dev.android.ndk.version')
def androidNdkDir = sprintf("%s/%s-%s", project.buildToolsDir, androidNdkName, androidNdkVersion)
def androidNdkInstalled = {
return new File(androidNdkDir, 'ndk-build').exists()
}
// AVD
def androidAvdName = getProperty('systemProp.tcs.dev.android.avd.name')
def androidAvdVersion = getProperty('systemProp.tcs.dev.android.avd.version')
def androidAvdDir = sprintf("%s/%s-%s", project.buildToolsDir, androidAvdName, androidAvdVersion)
def androidAvdInstalled = {
return new File(androidAvdDir, "Nexus_9_API_${androidAvdVersion}.ini").exists()
}
[graphicsLibVersion:graphicsLibVersion, serializableLibVersion:serializableLibVersion].each { k, v ->
if (!v.startsWith(Version.projectVersion())) {
logger.warn "WARNING: ${k} ${v} does not match projectVersion ${Version.projectVersion()} please update"
}
}
def gitSha() {
return 'git rev-parse --short HEAD'.execute().text.trim()
}
configurations {
graphicsLib
eigen
generatedSource
manuallyEditedSourceDependencies
if (!androidNdkInstalled()) {
androidNdk
}
if (!androidAvdInstalled()) {
androidAvd
}
}
dependencies {
graphicsLib group: 'com.tcs', name: 'graphics-lib',
version: graphicsLibVersion, ext: 'tgz', classifier: 'sources'
generatedSource group: 'com.tcs', name: 'tcs-serializable-generator',
manuallyEditedSourceDependencies group: 'com.tcs', name: 'cppGraphicsDependencies',
version: cppGraphicsVersion, ext: 'tgz', classifier: 'sources'
if (!androidNdkInstalled()) {
androidNdk group: 'com.google', name: androidNdkName,
version: androidNdkVersion, ext: 'zip', classifier: 'darwin-x86_64'
}
if (!androidAvdInstalled()) {
androidAvd group: 'com.google', name: androidAvdName,
version: androidAvdVersion, ext: 'tgz', classifier: 'darwin-x86_64'
}
}
def minutesSinceEpoch() {
// This should produce unique values for > 4000 years
def minutes = new Date().time.intdiv(1000).intdiv(60).intdiv(30) * 30
Integer clamped = minutes & Integer.MAX_VALUE
return clamped
}
android {
compileSdkVersion 30
buildToolsVersion '30.0.0'
// Required for butterknife compatibility with androidx
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
defaultConfig {
applicationId = BuildVars.applicationId
minSdkVersion 21
targetSdkVersion 30
versionCode minutesSinceEpoch()
versionName "${Version.packageVersion()}"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
sourceSets.main {
// use the jni .so compiled from the manual ndk-build command'''
jniLibs.srcDirs = ['src/main/jniLibs/debug/lib', 'src/main/jniLibs/release/lib']
jni.srcDirs = [] //disable automatic ndk-build call
}
signingConfigs {
debug {
storeFile file("../tcs-debug.keystore")
storePassword "dummy1"
keyAlias "debug"
keyPassword "dummy1"
}
release {
storeFile file("../tcs-android.keystore")
storePassword project.properties.get("dummy2")
keyAlias "release"
keyPassword project.properties.get("dummy2")
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
applicationIdSuffix ".debug"
jniDebuggable true
ext.setBuildConfigFieldWithDefault = { fieldName, value ->
if (project.hasProperty(fieldName)) {
value = project.properties.get(fieldName)
}
buildConfigField "String", fieldName, "\"$value\""
}
def testMap = []
if (project.findProperty('testStack') == "staging") {
testMap = [
'testServer' :'https://staging.dev.tcs.com/',
'testAsmBrokenTestDocId':'a63f4467861f1c54500afd9d',
'testAsmBrokenTestWsId' :'9b6b7102fe2578a1d683adf1',
'testAnonymousDocId' :'346fa02ef804498723df9b6e'
]
} else {
testMap = [
'testServer' :'https://demo-c.dev.tcs.com/',
]
}
printf("testMap is: ${testMap}\n")
testMap.each{ k, v -> setBuildConfigFieldWithDefault(k, v) }
setBuildConfigFieldWithDefault("testUsername", "androidtester3#test.tcs.com")
setBuildConfigFieldWithDefault("testPassword", "testPassword")
ext.enableCrashlytics = false
pseudoLocalesEnabled true
testCoverageEnabled true
}
}
project.gradle.taskGraph.whenReady {
connectedDebugAndroidTest {
ignoreFailures = true
}
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'LICENSE.txt'
doNotStrip "*/armeabi/*.so"
doNotStrip "*/armeabi-v7a/*.so"
doNotStrip "*/x86/*.so"
}
dexOptions {
javaMaxHeapSize "2g"
}
applicationVariants.all { variant ->
variant.mergeAssetsProvider.get().dependsOn(extractShaders)
}
lintOptions {
disable 'MissingTranslation', 'ExtraTranslation', 'NotSibling'
}
}
android.applicationVariants.all { variant ->
def applicationId = variant.applicationId as String
//def adbPath = android.adbExe as String
def adbPath = "/platform-tools/adb"
def variantName = variant.name.capitalize()
String pd = projectDir as String
def adbPlus = pd + "/../buildSrc/adb+.sh"
def grantPermissionsTask = tasks.create("grant${variantName}Permissions") {
doLast {
"bash ${adbPlus} ${adbPath} ${applicationId} android.permission.READ_CONTACTS".execute()
"bash ${adbPlus} ${adbPath} ${applicationId} android.permission.WRITE_EXTERNAL_STORAGE".execute()
}
}
grantPermissionsTask.description = "Grants permissions on Marshmallow and later"
grantPermissionsTask.group = "extras"
}
tasks.whenTaskAdded { theTask ->
if (theTask.name.equals("compileReleaseJavaWithJavac")) {
theTask.dependsOn "ndkBuildRelease"
} else if (theTask.name.equals("compileDebugJavaWithJavac")) {
theTask.dependsOn "ndkBuildDebug"
}
}
def assetsDir = new File(projectDir, 'src/main/assets')
task createAssetsDir() {
doFirst {
FileExtension.mkdirs(assetsDir)
}
}
task extractEigen(type: Copy) {
description = 'Expand eigen files into $EIGEN_DIR'
from(tarTree(configurations.eigen.singleFile)) {
include '*/Eigen/*'
include '*/Eigen/src/**'
}
if (eigenVersion == '506565787cdc4') { // 3.1.2
into eigenDir
def root = Pattern.compile('.*/Eigen/')
eachFile {
it.mode |= 0220
it.path = it.path.replaceFirst(root, '')
}
} else {
into eigenDir
eachFile {
it.mode |= 0220
}
}
dirMode 0775
}
task extractShaders(type: Exec) {
dependsOn createAssetsDir
def wd = assetsDir
def extractDir = 'shaders'
def targetFile = 'shaders'
inputs.file configurations.graphicsLib.singleFile
// Ensure the shaders are extracted
outputs.upToDateWhen { false }
outputs.dir "${wd}/${extractDir}"
workingDir wd
commandLine 'tar', '-s', ",graphics-lib-${graphicsLibVersion}/${targetFile},${extractDir},", '-xzf', configurations.graphicsLib.singleFile, "graphics-lib-${graphicsLibVersion}/${targetFile}"
}
task extractGraphics(type: Exec) {
description = 'set property graphics.repo.dir if you want to use your own version of the graphics repo.' +
' e.g. put a line like this in local.properties: graphics.repo.dir=/Users/pkania/repos/master/graphics'
def wd = 'src/main/jni'
def extractDir = 'Graphics'
def targetFile = 'GraphicsLibrary'
def graphicsDir = "${wd}/${extractDir}"
// Ensure the graphics are extracted
outputs.upToDateWhen { false }
outputs.dir graphicsDir
workingDir wd
doFirst {
def path = Paths.get(graphicsDir)
if (Files.isSymbolicLink(path)) {
Files.delete(path)
}
}
def graphicsRepoDir = project.properties.get('graphics.repo.dir')
if (graphicsRepoDir) {
def script = """
if [ -d ${extractDir} ]; then
rm -rf ${extractDir}
fi
ln -sf ${graphicsRepoDir}/BTGraphicsLibrary ${extractDir}
"""
commandLine Shell.getShellCommandLine(script)
} else {
inputs.file configurations.graphicsLib.singleFile
commandLine 'tar', '-s', ",graphics-lib-${graphicsLibVersion}/${targetFile},${extractDir},", '-xzf', configurations.graphicsLib.singleFile, "graphics-lib-${graphicsLibVersion}/${targetFile}"
}
}
task getGeneratedSource(type:Exec) {
description = 'extract cppGraphics generated source'
dependsOn extractGraphics
def tarFile = configurations.generatedSource.singleFile.path
inputs.file tarFile
workingDir 'src/main/jni'
// Ensure the cpp graphics are extracted
outputs.upToDateWhen { false }
def cmd = Shell.getShellCommandLine("tar xf ${tarFile}")
commandLine cmd
}
task getManuallyEditedSourceDependencies(type:Exec) {
description = 'extract cppGraphics manually edited source'
// this task must run after the generated sources are copied because manually edited files can
// overwrite generated ones.
dependsOn getGeneratedSource
def tarFile = configurations.manuallyEditedSourceDependencies.singleFile.path
inputs.file tarFile
workingDir 'src/main/jni/cppGraphics'
def cmd = Shell.getShellCommandLine("tar xf ${tarFile}")
commandLine cmd
}
task getAndroidNdkDir(type:Exec) {
}
getAndroidNdkDir.onlyIf {
!androidNdkInstalled()
}
task getAndroidNdk() {
}
task createSwigOutputDir {
doLast {
def swigOutputDir = file('src/main/java/com/tcs/app/graphics/gen')
FileExtension.mkdirs(swigOutputDir)
}
}
task getAndroidAvdDir(type:Exec) {
}
getAndroidAvdDir.onlyIf {
!androidAvdInstalled()
}
task getAndroidAvd() {
}
task swigBuild(type: Exec) {
dependsOn extractGraphics
dependsOn getGeneratedSource
dependsOn getManuallyEditedSourceDependencies
dependsOn createSwigOutputDir
dependsOn extractEigen
workingDir 'src/main/jni'
commandLine '/usr/local/bin/swig', '-java', '-c++', '-package', 'com.tcs.app.graphics.gen', '-outdir', '../java/com/tcs/app/graphics/gen', '-o', './graphics_wrap.cpp', 'graphics.i'
}
def numCompilationThreads = {
def (exitValue, numCompileThreads) = Shell.shellCommandReturningExitValueAndOutput("sysctl -n hw.ncpu");
if (exitValue != 0) {
return 1
}
return numCompileThreads
}
// call regular ndk-build(.cmd) script from app directory
// http://stackoverflow.com/questions/16667903/android-studio-gradle-and-ndk
// http://ph0b.com/android-studio-gradle-and-ndk-integration/
// TODO: We'd rather not have two tasks here. Either research whether we can just use the default NDK build with our own Android.mk, or figure out how to streamline this w/Gradle.
task ndkBuildDebug(type: Exec) {
}
task ndkBuildRelease(type: Exec) {
}
// TODO: do not brute force delete the graphics generated files. Instead, tell gradle they are output files, and
// let gradle automatically clean them
task cleanGraphicsGen(type: Delete) {
}
clean.dependsOn(cleanGraphicsGen)
// TODO: This is a more complete way to get the dependencies in place, but we need to figure out how to get the
// TODO: buildtype so we can refer to the correct ndkBuild task...
//tasks.withType(JavaCompile) {
// compileTask -> compileTask.dependsOn ndkBuild
//}
dependencies {
implementation 'androidx.core:core-ktx:1.3.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.google.android.material:material:1.1.0-alpha08'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta02'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation("com.tcs:tcs-android:$serializableLibVersion") {
transitive = false
}
implementation("com.tcs:tcs-primogenitor:$serializableLibVersion") {
transitive = false
}
implementation("com.tcs:tcs-serialize-common:$serializableLibVersion") {
transitive = false
}
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.firebase:firebase-core:18.0.0'
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation "com.google.firebase:firebase-messaging:17.5.0"
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.0.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
implementation 'com.google.code.gson:gson:2.6.2'
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.0"))
// define any required OkHttp artifacts without version
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")
implementation("com.google.guava:guava:31.0.1-android")
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.0'
implementation 'commons-lang:commons-lang:2.6'
implementation 'org.slf4j:slf4j-api:1.7.13'
implementation 'com.melnykov:floatingactionbutton:1.3.0'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'net.danlew:android.joda:2.9.9.4'
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
]
implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1') {
exclude module: 'support-annotations'
}
androidTestImplementation('androidx.test.espresso:espresso-idling-resource:3.1.1') {
exclude module: 'support-annotations'
}
androidTestImplementation "com.squareup.spoon:spoon-client:2.0.0-SNAPSHOT" // For Spoon snapshot, until 2.0.0 is released
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test:core:1.1.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout-solver:1.1.3'
androidTestImplementation 'junit:junit:4.13'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
}
spoon {
def envSerial = System.env['ANDROID_SERIAL'];
if (envSerial) {
devices = [envSerial];
}
if (project.hasProperty('spoonClassName')) {
className = project.spoonClassName
}
if (project.hasProperty('spoonMethodName')) {
methodName = project.spoonMethodName
}
debug = true
adbTimeout = 10*60
// className = 'com.tcs.integration.smoketests'
// methodName = 'testSteeringWheel'
}
I get this error when gradle syncs:
Cause 1: com.android.build.gradle.internal.crash.ExternalApiUsageException: java.lang.IllegalArgumentException: Cannot change attributes of dependency configuration ':app:debugCompile' after it has been resolved
Caused by: java.lang.IllegalArgumentException: Cannot change attributes of dependency configuration ':app:debugCompile' after it has been resolved
at org.gradle.api.internal.attributes.ImmutableAttributeContainerWithErrorMessage.attribute(ImmutableAttributeContainerWithErrorMessage.java:57)
Cause 2: org.gradle.api.UnknownDomainObjectException: KotlinJvmAndroidCompilation with name 'debug' not found
There is no relevant code at all ...but according to the error message:
KotlinJvmAndroidCompilation with name 'debug' not found
I'd suggest to define android.buildTypes.debug, so that it would be known:
android {
buildTypes {
debug {}
}
}
But the answer may eventually rather be, to add Crashlytics on class-path (root build.gradle):
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
I saw messages like these in the gradlew --debug output.
RuntimeException: Configuration 'eigen' was resolved during configuration time
I ignored them at first because they didn't seem related to the exception displayed on the console.
I created an empty andriod studio project (with the kotlin-andorid plugin) and verified that could "build" without error.
I then added parts of our app/build.gradle file into the new project until I encountered the ':app:debugCompileOnly' error.
The error occurred when I added the extractEigen task.
That reminded me of the configuration resolution error I saw in the debug output.
I fixed the configuration resolution error and that fixed the ':app:debugCompileOnly'error.
(Fixed by a colleague)
I'm trying to run my project with `.\gradlew assembleDenug' but I keep getting this output
Could not resolve all files for configuration ':app:mobileGoogleZappDebugCompileClasspath'.
> Could not resolve com.applicaster:GrandeFamily:0.3.+.
Required by:
project :app
> Failed to list versions for com.applicaster:GrandeFamily.
> Unable to load Maven meta-data from https://dl.bintray.com/applicaster-ltd/maven/com/applicaster/GrandeFamily/maven-metadata.xml.
> Could not get resource 'https://dl.bintray.com/applicaster-ltd/maven/com/applicaster/GrandeFamily/maven-metadata.xml'.
> java.lang.NullPointerException (no error message)
I looked for answers online but most of them just said to change the order of google(), maven() and jcenter(), but it didn't help.
This is my project level gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.0'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
maven {
credentials{
username System.getenv("MAVEN_USERNAME")
password System.getenv("MAVEN_PASSWORD")
}
url 'https://dl.bintray.com/applicaster-ltd/maven'
}
maven {
url "$rootDir/node_modules/react-native/android"
}
maven {
url "$rootDir/.m2"
}
maven {
url "https://dl.bintray.com/applicaster-ltd/maven_plugins"
}
maven {
url "https://mvn.jwplayer.com/content/repositories/releases/"
}
maven {
url "https://dl.bintray.com/applicaster-ltd/maven_plugins/"
}
maven { url 'https://github.com/applicaster/APLiveScreenPro7-RN.git' }
}
}
/**
* Auto-generated from .env build configuration.
*/
ext.dimensionsConfig = [
"platform": "mobile", // ["google", "amazon"]
"vendor": "google", // ["mobile", "tv"]
"flavor": "zapp", // ["zapp", "quickbrick"]
]
/**
* Order of dimensions is critical! platform > vendor > flavor
*/
ext.zappProductFlavors = [
mobile: "platform",
tv: "platform",
google: "vendor",
amazon: "vendor",
zapp: "flavor",
quickbrick: "flavor",
]
ext.zappProductFlavorsMap = {
zappProductFlavors.each { key, dim ->
"${key}" { dimension "${dim}" }
}
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
flavorDimensions dimensionsConfig.keySet() as String[]
productFlavors zappProductFlavorsMap
}
/**
* Reject all variants that are not relevant for the current build -
* you should be left with two only, debug and release.
* e.g.: "mobileGoogleZappDebug/Release" or "tvAmazonZappDebug/Release" etc.
*/
android.variantFilter { variant ->
for (flavor in variant.getFlavors()) {
if (flavor.name != dimensionsConfig[flavor.dimension]) {
variant.setIgnore(true)
}
}
}
}
}
}
This is my app level gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.protvromania"
minSdkVersion 19
targetSdkVersion 28
versionCode 273
versionName "1.0.4-alpha.3"
manifestPlaceholders = [
app_name: "PROTV",
fb_app_id: "1147926948637494",
]
multiDexEnabled true
renderscriptSupportModeEnabled true
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
dexOptions {
jumboMode = true
preDexLibraries = false
javaMaxHeapSize "4g"
}
packagingOptions {
// Common
pickFirst 'META-INF/NOTICE.txt'
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/LICENSE'
pickFirst 'META-INF/ASL2.0'
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/MANIFEST.MF'
// https://github.com/ReactiveX/RxJava/issues/4445
pickFirst 'META-INF/rxjava.properties'
// This IMA hack is resolved with gradle wrapper version 2.3.3 - it's kept here for backward compatability - can be removed after a while.
exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
}
signingConfigs {
release {
storeFile file("../dist.keystore")
storePassword ""
keyAlias ""
keyPassword ""
}
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
/**
* See top-level build.gradle for:
* - Dimension configuration of the specific build
* - All product flavors mapping
*/
flavorDimensions dimensionsConfig.keySet() as String[]
productFlavors zappProductFlavorsMap
}
/*
* Create alias for the generated mobile flavors combination,
* to keep backward compatibility without modifying CircleCI code.
* e.g.: "apk/mobile/app-mobile-debug.apk" will actually point to "apk/mobileGoogleZapp/debug/app-mobile-google-zapp-debug.apk"
*/
ext.createMobileShortcut = { runtimeBuildType ->
if (dimensionsConfig.platform == 'mobile') {
def vendor = dimensionsConfig.vendor
def flavor = dimensionsConfig.flavor
def mobilePath = "app/build/outputs/apk/mobile/" + runtimeBuildType
def apkPath = mobilePath + "/app-mobile-" + runtimeBuildType + ".apk"
def compatibilityApkPath = "app/build/outputs/apk/app-mobile-" + runtimeBuildType + ".apk"
def mobileApk = new File(apkPath)
if (!mobileApk.exists()) {
new File(mobilePath).mkdirs()
def baseDirectory = System.getProperty("user.dir")
def existingApkPath = baseDirectory + '/app/build/outputs/apk/mobile' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/app-mobile-' + vendor + '-' + flavor + '-' + runtimeBuildType + '.apk'
['ln', '-s', existingApkPath, apkPath].execute().waitFor()
['ln', '-s', existingApkPath, compatibilityApkPath].execute().waitFor()
new File("app/build/outputs/mapping/mobile/" + runtimeBuildType).mkdirs()
['ln', '-s', baseDirectory + '/app/build/outputs/mapping/mobile' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/mapping.txt', 'app/build/outputs/mapping/mobile/' + runtimeBuildType + '/mapping.txt'].execute().waitFor()
}
}
}
/**
* Create alias for the generated tv flavors combination, see example in createMobileShortcut
*/
ext.createTvShortcut = { runtimeBuildType ->
if (dimensionsConfig.platform == 'tv') {
def vendor = dimensionsConfig.vendor
def flavor = dimensionsConfig.flavor
def tvPath = "app/build/outputs/apk/tv/" + runtimeBuildType
def apkPath = tvPath + "/app-tv-" + runtimeBuildType + ".apk"
def tvApk = new File(apkPath)
if (!tvApk.exists()) {
new File(tvPath).mkdirs()
['ln', '-s', System.getProperty("user.dir") + '/app/build/outputs/apk/tv' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/app-tv-' + vendor + '-' + flavor + '-' + runtimeBuildType + '.apk', apkPath].execute().waitFor()
new File("app/build/outputs/mapping/tv/" + runtimeBuildType).mkdirs()
['ln', '-s', System.getProperty("user.dir") + '/app/build/outputs/mapping/tv' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/mapping.txt', 'app/build/outputs/mapping/tv/' + runtimeBuildType + '/mapping.txt'].execute().waitFor()
}
}
}
ext.dimensionedBuildTaskName = { suffix ->
def capitalizedDimensions = dimensionsConfig.inject([]) { r, v -> r << v.value.capitalize() }.join("")
'assemble' + capitalizedDimensions + suffix.capitalize()
}
/**
* Helper closure for creating paths - no more slash bugs
*/
ext.combinePaths = { paths ->
if (paths in String) paths = [paths] // be nice and return a proper path also with a single String
def file = new File("")
paths.each { path ->
file = new File(file.getPath(), path)
}
file.getPath()
}
task assembleMobileDebug() {
dependsOn dimensionedBuildTaskName('debug')
doLast {
createMobileShortcut('debug')
}
}
task assembleMobileRelease() {
dependsOn dimensionedBuildTaskName('release')
doLast {
createMobileShortcut('release')
}
}
task assembleTvDebug() {
dependsOn dimensionedBuildTaskName('debug')
doLast {
createTvShortcut('debug')
}
}
task assembleTvRelease() {
dependsOn dimensionedBuildTaskName('release')
doLast {
createTvShortcut('release')
}
}
if (System.getenv("CIRCLECI")) {
android.signingConfigs.debug.storeFile = file("../debug.keystore")
}
dependencies {
implementation ("com.applicaster:JWPlayerPlugin:1.5.+") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:GrandeFamily:0.3.+") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:ChagresFamily:0.3.2") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:LermaFamily:0.3.+") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:RhineFamily:0.4.4") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:BottomTabBarMenu-Android:5.1.0") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:FirebaseAnalyticsPlugin:2.3.0") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:DanubeFamily:0.4.+") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:DFP-Plugin:0.3.+") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:GoogleAnalyticsProvider:3.1.0") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:protv-login-plugin:0.2.+") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:ColoradoFamily:0.4.0") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:ElbeFamily:0.9.+") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
implementation ("com.applicaster:urbanAirship-Android:2.0.0") {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
exclude group: 'com.applicaster', module: 'zapp-root-android'
}
api 'com.applicaster:applicaster-modular-sdk:100.0.0'
implementation (project(':react-native-linear-gradient')) {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
}
implementation (project(':react-native-svg')) {
exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
}
}
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
I'm completely lost and have no idea what can be causing this error
Try enabling Embedded Maven repository. Go to File>setting>build>Gradle>Android studio... Check "Enable embedded maven repository"
Our android build started failing all on its own without a single line change for 2 days now.
This is the error message:
/Users/shroukkhan/.gradle/caches/transforms-1/files-1.1/ui-5.11.1.aar/baa8b66e2e52a0a50719f014fc3f1c32/res/values/values.xml:40:5-54: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/shroukkhan/.gradle/caches/transforms-1/files-1.1/ui-5.11.1.aar/baa8b66e2e52a0a50719f014fc3f1c32/res/values/values.xml:40:5-54: AAPT: error: resource android:attr/ttcIndex not found.
As I understand this is related to android support library version mismatch, so i have forced using same library version . However, the problem has persisted. Here is the root level build.gradle:
buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://plugins.gradle.org/m2/' }
maven { url "https://maven.google.com" } // Google's Maven repository
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.1.0'
classpath 'hu.supercluster:paperwork-plugin:1.2.7'
classpath "gradle.plugin.me.tatarka:gradle-retrolambda:3.5.0"
}
}
allprojects {
repositories {
google()
maven { url 'https://jitpack.io' }
maven { url 'https://plugins.gradle.org/m2/' }
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://maven.google.com"
}
flatDir {
dirs 'libs'
}
configurations.all {
resolutionStrategy {
// force certain versions of dependencies (including transitive)
force 'com.squareup.okhttp3:okhttp:3.4.1'
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
details.useVersion "0.38.0"
}
}
}
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task dependencyReportFile(type: DependencyReportTask) {
outputFile = file('dependencies.txt')
}
ext {
supportLibVersion = "27.1.0"
googlePlayServicesVersion = "15.0.1"
googlePlayServicesAnalyticsVersion = "16.0.4"
envConfigFiles = [
develop: ".env.develop",
production: ".env.production",
staging: ".env.staging",
anycustombuildlowercase: ".env",
]
}
subprojects {
if (project.name.contains('react-native-facebook-login') || project.name.contains('react-native-image-picker') ||
project.name.contains('react-native-permissions') || project.name.contains('react-native-vector-icons') ) {
buildscript {
repositories {
jcenter()
maven { url "https://dl.bintray.com/android/android-tools/" }
}
}
}
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
supportLibVersion = "27.1.0"
googlePlayServicesVersion = "15.0.1" //<-- life save line?
}
}
}
}
subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
supportLibVersion = "27.1.0"
googlePlayServicesVersion = "15.0.1"
}
android {
lintOptions {
tasks.lint.enabled = false
}
}
}
}
}
allprojects {
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
details.useVersion "0.38.0" // Your real React Native version here
}
}
}
resolutionStrategy.force 'com.android.support:support-v4:27.1.0'
}
}
And here is the app level build.gradle:
buildscript {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://plugins.gradle.org/m2/' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "io.realm:realm-gradle-plugin:2.3.1"
classpath "gradle.plugin.me.tatarka:gradle-retrolambda:3.5.0"
}
}
apply plugin: "com.android.application"
apply plugin: 'hu.supercluster.paperwork'
paperwork {
set = [
OKKAMI_APP_VERSION: "2.0",
buildTime : buildTime("yyyy-MM-dd HH:mm:ss", "GMT"),
gitSha : gitSha(),
gitTag : gitTag(),
gitInfo : gitInfo(),
gitBranch : gitBranch()
]
}
import com.android.build.OutputFile
project.ext.envConfigFiles = [
debug : ".env.develop",
release : ".env.production",
staging : ".env.staging",
sixsensesDevelop : ".evn.sixsenses.develop",
sixsensesProduction : ".env.sixsenses.production",
cirqProduction : ".env.cirq.production",
nextDevelop : ".env.next.develolp",
nextProduction : ".env.next.production",
anycustombuildlowercase: ".env.develop",
]
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
buildToolsVersion = '27.0.3'
lintOptions {
abortOnError false
}
def versionPropsFile = file('../../build')
def versionBuild
def paperworkfile = file('src/main/assets/paperwork.json')
if (versionPropsFile.canRead()) {
FileInputStream fin = new FileInputStream(versionPropsFile);
BufferedReader reader = new BufferedReader(new InputStreamReader(fin));
String ret = reader.readLine();
fin.close();
versionBuild = ret.split("\n")[0];
} else {
throw new GradleException("Could not read build file")
}
ext.autoIncrementBuildNumber = {
if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
versionProps['VERSION_BUILD'] = versionBuild.toString()
versionProps.store(versionPropsFile.newWriter(), null)
} else {
throw new GradleException("Could not read version.properties!")
}
}
def props = new Properties()
def configFile
def prefix = "OKKAMI"
defaultConfig {
applicationId "com.okkami.android.app"
buildToolsVersion "28.0.3"
compileSdkVersion 28
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
manifestPlaceholders = [devUrlCustomScheme: "okkamidevelop", stagingUrlCustomScheme: "okkamistaging", prodUrlCustomScheme: "okkami"]
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
resValue "string", "build_config_package", "com.okkami.android.app"
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
dexOptions {
javaMaxHeapSize "8g" //specify the heap size for the dex process
}
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
debug { //sign debug apk as well...
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/maven/pom.properties'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/gson/FieldAttributes.class'
exclude '.readme'
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
flavorDimensions "default"
productFlavors {
// OKKAMI
develop {
applicationId "com.okkami.android.app.dev"
versionCode = versionBuild.toInteger()
versionName = '2.0.' + versionBuild
}
staging {
applicationId "com.okkami.android.app.staging"
versionCode = versionBuild.toInteger()
versionName = '2.1.' + versionBuild
}
production {
applicationId "com.okkami.android.app"
versionCode = versionBuild.toInteger()
versionName = '2.2.' + versionBuild
}
// Six Senses
sixsensesDevelop {
applicationId "com.okkami.android.sixsenses.app.dev"
versionCode = versionBuild.toInteger()
versionName = '2.0.' + versionBuild
}
// sixsensesStaging {
// applicationId "com.okkami.android.sixsenses.app.staging"
// versionCode = versionBuild.toInteger()
// versionName = '2.1.' + versionBuild
// }
//
sixsensesProduction {
applicationId "com.okkami.android.sixsenses.app"
versionCode = versionBuild.toInteger()
versionName = '2.2.' + versionBuild
}
// Cirq
cirqDevelop {
applicationId "com.cirq.android.app.dev"
versionCode = versionBuild.toInteger()
versionName = '2.0.' + versionBuild
}
cirqProduction {
applicationId "com.cirq.android.app"
versionCode = versionBuild.toInteger()
versionName = '2.2.' + versionBuild
}
// Next
nextDevelop {
applicationId "com.okkami.android.next.app.dev"
versionCode = versionBuild.toInteger()
versionName = '2.0.' + versionBuild
}
nextProduction {
applicationId "com.okkami.android.next.app"
versionCode = versionBuild.toInteger()
versionName = '2.2.' + versionBuild
}
}
compileSdkVersion = 27
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
def supportLibraryVersion = "27.1.0"
def firebaseMessagingVersion = "17.3.2"
dependencies {
compile(project(':react-native-camera')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
exclude group: 'com.google.android.gms', module: 'play-services-stats'
}
compile project(':react-native-device-brightness')
implementation project(':react-native-battery')
implementation project(':react-native-fast-image')
implementation project(':react-native-bluetooth-status')
implementation project(':react-native-fetch-blob')
compile 'com.github.nisrulz:easydeviceinfo-base:2.4.0'
implementation(project(':react-native-audio-streaming'))
{
exclude module: 'support-v4'
}
implementation project(':react-native-restart')
implementation project(':react-native-wheel-picker')
implementation project(':react-native-tcp')
implementation project(':react-native-exit-app')
implementation project(':react-native-aws-cognito-js')
implementation project(':react-native-svg')
implementation project(':react-native-fs')
implementation project(':react-native-google-analytics-bridge')
implementation project(':react-native-fbsdk')
implementation project(':react-native-blur')
implementation project(':react-native-geocoder')
implementation project(':react-native-facebook-login')
implementation project(':react-native-vector-icons')
implementation(project(':react-native-maps')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
exclude group: 'com.google.android.gms', module: 'play-services-stats'
}
implementation project(':react-native-i18n')
implementation project(':react-native-config')
implementation project(':okkami-sdk')
implementation project(':react-native-permissions')
implementation project(':okkami-react-sdk')
// Line SDK
compile(name: 'line-sdk-4.0.0', ext: 'aar')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:customtabs:${supportLibraryVersion}"
compile('io.smooch:core:5.11.1') {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
exclude group: 'com.google.android.gms', module: 'play-services-stats'
}
compile('io.smooch:ui:5.11.1') {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
exclude group: 'com.google.android.gms', module: 'play-services-stats'
exclude group: 'com.android.support', module: 'support-v4'
}
// compile 'io.smooch:core:5.14.2'
// compile 'io.smooch:ui:5.14.2'
// Libraries imported by Smooch
implementation "com.google.firebase:firebase-core:16.0.3"
implementation "com.google.firebase:firebase-messaging:${firebaseMessagingVersion}"
implementation "com.android.support:exifinterface:${supportLibraryVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibraryVersion}"
implementation "com.android.support:support-media-compat:${supportLibraryVersion}"
implementation "com.google.android.gms:play-services-location:16.0.0"
compileOnly 'org.projectlombok:lombok:1.16.20'
annotationProcessor 'org.projectlombok:lombok:1.16.20'
implementation "com.google.firebase:firebase-auth:16.0.3"
implementation "com.google.firebase:firebase-firestore:17.1.0"
implementation "com.google.firebase:firebase-analytics:16.0.3"
implementation 'com.google.android.gms:play-services-analytics:16.0.3'
compile 'com.pusher:push-notifications-android:1.0.1'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.facebook.react:react-native:0.20.1'
compile 'com.facebook.android:facebook-android-sdk:4.37.0'
compile 'net.hockeyapp.android:HockeySDK:4.1.3'
compile 'com.android.support:support-core-utils:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.android.support:support-v13:27.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'hu.supercluster:paperwork:1.2.7'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.shiraji:butai-java:1.0.2'
compile 'com.android.support:support-v4:27.1.0'
// Lombo
// implementation 'org.projectlombok:lombok:1.16.16'
// HockeyApp
compile 'net.hockeyapp.android:HockeySDK:5.1.1'
// Google Analytics
implementation(project(':react-native-google-analytics-bridge')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
exclude group: 'com.google.android.gms', module: 'play-services-stats'
}
// Badges for Android
compile 'me.leolin:ShortcutBadger:1.1.16#aar'
compile files('libs/AndroidRuntimePermissions.jar')
// Webview for Android
implementation project(':RNWebView')
//compile project(':react-native-mauron85-background-geolocation')
implementation project(':react-native-smart-splashscreen')
implementation project(':openkeysdk-release')
/*guava library used for salto*/
implementation('com.google.guava:guava:18.0') {
exclude module: 'support-v4'
}
//slf4j,bouncycastle and mixpanel used for assa
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.slf4j:slf4j-android:1.7.21'
implementation 'org.bouncycastle:bcprov-jdk15on:1.58'
implementation('com.mixpanel.android:mixpanel-android:4.+') {
exclude module: 'support-v4'
}
//OKC
implementation 'com.clj.fastble:FastBleLib:2.3.4'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile project(path: ':react-native-linear-gradient')
compile project(path: ':RNMaterialKit')
compile project(path: ':react-native-image-picker')
implementation(project(path: ':react-native-device-info')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
exclude group: 'com.google.android.gms', module: 'play-services-stats'
}
compile project(':react-native-orientation')
compile project(':react-native-full-screen')
implementation(project(':react-native-play-sound')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-basement'
exclude group: 'com.google.android.gms', module: 'play-services-tasks'
exclude group: 'com.google.android.gms', module: 'play-services-stats'
}
implementation "com.android.support:support-core-utils:27.1.0"
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
configurations.all {
resolutionStrategy.force "com.google.android.gms:play-services-base:15.0.1"
resolutionStrategy.force "com.google.android.gms:play-services-tasks:15.0.1"
resolutionStrategy.force "com.google.android.gms:play-services-stats:15.0.1"
resolutionStrategy.force "com.google.android.gms:play-services-basement:15.0.1"
resolutionStrategy.force "com.android.support:appcompat-v7:27.1.0"
resolutionStrategy.force 'com.android.support:support-v4:27.1.0'
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
task dependencyReportFile(type: DependencyReportTask) {
outputFile = file('dependencies.txt')
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
I have tracked it down to most likely candidate : io.smooch:ui:5.11.1 ( because the error states : .gradle/caches/transforms-1/files-1.1/ui-5.11.1.aar/baa8b66e2e52a0a50719f014fc3f1c32/res/values/values.xml:40:5-54: AAPT: error: resource android:attr/fontVariationSettings not found. ) . However, no solution proposed online has been working.
Does anyone have any idea whats going on ?
Edit : link to excerpt from dependency tree: https://pastebin.com/raw/YNHWkf5D
The fontVariationSettings attribute was added in API Level 28.
Set your compileSdkVersion to 28 or higher to be able to use libraries that reference this attribute.
Update your fb dependency version-
implementation 'com.facebook.android:facebook-android-sdk:5.11.0'
and you have to add following line to android/gradle.properties:
facebookSdkVersion=5.11.0
Change :
implementation 'com.facebook.android:facebook-android-sdk:5.11.1'
TO:
implementation 'com.facebook.android:facebook-android-sdk:5.11.0'
Located in app.gradle file
Clean project and Rebuild
Happy Coding!
After upgrading the Gradle plugin version to 3.0.0 (classpath "com.android.tools.build:gradle:3.0.0") and if I then try to clean or build the project I get this error:
A problem occurred configuring project ':app'.
> Manifest Tasks does not support the manifestOutputFile property any
more, please use the manifestOutputDirectory instead.
For more information, please check
https://developer.android.com/studio/build/gradle-plugin-3-0-0-
migration.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
* Get more help at https://help.gradle.org
I am not using manifestOutputFile anywhere in any of my gradle files. using the --debug and --stacktrace flags did nothing for me. I'm guessing this issue is coming up in one of my dependencies but I have no idea. Also, I am using Kotlin in a lot of classes; I'm not sure if that matters or not. Does anyone know if there is a way to see which library is throwing this error? Or does anyone have any suggestions or insight around this issue when the build.gradle file does not even reference manifestOutputFile?
Here's most of the build.gradle file:
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://plugins.gradle.org/m2/' }
maven { url 'https://maven.google.com'}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.24.4'
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'gradle.plugin.com.nobleworks_software.icon-overlay:icon-overlay-plugin:1.2.3'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'io.fabric'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: 'jacoco-android'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.nobleworks_software.icon-overlay'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
flatDir {
dirs 'libs'
}
}
ext {
libsSrcDir = new File('${projectDir}/libs')
}
String gpsPropertyName = 'gps'
String gpsPropertyValueAlpha = 'alpha'
String gpsPropertyValueBeta = 'beta'
boolean tangoBuild = false
String tangoPropertyName = 'tango'
String alphaBuildEnding = '20'
String betaBuildEnding = '10'
String productionBuildEnding = '00'
def isBuildForGPS = { ->
return project.hasProperty(gpsPropertyName)
}
def isTangoBuild = { ->
return project.hasProperty(tangoPropertyName)
}
def getBranchName = { ->
try {
def branchOut = new ByteArrayOutputStream()
exec {
commandLine 'git', 'symbolic-ref', '--short', 'HEAD'
standardOutput = branchOut
}
return branchOut.toString().trim()
}
catch (ignored) {
return 'master'
}
}
def getVersionCode = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--count', 'HEAD'
standardOutput = stdout
}
// Make the Tango version use '50' as the least sig offset
int tangoOffset = 0
if (tangoBuild) {
tangoOffset = 50
}
if (isBuildForGPS()) {
String channel = project.findProperty(gpsPropertyName)
if (gpsPropertyValueAlpha == channel) {
return Integer.parseInt(stdout.toString().trim() + alphaBuildEnding) + tangoOffset
} else if (gpsPropertyValueBeta == channel) {
return Integer.parseInt(stdout.toString().trim() + betaBuildEnding) + tangoOffset
}
}
return Integer.parseInt(stdout.toString().trim() + productionBuildEnding) + tangoOffset
}
catch (ignored) {
return -1
}
}
def getVersionName = { ->
try {
if (isBuildForGPS()) {
def tag = getLastTaggedVersion()
String channel = project.findProperty(gpsPropertyName)
if (gpsPropertyValueAlpha == channel) {
tag = tag + '-a'
} else if (gpsPropertyValueBeta == channel) {
tag = tag + '-b'
}
return tag
} else {
return getBranchName()
}
}
catch (ignored) {
return 'X.X.X'
}
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "4g"
}
dataBinding {
enabled = true
}
defaultConfig {
versionCode getVersionCode()
versionName getVersionName()
applicationId getApplicationId()
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled = true
multiDexKeepFile file('multidex_keep_file.txt')
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "com.demoapp.demoapp.WayTestRunner"
renderscriptTargetApi 16
renderscriptSupportModeEnabled true
String branchName = getBranchName().toUpperCase()
String iconOverlayText = branchName.toLowerCase()
buildConfigField "String", "LAST_TAGGED_VERSION", "\"${getLastTaggedVersion()}\""
if (branchName == 'DEV') {
iconOverlayText = 'ALPHA'
} else if (branchName.startsWith('RELEASE')) {
iconOverlayText = 'BETA'
}
if (!isBuildForGPS()) {
iconOverlay {
enabled = true
fontSize = 8
textColor = [255, 255, 255, 255]
verticalLinePadding = 2
backgroundOverlayColor = [0, 0, 0, 180]
text = { "$iconOverlayText" }
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
flavorDimensions("store", "3d_enabled")
productFlavors {
demoapp {
dimension = "store"
applicationId getApplicationId()
// Dupe required because SearchRecentSuggestionsProvider has no available context in its constructor
buildConfigField "String", "SEARCH_RECENT_AUTHORITY", "\"${applicationId}.WFSearchRecentSuggestionsProvider\""
// And one for the manifest
resValue "string", "SEARCH_RECENT_AUTHORITY", "${applicationId}.WFSearchRecentSuggestionsProvider"
// These need to be defined as string resources so they can be registered in the manifest.
// However in order to access them in tests it's convenient to have them also defined in BuildConfig
String deepLinkScheme = "demoappapp"
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME1", deepLinkScheme
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME2", deepLinkScheme
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME1", "\"${deepLinkScheme}\""
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME2", "\"${deepLinkScheme}\""
if (getBranchName().toUpperCase() == 'MASTER') {
manifestPlaceholders = [
appIcon : "#mipmap/ic_launcher",
appRoundIcon: "#mipmap/ic_launcher_round"
]
} else {
manifestPlaceholders = [
appIcon : "#mipmap/ic_launcher_dev",
appRoundIcon: "#mipmap/ic_launcher_dev_round"
]
}
}
demoappflavor {
dimension = "store"
applicationId getDemoappflavorApplicationId()
// Dupe required because SearchRecentSuggestionsProvider has no available context in its constructor
buildConfigField "String", "SEARCH_RECENT_AUTHORITY", "\"${applicationId}.WFSearchRecentSuggestionsProvider\""
// And one for the manifest
resValue "string", "SEARCH_RECENT_AUTHORITY", "${applicationId}.WFSearchRecentSuggestionsProvider"
// These need to be defined as string resources so they can be registered in the manifest.
// However in order to access them in tests it's convenient to have them also defined in BuildConfig
String deepLinkScheme1 = "theapp"
String deepLinkScheme2 = "demoappflavorapp"
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME1", deepLinkScheme1
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME2", deepLinkScheme2
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME1", "\"${deepLinkScheme1}\""
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME2", "\"${deepLinkScheme2}\""
manifestPlaceholders = [
appIcon : "#mipmap/ic_launcher",
appRoundIcon: "#mipmap/ic_launcher_round"
]
}
}
android.variantFilter { variant ->
def store = variant.getFlavors().get(0).name
def tango_enabled = variant.getFlavors().get(1).name
// Disable building the tango dimension
if ((store == 'demoappflavor' || !isTangoBuild()) && tango_enabled == "tangoEnabled") {
variant.setIgnore(true)
}
}
buildTypes {
release {
// Commented out to stop a production build crash with OKIO
//minifyEnabled true
// Commented out due to Gradle 2.2.0 issue
//shrinkResources true
ext.enableCrashlytics = true
apply plugin: 'signing'
signingConfig signingConfigs.release
ext.betaDistributionReleaseNotesFilePath = './release-notes.txt'
ext.betaDistributionGroupAliases = 'android-nightly'
buildConfigField 'boolean', 'OVERRIDE_MIN_VERSION', isBuildForGPS() ? 'false' : 'true'
buildConfigField 'boolean', 'ENABLE_APPSEE', isBuildForGPS() ? 'true' : 'false'
}
debug {
// TODO: Uncomment this out to enable code coverage
// testCoverageEnabled true
buildConfigField 'boolean', 'OVERRIDE_MIN_VERSION', isBuildForGPS() ? 'false' : 'true'
buildConfigField 'boolean', 'ENABLE_APPSEE', isBuildForGPS() ? 'true' : 'false'
}
configurations.all {
resolutionStrategy {
force 'com.google.code.findbugs:jsr305:1.3.9'
force 'com.google.guava:guava:21.0'
force "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
force 'com.google.code.gson:gson:2.8.2'
}
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'bin/AndroidManifest.xml'
exclude 'bin/jarlist.cache'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
return 0
}
testOptions {
// Disable animations for UI testing
animationsDisabled = true
unitTests.returnDefaultValues = true
unitTests.all {
jacoco {
includeNoLocationClasses = true
}
}
}
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
}
configurations {
demoappTangoEnabledCompile
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://clojars.org/repo/" }
}
}
ext.daggerVersion = '2.11'
ext.playServicesVersion = '11.6.2'
ext.supportLibsVersion = '27.0.1'
ext.robolectricVersion = '3.3.2'
ext.frescoVersion = '1.5.0'
ext.leakCanaryVersion = '1.5.4'
ext.roomVersion ='1.0.0'
ext.butterKnifeVersion ='8.7.0'
ext.espressoVersion ='3.0.1'
ext.gsonVersion ='2.8.2'
ext.mockitoVersion ='2.9.0'
ext.dexmakerVersion ='1.2'
ext.icepickVersion ='3.2.0'
ext.multidexVersion ='1.0.2'
dependencies {
// Compile Project
compile(project(':models'))
// Compile
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
// GOOGLE LIBS
compile "com.android.support:design:${supportLibsVersion}"
compile "com.android.support:recyclerview-v7:${supportLibsVersion}"
compile "com.android.support:cardview-v7:${supportLibsVersion}"
compile "com.android.support:support-v4:${supportLibsVersion}"
compile "com.android.support:support-v13:${supportLibsVersion}"
compile "com.android.support:percent:${supportLibsVersion}"
compile "com.android.support:support-annotations:${supportLibsVersion}"
compile "com.android.support:appcompat-v7:${supportLibsVersion}"
compile "com.android.support:multidex:${multidexVersion}"
compile "com.google.code.gson:gson:${gsonVersion}"
// FIREBASE AND PLAY SERVICES
compile "com.google.firebase:firebase-messaging:${playServicesVersion}"
compile "com.google.firebase:firebase-appindexing:${playServicesVersion}"
//noinspection GradleDependency
compile "com.google.android.gms:play-services-analytics:${playServicesVersion}"
//noinspection GradleDependency
compile "com.google.android.gms:play-services-auth:${playServicesVersion}"
//noinspection GradleDependency
compile "com.google.android.gms:play-services-wallet:${playServicesVersion}"
// FLOW LAYOUT FOR CHIPS
compile 'org.apmem.tools:layouts:1.10#aar'
// RxJava and related
compile 'io.reactivex.rxjava2:rxjava:2.1.7'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile project(':FloatingSearchView')
// RxJava support for Room
compile 'android.arch.persistence.room:rxjava2:1.0.0'
// Testing support
androidTestCompile 'android.arch.core:core-testing:1.1.0'
// Dagger
compile "com.google.dagger:dagger:${daggerVersion}"
compile "com.google.dagger:dagger-android-support:${daggerVersion}"
kapt "com.google.dagger:dagger-compiler:${daggerVersion}"
kapt "com.google.dagger:dagger-android-processor:${daggerVersion}"
compile ("com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}") {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
compile "com.jakewharton:butterknife:${butterKnifeVersion}"
kapt "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
compile 'com.appsee:appsee-android:2.3.4'
compile 'commons-io:commons-io:2.5'
compile "com.android.support.test:runner:1.0.1"
// ESPRESSO
androidTestCompile "com.android.support:support-v4:${supportLibsVersion}"
androidTestCompile "com.android.support:support-annotations:${supportLibsVersion}"
androidTestCompile "com.android.support:recyclerview-v7:${supportLibsVersion}"
androidTestCompile "com.android.support:design:${supportLibsVersion}"
androidTestCompile "com.android.support:recyclerview-v7:${supportLibsVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-core:${espressoVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-intents:${espressoVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-contrib:${espressoVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-web:${espressoVersion}"
androidTestCompile "org.mockito:mockito-core:${mockitoVersion}"
androidTestCompile "com.google.dexmaker:dexmaker:${dexmakerVersion}"
androidTestCompile "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}"
androidTestCompile "com.android.support:multidex:${multidexVersion}"
androidTestCompile "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
androidTestCompile "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
androidTestCompile "com.google.code.gson:gson:${gsonVersion}"
androidTestCompile('com.jakewharton.espresso:okhttp3-idling-resource:1.0.0') {
//Using App Version Instead
exclude group: 'com.squareup.okio', module: 'okio'
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
//WireMock
androidTestCompile( project(":wiremock")) {
//Using Android Version Instead
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'org.ow2.asm', module: 'asm'
//Using Android Version Instead
exclude group: 'org.json', module: 'json'
exclude group: 'com.google.guava', module: 'guava'
}
androidTestCompile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:${mockitoVersion}"
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile "org.robolectric:robolectric:${robolectricVersion}"
testCompile "org.robolectric:shadows-multidex:${robolectricVersion}"
testCompile "org.robolectric:shadows-support-v4:${robolectricVersion}"
testCompile "com.google.code.gson:gson:${gsonVersion}"
testCompile "com.google.dagger:dagger:${daggerVersion}"
testCompile "com.android.support:multidex:${multidexVersion}"
kaptTest "com.google.dagger:dagger-compiler:${daggerVersion}"
// Kotlin mockito
testCompile ("com.nhaarman:mockito-kotlin-kt1.1:1.5.0"){
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect'
}
compile "frankiesardo:icepick:${icepickVersion}"
provided "frankiesardo:icepick-processor:${icepickVersion}"
compile "com.facebook.fresco:fresco:${frescoVersion}"
compile "com.facebook.fresco:animated-gif:${frescoVersion}"
// Canary
debugCompile "com.squareup.leakcanary:leakcanary-android:${leakCanaryVersion}"
releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
androidTestCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
testCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
compile 'com.prolificinteractive:material-calendarview:1.4.3'
//Card IO
compile 'io.card:android-sdk:5.5.1'
compile 'com.facebook.rebound:rebound:0.3.8'
//Chrome Web-View
compile "com.android.support:customtabs:${supportLibsVersion}"
def folder = new File('./brickkit-android/BrickKit/bricks/build.gradle')
if (folder.exists()) {
compile project(':bricks')
} else {
compile 'com.demoapp:brickkit-android:0.9.27'
}
// intellij annotations are included in kotlin, so this creates
// a "java.util.zip.ZipException: duplicate entry" on its modules
//compile 'com.intellij:annotations:12.0#jar'
testCompile "com.google.dagger:dagger:${daggerVersion}"
demoappTangoEnabledCompile project(':demoappView')
compile ('com.perimeterx.sdk:msdk:1.1.0') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
// Kotlin support
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
//Data binding
kapt "com.android.databinding:compiler:$gradleVersion"
compile 'nl.littlerobots.rxlint:rxlint:1.4'
// Room
compile "android.arch.persistence.room:runtime:${roomVersion}"
kapt "android.arch.persistence.room:compiler:${roomVersion}"
androidTestCompile "android.arch.persistence.room:testing:${roomVersion}"
// Stetho
compile 'com.facebook.stetho:stetho:1.5.0'
compile 'com.facebook.stetho:stetho-js-rhino:1.4.2'
compile 'com.siftscience:sift-android:0.9.10'
}
import groovy.json.JsonBuilder
task uploadapithingFiles << {
// Get all the apithing files
String apithingDir = "${project.rootDir}/models/src/main/java/com/demoapp/models/requests/apithing-files"
FileTree files = fileTree(dir: apithingDir)
// TreeMap of File names and File Data
TreeMap<String, String> fileMap = new TreeMap<>()
files.each { file ->
Scanner input = new Scanner(file)
String output = ""
while (input.hasNext()) {
output = output + input.nextLine()
}
input.close()
fileMap.put(file.name.take(file.name.lastIndexOf('.')), output)
}
// Build request JSON
def json = new JsonBuilder()
json{
payload {
build_id getVersionCode()
client_id 2
version lastTaggedVersion
is_production isBuildForGPS() ? 1 : 0
queries fileMap.collect {
[
"name": it.key,
"query": it.value
]
}
}
}
// Create POST Request
def url = 'http://services.demoapp.com:8280/purest/performance/app_apithing'
def post = new URL(url).openConnection()
def message = json.toString()
projects.logger.debug(message)
post.setRequestMethod("POST")
post.setRequestProperty("Content-Type", "application/json; charset=utf-8")
post.setDoOutput(true)
post.getOutputStream().write(message.getBytes("UTF-8"))
def responseCode = post.getResponseCode()
if(responseCode >= 200 && responseCode <= 299) {
projects.logger.lifecycle("apithing upload successful.")
} else {
projects.logger.lifecycle("apithing Upload Failed with response: ${post.getResponseMessage()}")
throw new GradleException("ERROR: Unable to upload apithing files. Server returned a response code: ${responseCode}")
}
}
project.gradle.taskGraph.whenReady {
->
project.tasks.findAll { it.name =~ /connected.+AndroidTest/ }.each {
it.ignoreFailures = true
}
}
def errorOutput(dir) {
println "\n\n================OUTPUT REPORT=================\n\n"
println "The file $dir does not exist\n "
println "Check the current APK Path and Version "
println "\n\n==============================================\n\n"
}
def executeUpload(dir, isUpload, key) {
if (isUpload) {
exec {
commandLine 'curl', 'https://tok_gh6e7yrydkhgqyaz2fvx702y8m#api.appetize.io/v1/apps', '-F', "file=#$dir", '-F', 'platform=android'
}
} else {
exec {
commandLine 'curl', "https://tok_gh6e7yrydkhgqyaz2fvx702y8m#api.appetize.io/v1/apps/$key", '-F', "file=#$dir", '-F', 'platform=android'
}
}
}
apply plugin: 'com.google.gms.google-services'
jacocoAndroidUnitTestReport {
excludes += ['**/R.class','**/R$*.class','**/*$ViewInjector*.*','**/*$ViewBinder*.*','**/BuildConfig.*','**/Manifest*.*','**/*$Lambda$*.*','**/*Module.*','**/*Dagger*.*','**/*MembersInjector*.*','**/*_Provide*Factory*.*','**/*_Factory*.*','**/*$*$*.*','**/test*/**','**/androidTest/**','**/databinding/**']
}
tasks.whenTaskAdded { task ->
if (task.name == 'connecteddemoappDebugAndroidTest' || task.name == 'connecteddemoappflavorDebugAndroidTest') {
task.doFirst() {
exec {
commandLine 'sh', 'get_android_wiremock.sh'
}
}
task.doLast() {
exec {
commandLine 'sh', 'get_device_recordings.sh', 'wiremock_blacklist.txt'
}
}
}
}
android.applicationVariants.all { variant ->
task("checkstyle${variant.name.capitalize()}", type: Checkstyle) {
configFile file("${project.rootDir}/config/quality/checkstyle/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
source 'src'
include '**/*.java'
exclude '**/gen/**'
exclude '**/models/generated/**'
classpath = files() as FileCollection
group = "verification"
}
check.dependsOn("checkstyle${variant.name.capitalize()}")
}
android.applicationVariants.all { variant ->
task("findbugs${variant.name.capitalize()}", type: FindBugs) {
ignoreFailures = false
effort = "default"
reportLevel = "medium"
excludeFilter = new File("${project.rootDir}/config/quality/findbugs/findbugs-filter.xml")
classes = files("${project.rootDir}/app/build/intermediates/classes")
source = fileTree('src/main/java/')
classpath = files()
group = "verification"
reports {
xml.enabled = false
html.enabled = true
xml {
destination "$project.buildDir/findbugs/findbugs-output.xml"
}
html {
destination "$project.buildDir/findbugs/findbugs-output.html"
}
}
dependsOn "compile${variant.name.capitalize()}JavaWithJavac"
}
check.dependsOn("findbugs${variant.name.capitalize()}")
}
android.applicationVariants.all { variant ->
task("buildCheckTest${variant.name.capitalize()}", type: GradleBuild) {
dependsOn "checkstyle${variant.name.capitalize()}"
dependsOn "assemble${variant.name.capitalize()}"
dependsOn "lint${variant.name.capitalize()}"
dependsOn "findbugs${variant.name.capitalize()}"
dependsOn "test${variant.name.capitalize()}UnitTest"
dependsOn "jacocoTest${variant.name.capitalize()}UnitTestReport"
mustRunAfter "clean"
}
}
task buildReleaseTest(type: GradleBuild)
android.applicationVariants.all { variant ->
if (variant.name.endsWith("Release")) {
buildReleaseTest.dependsOn("buildCheckTest${variant.name.capitalize()}")
}
}
android.applicationVariants.all { v ->
if (v.buildType.name == "release"){
v.assemble.dependsOn("uploadapithingFiles")
}
}
buildReleaseTest.mustRunAfter('clean')
task cleanBuildReleaseTest(type: GradleBuild)
cleanBuildReleaseTest.dependsOn('clean')
cleanBuildReleaseTest.dependsOn('buildReleaseTest')
Whoa, that's a lot of plugins. The error message comes because one of them depends on an API that was changed in 3.x (hence migration link). You'll need to update the corresponding plugin.
Based on gradle dependencies run at step 3 below, my guess is gradle.plugin.com.nobleworks_software.icon-overlay:icon-overlay-plugin. It shows com.android.tools.build:gradle:2.2.3 -> 3.0.1 nested under.
(gradlew buildEnvironment on your project may also give you a similar result if you add 3.0.1 Android Gradle Plugin to your build.gradle)
--stacktrace should have also given you the exact location where com.android.build.gradle.tasks.ManifestProcessorTask#getManifestOutputFile was called from. If it doesn't you can still do below:
This is a way I would answer this question if I had an mvce. You have too many plugins to set up everything manually from scratch. This method is also applicable to any Gradle buildscript weirdness in plugins.
Close your project in AS/IDEA
Note: if you have a buildSrc in your project that could also work, so there's no need to close and create another.
Create another project (let's call it debugger) with build.gradle file as follows:
buildscript {}'s contents from your project (but no buildscript block!)
repositories {
jcenter()
...
}
dependencies {
implementation ... // for each classpath ...
}
add plugins { id 'java' } on root level
add implementation 'com.android.tools.build:gradle:3.0.1' inside dependencies
Open this project in IDEA/Android Studio
(this will download all the sources for those plugins)
Run gradlew --no-daemon -Dorg.gradle.debug=true --debug --stacktrace from terminal
(this will stop executing and wait,
note: Listening for transport dt_socket at address: 5005)
Go to "Run/Debug configurations" dialog in debugger project
Create a "Remote" configuration (green +) with parameters from Gradle's log:
Close dialog with OK / Apply
Jump to class/file com.android.build.gradle.tasks.ManifestProcessorTask inside gradle-core-3.0.1-sources.jar
Put a breakpoint at line 128 in ManifestProcessorTask.getManifestOutputFile
To be safe repeat above two steps for gradle-core-3.0.1.jar's decompiled code as well. (line number may differ)
Run menu > Debug "Remote"
Wait and celebrate when breakpoint hits and you see who calls the method in the Debug view's Stack frame listing.
It looks overwhelming, but it's quite simple and fast after you did this once.
I have found many versions of this on StackOverflow, but none of the answers that I have found have helped and some have even made more errors. But after forking a project from GitHub and editing the the Gradle and SDK versions, I came across this error:
Error:(70, 0) Cannot convert the provided notation to a File or URI: [C:\Android Projects\Personal\VoidMessenger\build\intermediates\proguard-files\proguard-android.txt-2.2.0, C:\Android Projects\Personal\VoidMessenger\proguard.cfg].
The following types/formats are supported:
- A String or CharSequence path, for example 'src/main/java' or '/usr/include'.
- A String or CharSequence URI, for example 'file:/usr/include'.
- A File instance.
- A URI or URL instance.
This came after I imported the project from GitHub into Android Studio, and changing the SDK and build versions to 25 and the Gradle version to 2.2.0. Here is my build.gradle and my settings.gradle.
Build.Gradle:
apply plugin: 'com.android.application'
apply plugin: 'witness'
buildscript {
repositories {
maven {
url "https://repo1.maven.org/maven2"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath files('libs/gradle-witness.jar')
}
}
repositories {
maven {
url "https://repo1.maven.org/maven2/"
}
jcenter()
mavenLocal()
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
versionCode 1
versionName "0.1"
minSdkVersion 9
targetSdkVersion 25
try{
buildConfigField "String", "BUILD_GIT_COMMIT", "\"" + 'git rev-parse --short HEAD'.execute().text.trim() + "\""
}
catch(IOException e){
buildConfigField "String", "BUILD_GIT_COMMIT", '""'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'LICENSE'
exclude 'NOTICE'
exclude 'asm-license.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
signingConfigs {
release
}
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
release {
minifyEnabled true
proguardFiles = buildTypes.debug.proguardFiles
testProguardFiles buildTypes.debug.testProguardFiles
signingConfig signingConfigs.release
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
androidTest {
java.srcDirs = ['test/androidTest/java']
}
test {
java.srcDirs = ['test/unitTest/java']
}
}
lintOptions {
abortOnError false
}
}
tasks.whenTaskAdded { task ->
if (task.name.equals("lint")) {
task.enabled = false
}
}
def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()){
props.load(new FileInputStream(propFile))
if (props !=null &&
props.containsKey('STORE_FILE') &&
props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') &&
props.containsKey('KEY_PASSWORD'))
{
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
}else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
tasks.withType(JavaCompile){
options.warnings = false
}
dependencies {
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
compile project (':libs:org.w3c.dom')
compile 'info.guardianproject.trustedintents:trustedintents:0.2'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.makeramen:roundedimageview:2.1.0'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'pl.tajchert:waitingdots:0.1.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.google.zxing:android-integration:3.1.0'
compile project (':libs:com.android.support.support-v4-preferencefragment')
compile ('com.android.support:gridlayout-v7:22.2.0') {
exclude module: 'support-v4'
}
compile 'com.squareup.dagger:dagger:1.2.2'
compile ("com.doomonafireball.betterpickers:library:1.5.3") {
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.madgag.spongycastle:prov:1.51.0.0'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
compile project (':libs:org.whispersystems.jobmanager')
compile project (':libs:org.whispersystems.libpastelog:library')
compile 'org.whispersystems:textsecure-android:1.8.3'
compile project (':libs:com.amulyakhare.textdrawable:library')
compile 'me.relex:circleindicator:1.0.0#aar'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.powermock:powermock-api-mockito:1.6.1'
testCompile 'org.powermock:powermock-module-junit4:1.6.1'
testCompile 'org.powermock:powermock-module-junit4-rule:1.6.1'
testCompile 'org.powermock:powermock-classloading-xstream:1.6.1'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
androidTestCompile ('org.assertj:assertj-core:1.7.1') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
androidTestCompile ('com.squareup.assertj:assertj-android:1.0.0') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
exclude group: 'com.android.support', module: 'support-annotations'
}
}
dependencyVerification {
verify = [
'pl.tajchert:waitingdots:2835d49e0787dbcb606c5a60021ced66578503b1e9fddcd7a5ef0cd5f095ba2c',
'com.android.support:appcompat-v7:4b5ccba8c4557ef04f99aa0a80f8aa7d50f05f926a709010a54afd5c878d3618',
'com.android.support:recyclerview-v7:b0f530a5b14334d56ce0de85527ffe93ac419bc928e2884287ce1dddfedfb505',
'com.android.support:design:58be3ca6a73789615f7ece0937d2f683b98b594bb90aa10565fa760fb10b07ee',
'com.android.support:support-v4:c62f0d025dafa86f423f48df9185b0d89496adbc5f6a9be5a7c394d84cf91423',
'com.android.support:support-annotations:104f353b53d5dd8d64b2f77eece4b37f6b961de9732eb6b706395e91033ec70a',
'com.android.support:gridlayout-v7:a9b770cffca2c7c5cd83cba4dd12503365de5e8d9c79c479165adf18ab3bc25b',
'com.doomonafireball.betterpickers:library:132ecd685c95a99e7377c4e27bfadbb2d7ed0bea995944060cd62d4369fdaf3d',
'com.madgag.spongycastle:prov:b8c3fec3a59aac1aa04ccf4dad7179351e54ef7672f53f508151b614c131398a',
'com.fasterxml.jackson.core:jackson-annotations:0ca408c24202a7626ec8b861e99d85eca5e38b73311dd6dd12e3e9deecc3fe94',
'com.fasterxml.jackson.core:jackson-core:cbf4604784b4de226262845447a1ad3bb38a6728cebe86562e2c5afada8be2c0',
'com.fasterxml.jackson.core:jackson-databind:835097bcdd11f5bc8a08378c70d4c8054dfa4b911691cc2752063c75534d198d',
'com.github.bumptech.glide:glide:76ef123957b5fbaebb05fcbe6606dd58c3bc3fcdadb257f99811d0ac9ea9b88b',
'com.github.chrisbanes.photoview:library:8b5344e206f125e7ba9d684008f36c4992d03853c57e5814125f88496126e3cc',
'com.google.protobuf:protobuf-java:e0c1c64575c005601725e7c6a02cebf9e1285e888f756b2a1d73ffa8d725cc74',
'com.google.zxing:android-integration:89e56aadf1164bd71e57949163c53abf90af368b51669c0d4a47a163335f95c4',
'com.googlecode.libphonenumber:libphonenumber:9625de9d2270e9a280ff4e6d9ef3106573fb4828773fd32c9b7614f4e17d2811',
'com.jpardogo.materialtabstrip:library:c6ef812fba4f74be7dc4a905faa4c2908cba261a94c13d4f96d5e67e4aad4aaa',
'com.makeramen:roundedimageview:1f5a1865796b308c6cdd114acc6e78408b110f0a62fc63553278fbeacd489cd1',
'com.pnikosis:materialish-progress:d71d80e00717a096784482aee21001a9d299fec3833e4ebd87739ed36cf77c54',
'de.greenrobot:eventbus:61d743a748156a372024d083de763b9e91ac2dcb3f6a1cbc74995c7ddab6e968',
'info.guardianproject.trustedintents:trustedintents:6221456d8821a8d974c2acf86306900237cf6afaaa94a4c9c44e161350f80f3e',
'com.melnykov:floatingactionbutton:15d58d4fac0f7a288d0e5301bbaf501a146f5b3f5921277811bf99bd3b397263',
'com.nineoldandroids:library:68025a14e3e7673d6ad2f95e4b46d78d7d068343aa99256b686fe59de1b3163a',
'com.squareup.dagger:dagger:789aca24537022e49f91fc6444078d9de8f1dd99e1bfb090f18491b186967883',
'com.squareup.okio:okio:5e1098bd3fdee4c3347f5ab815b40ba851e4ab1b348c5e49a5b0362f0ce6e978',
'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
'org.apache.httpcomponents:httpclient-android:6f56466a9bd0d42934b90bfbfe9977a8b654c058bf44a12bdc2877c4e1f033f1',
'org.whispersystems:axolotl-android:40d3db5004a84749a73f68d2f0d01b2ae35a73c54df96d8c6c6723b96efb6fc0',
'org.whispersystems:axolotl-java:6daee739b89d8d7101de6d98f77132fee48495c6ea647d880e77def842f999ea',
'org.whispersystems:curve25519-android:3c29a4131a69b0d16baaa3d707678deb39602c3a3ffd75805ce7f9db252e5d0d',
'org.whispersystems:curve25519-java:9ccef8f5aba05d9942336f023c589d6278b4f9135bdc34a7bade1f4e7ad65fa3',
'org.whispersystems:textsecure-android:aec5fc59952d9f5482491091091687816f46be1144342a0244f48fd55d6ab393',
'org.whispersystems:textsecure-java:b407ca6d1430204dfabf38e27db22d5177409072a9668238bd1877de7676ad3f',
'se.emilsjolander:stickylistheaders:a08ca948aa6b220f09d82f16bbbac395f6b78897e9eeac6a9f0b0ba755928eeb',
'com.squareup.okhttp:okhttp:89b7f63e2e5b6c410266abc14f50fe52ea8d2d8a57260829e499b1cd9f0e61af',
]
Settings.Gradle:
include 'libs:com.amulyakhare.textdrawable:library',
'libs:com.android.support.support-v4-preferencefragment',
'libs:org.w3c.dom',
'libs:org.whispersystems.jobmanager',
'libs:org.whispersystems.libpastelog:library'
What could be going on? Also, before editing the gradle version, I got an error saying "Cannot find 'default'". But what could be causing the error stated in this post?
"Cannot find default" is related to some missing project module dependencies. This normally happens when you download from net and some modules codes are missing. these have to be added manually.