I have project in Kotlin and I have updated Android Studio to 2.3.3 and gradle to 3.3 and build tools to 25.3.1. During building I got this error:
Caused by: java.lang.UnsupportedOperationException: The "android" command is no longer included in the SDK. Any references to it (e.g. by third-party plugins) should be removed.
at com.android.SdkConstants.androidCmdName(SdkConstants.java:1947)
at com.android.SdkConstants$androidCmdName$0.callStatic(Unknown Source)
at com.jakewharton.sdkmanager.internal.AndroidCommand$Real.<init>(AndroidCommand.groovy:21)
at com.jakewharton.sdkmanager.internal.PackageResolver.resolve(PackageResolver.groovy:22)
at com.jakewharton.sdkmanager.internal.PackageResolver$resolve.call(Unknown Source)
at com.jakewharton.sdkmanager.SdkManagerPlugin$_apply_closure2$_closure3.doCall(SdkManagerPlugin.groovy:44)
at com.jakewharton.sdkmanager.SdkManagerPlugin$_apply_closure2$_closure3.doCall(SdkManagerPlugin.groovy)
at com.jakewharton.sdkmanager.SdkManagerPlugin.time(SdkManagerPlugin.groovy:51)
at com.jakewharton.sdkmanager.SdkManagerPlugin$_apply_closure2.doCall(SdkManagerPlugin.groovy:43)
at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy16.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:82)
... 56 more
Gralde file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
jcenter()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.github.JakeWharton:sdk-manager-plugin:master'
}
}
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
apply plugin: 'io.fabric'
task increaseBuildStageVersion << {
def versionPropsFileI = file('version.properties')
if (versionPropsFileI.canRead()) {
def Properties versionPropsI = new Properties()
versionPropsI.load(new FileInputStream(versionPropsFileI))
def value = 1
println("INCREASING STAGE VERSION")
def versionBuild = versionPropsI['VERSION_BUILD_STAGE'].toInteger() + value
def codeVersion = versionPropsI['VERSION_CODE_STAGE'].toInteger() + value
versionPropsI['VERSION_BUILD_STAGE'] = versionBuild.toString()
versionPropsI['VERSION_CODE_STAGE'] = codeVersion.toString()
versionPropsI.store(versionPropsFileI.newWriter(), null)
} else {
throw new GradleException("Could not read version.properties!")
}
}
task increaseBuildProductionVersion << {
def versionPropsFileI = file('version.properties')
if (versionPropsFileI.canRead()) {
def Properties versionPropsI = new Properties()
versionPropsI.load(new FileInputStream(versionPropsFileI))
def value = 1
println("INCREASING PRODUCTION VERSION")
def versionBuild = versionPropsI['VERSION_BUILD_PRODUCTION'].toInteger() + value
def codeVersion = versionPropsI['VERSION_CODE_PRODUCTION'].toInteger() + value
versionPropsI['VERSION_BUILD_PRODUCTION'] = versionBuild.toString()
versionPropsI['VERSION_CODE_PRODUCTION'] = codeVersion.toString()
versionPropsI.store(versionPropsFileI.newWriter(), null)
} else {
throw new GradleException("Could not read version.properties!")
}
}
tasks.whenTaskAdded { task ->
if (task.name == 'packageStageRelease') {
task.dependsOn increaseBuildStageVersion
} else if (task.name == 'packageProductionRelease') {
task.dependsOn increaseBuildProductionVersion
}
}
android {
signingConfigs {
release {
.....
}
}
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.fivedottwelve.bonusapp"
minSdkVersion 19
targetSdkVersion 25
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def buildTime = new GregorianCalendar().format("dd-MM-yyyy' 'h:mm:ss a Z")
buildConfigField "String", "GIT_SHA", "\"{$gitSha}\""
buildConfigField "String", "BUILD_TIME", "\"{$buildTime}\""
}
debug {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
buildConfigField "String", "GIT_SHA", "\"DEBUG\""
buildConfigField "String", "BUILD_TIME", "\"BUILD_TIME\""
}
}
productFlavors {
development {
versionName "1.0." + getStageVersionName() + "-stage"
versionCode getStageVersionCode()
applicationIdSuffix ".stage"
resValue "string", "app_name", "BonusApp"
buildConfigField('String', 'API_URL', "\"https://fivedottwelve.com/\"")
}
stage {
versionName "1.0." + getStageVersionName() + "-stage"
versionCode getStageVersionCode()
applicationIdSuffix ".stage"
resValue "string", "app_name", "BonusApp"
buildConfigField('String', 'API_URL', "\"https://fivedottwelve.com/\"")
}
production {
versionName "1.0." + getProdVersionName()
versionCode getProdVersionCode()
resValue "string", "app_name", "BonusApp"
buildConfigField('String', 'API_URL', "\"https://fivedottwelve.com/\"")
}
}
dexOptions {
preDexLibraries true
maxProcessCount 6
javaMaxHeapSize "3g"
}
testOptions {
unitTests.all {
// All the usual Gradle options.
testLogging {
jvmArgs '-XX:MaxPermSize=256m'
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen { false }
showStandardStreams = true
}
}
}
lintOptions {
disable 'InvalidPackage', 'ContentDescription'
abortOnError false
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
packagingOptions {
exclude 'main/AndroidManifest.xml'
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
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 'LICENSE.txt'
exclude 'LICENSE'
}
}
kapt {
generateStubs = true
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'com.github.salomonbrys.kotson:kotson:2.5.0'
compile "com.android.support:support-v4:$rootProject.ext.android_support_version"
compile "com.android.support:appcompat-v7:$rootProject.ext.android_support_version"
compile "com.android.support:design:$rootProject.ext.android_support_version"
compile "com.android.support:recyclerview-v7:$rootProject.ext.android_support_version"
compile "com.android.support:cardview-v7:$rootProject.ext.android_support_version"
compile 'com.android.support:multidex:1.0.1'
compile "com.google.android.gms:play-services-base:$rootProject.ext.play_service_version"
compile "com.google.android.gms:play-services-gcm:$rootProject.ext.play_service_version"
kapt "com.google.dagger:dagger-compiler:$rootProject.ext.Dagger_version"
compile "com.google.dagger:dagger:$rootProject.ext.Dagger_version"
compile "io.reactivex:rxjava:$rootProject.ext.RxJava_version"
compile "io.reactivex:rxandroid:$rootProject.ext.RxAndroid_version"
provided 'javax.annotation:jsr250-api:1.0'
compile "com.squareup.okhttp3:okhttp:$rootProject.ext.retrofit_http_version"
compile "com.squareup.okhttp3:okhttp-urlconnection:$rootProject.ext.retrofit_http_version"
compile "com.squareup.okhttp3:logging-interceptor:$rootProject.ext.retrofit_http_version"
compile "com.squareup.retrofit2:retrofit:$rootProject.ext.retorfit_version"
compile "com.squareup.retrofit2:converter-gson:$rootProject.ext.retorfit_version"
compile "com.squareup.retrofit2:adapter-rxjava:$rootProject.ext.retorfit_version"
compile 'com.facebook.android:facebook-android-sdk:4.20.0'
compile 'me.relex:circleindicator:1.2.1#aar'
//glide
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0#aar'
//transitions
compile "com.andkulikov:transitionseverywhere:1.7.0"
//beacons
compile "com.kontaktio:sdk:$rootProject.ext.kontakt_io"
compile('com.crashlytics.sdk.android:crashlytics:2.6.7#aar') {
transitive = true;
}
}
repositories {
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
maven { url 'http://maven.livotovlabs.pro/content/groups/public' }
maven { url 'https://maven.fabric.io/public' }
}
/*
Resolves dependency versions across test and production APKs, specifically, transitive
dependencies. This is required since Espresso internally has a dependency on support-annotations.
*/
configurations.all {
resolutionStrategy.force "com.android.support:support-annotations:$rootProject.ext.android_support_version"
}
/*
All direct/transitive dependencies shared between your test and production APKs need to be
excluded from the test APK! This is necessary because both APKs will contain the same classes. Not
excluding these dependencies from your test configuration will result in an dex pre-verifier error
at runtime. More info in this tools bug: (https://code.google.com/p/android/issues/detail?id=192497)
*/
configurations.compile.dependencies.each { compileDependency ->
println "Excluding compile dependency: ${compileDependency.getName()}"
configurations.androidTestCompile.dependencies.each { androidTestCompileDependency ->
configurations.androidTestCompile.exclude module: "${compileDependency.getName()}"
}
}
I removed apply plugin: 'android-sdk-manager' and it works
Related
I'm manually uploading the build in Crashlytics Beta. But the version number always shows as 0.0(0) like mentioned in this post. (Please don't mark as duplicate as this is a bit different as this occurs even with manual upload) I'm using Android Studio 3.1.3. and Gradle version 4.4
Here's my gradle :
classpath 'io.fabric.tools:gradle:1.+'
compile('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true;
}
Complete app/build.gradle :
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.3'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'io.fabric'
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://kochava.bintray.com/maven' }
}
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
flavorDimensions "default"
useLibrary 'org.apache.http.legacy'
dexOptions {
preDexLibraries true
javaMaxHeapSize "2g" // Use gig increments depending on needs
}
lintOptions {
abortOnError false
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
repositories {
flatDir { dirs 'libs' }
}
signingConfigs {
debugConfig {
storeFile file('keystore/debug.keystore')
storePassword "/*password*/"
keyAlias "androiddebugkey"
keyPassword "/*password*/"
}
releaseConfig {
storeFile file("keystore/release.keystore")
storePassword "/*password*/"
keyAlias "/*KeyAliasname*/"
keyPassword "/*password*/"
}
}
// Versioning
def versionPropsFile = file('version.properties')
def versionBuild
/*Setting default value for versionBuild which is the last incremented value stored in the file */
if (versionPropsFile.canRead()) {
Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
versionBuild = versionProps['VERSION_BUILD'].toInteger()
} else {
throw new GradleException("Could not read version.properties!")
}
/*Wrapping inside a method avoids auto incrementing on every gradle task run. Now it runs only when we build apk*/
ext.autoIncrementBuildNumber = {
if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
versionProps.load(file("version.properties").newReader()/*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 appId = "com.example.appName"
def appName = "My App"
def appBuildName = "appBuildName"
def versionMajor = 6
def versionMinor = 6
def versionPatch = 0
def appVersionName = "${versionMajor}.${versionMinor}.${versionPatch}"
def appVersionCode = versionBuild
defaultConfig {
applicationId appId
minSdkVersion 16
targetSdkVersion 27
resValue "bool", "is_prod", "false"
resValue "bool", "is_prod_staging", "false"
resValue "bool", "is_amazon", "false"
// by default, enable logging
resValue "bool", "is_debuggable", "true"
multiDexEnabled = true
}
buildTypes {
applicationVariants.all { variant ->
variant.outputs.all { output ->
def project = appBuildName
def SEP = "-"
def buildType = variant.variantData.variantConfiguration.buildType.name.toUpperCase()
def flavor = variant.productFlavors[0].name.toUpperCase()
def version = "v" + appVersionName + "." + (appVersionCode - 500000)
def newApkName = project + SEP + version + SEP + buildType + SEP + flavor + ".apk"
println "Output Apk Name: " + newApkName
outputFileName = new File(newApkName)
}
}
debug {
applicationIdSuffix ".debug"
ext.enableCrashlytics = false
}
uat {
initWith(buildTypes.debug)
applicationIdSuffix ".uat"
signingConfig signingConfigs.debugConfig
ext.enableCrashlytics = true
}
staging {
applicationIdSuffix ".uat"
signingConfig signingConfigs.debugConfig
debuggable false
// we want the prod endpoint, with no logging
resValue "bool", "is_prod_staging", "true"
resValue "bool", "is_debuggable", "false"
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.enableCrashlytics = true
}
prodStaging {
initWith(buildTypes.staging)
resValue "bool", "is_prod_staging", "false"
resValue "bool", "is_prod", "true"
}
prodStagingNoSuffix {
initWith(buildTypes.prodStaging)
applicationIdSuffix ""
debuggable false
}
release {
// we want the prod endpoint, with no logging
resValue "bool", "is_prod", "true"
resValue "bool", "is_debuggable", "false"
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseConfig
ext.enableCrashlytics = true
}
}
productFlavors {
play {
resValue "bool", "is_amazon", "false"
}
amazon {
resValue "bool", "is_amazon", "true"
}
}
// Hook to check if the release/debug task is among the tasks to be executed.
//Let's make use of it
gradle.taskGraph.whenReady { taskGraph ->
def tasks = taskGraph.getAllTasks()
tasks.find {
println it
if (it.name.toLowerCase().contains("package")
&& !it.name.toLowerCase().contains("debug")
&& !it.name.toLowerCase().contains("release")) {
/* when run release task */
/* note that the task cannot be a release as our release codes need to align */
println("We've matches on the internal release task")
autoIncrementBuildNumber()
return true
}
return false
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'com/kofax/android/abc/configuraPK'
exclude 'META-INF/rxjava.properties'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true;
}
// Apache 2.0
implementation files('libs/adobeMobileLibrary-4.13.2.jar')
implementation files('libs/dagger-2.7.jar')
implementation files('libs/isg-3.2.0.0.0.761.jar')
implementation files('libs/sdk-release.jar')
implementation files('libs/login-with-amazon-sdk.jar')
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'
implementation 'com.squareup:otto:1.3.6'
implementation 'commons-io:commons-io:2.4'
implementation 'commons-codec:commons-codec:1.10'
implementation 'org.apache.commons:commons-lang3:3.4'
implementation 'org.roboguice:roboguice:3.0.1'
implementation 'com.novoda:accessibilitools:1.3.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.kochava.base:tracker:3.0.0#aar'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation project(path: ':linkedin-sdk', configuration: 'default')
implementation 'com.squareup.picasso:picasso:2.5.2'
//rxjava
implementation 'io.reactivex.rxjava2:rxjava:2.1.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
//room
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
implementation 'android.arch.persistence.room:rxjava2:1.1.1'
//gson
implementation 'com.google.code.gson:gson:2.3.1'
//retrofit
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
Note : It used to work fine with Android Studio 2.2
I updated my project to gradle version to 4.0 and android support version library to latest(i.e. 27.0.0) with target api with Android O(26), and made a signed release build.
Now I'm getting this crash when open the app:
java.lang.IllegalAccessError: Method 'boolean android.view.ViewGroup.checkLayoutParams(android.view.ViewGroup$LayoutParams)' is inaccessible to class 'android.support.v7.widget.ActionMenuPresenter' (declaration of 'android.support.v7.widget.ActionMenuPresenter' appears in /data/app/com.myairtelapp-iuW7irEMrfWuoyVjp6OGKA==/base.apk)
at android.support.v7.widget.ActionMenuPresenter.getItemView(:202)
at android.support.v7.widget.ActionMenuPresenter.flagActionItems(:476)
at android.support.v7.view.menu.MenuBuilder.flagActionItems(:1164)
at android.support.v7.view.menu.BaseMenuPresenter.updateMenuView(:95)
at android.support.v7.widget.ActionMenuPresenter.updateMenuView(:229)
at android.support.v7.view.menu.MenuBuilder.dispatchPresenterUpdate(:291)
at android.support.v7.view.menu.MenuBuilder.onItemsChanged(:1051)
at android.support.v7.view.menu.MenuBuilder.startDispatchingItemsChanged(:1078)
at android.support.v7.app.ToolbarActionBar.populateOptionsMenu(:460)
at android.support.v7.app.ToolbarActionBar$1.run(:55)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)'
My build.gradle is:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'net.researchgate.release'
apply plugin: 'dexguard'
android {
compileSdkVersion project.ext.compile_sdk_version
buildToolsVersion project.ext.build_tools_version
lintOptions {
quiet false
abortOnError false
ignoreWarnings false
disable "ResourceType"
}
dexOptions {
javaMaxHeapSize "4g"
}
signingConfigs {
release {
}
}
flavorDimensions 'channel'
productFlavors {
playstore {
dimension 'channel'
manifestPlaceholders = [channelName: "playstore"]
}
}
configurations {
all {
exclude group: 'org.json', module: 'json'
exclude module: 'httpclient'
exclude module: 'commons-logging'
resolutionStrategy {
force "com.android.support:gridlayout-v7:${support_version}"
force "com.android.support:support-v4:${support_version}"
force "com.android.support:appcompat-v7:${support_version}"
force "com.android.support:cardview-v7:${support_version}"
force "com.android.support:recyclerview-v7:${support_version}"
force "com.android.support:design:${support_version}"
}
}
}
defaultConfig {
applicationId "com.myairtelapp"
minSdkVersion project.ext.min_sdk_version
targetSdkVersion project.ext.target_sdk_version
vectorDrawables.useSupportLibrary = true
versionCode manifestVersionCode
versionName manifestVersionName
buildConfigField BOOLEAN, LOAD_DUMMY_JSON, FALSE
// Config for enbling dummy mode
buildConfigField BOOLEAN, SET_SPOOF_REQUEST, FALSE
// Config for spoofing request
buildConfigField BOOLEAN, REPORT_CRASHES, TRUE
// Flag for reporting crashlytics
multiDexEnabled true
}
buildTypes {
release {
buildConfigField BOOLEAN, LOG_LEVEL_DEBUG, FALSE
signingConfig signingConfigs.release
buildConfigField STRING, S3_URL, BASE_URL_S3_PROD
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFile getDefaultDexGuardFile('dexguard-release.pro')
proguardFile 'dexguard-project.pro'
proguardFile 'proguard-rules.pro'
}
debug {
debuggable true
buildConfigField BOOLEAN, REPORT_CRASHES, FALSE
buildConfigField BOOLEAN, LOG_LEVEL_DEBUG, TRUE
proguardFile getDefaultDexGuardFile('dexguard-debug.pro')
proguardFile 'dexguard-project.pro'
proguardFile 'proguard-rules.pro'
applicationIdSuffix ".debug"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
def gitBranchName() {
return 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
}
/** generate main build tasks
* generated tasks : [airtelOneDebugAssemble, airtelOneReleaseAssemble, airtelOneStagingAssemble
* airtelOneQaAssemble,airtelOneDummyAssemble]
**/
android.buildTypes.all { buildType ->
android.productFlavors.each { flavor ->
task("airtelOne${flavor.name.capitalize()}${buildType.name.capitalize()}Assemble") {
if (buildType.name == android.buildTypes.release.name) {
dependsOn "release"
} else {
dependsOn "assemble${flavor.name.capitalize()}${buildType.name.capitalize()}"
}
}
}
}
/**
* rename the generated apk.
* use SNAPSHOT for intermediate builds
*/
tasks.whenTaskAdded { task ->
if (task.name == 'generateReleaseBuildConfig') {
task.dependsOn 'updateVersionProperties'
}
}
/*
Override release plugin task and update version properties file.
*/
task('updateVersionProperties') << {
def incVersion = manifestVersionCode + 1
props.setProperty(PropertyVersionCode, incVersion.toString())
def appVersion = manifestVersionName.split("\\.")
def majorVersion = appVersion[0]
def minorVersion = appVersion[1]
def patchVersion = appVersion[2]
def updatePatchVersion = patchVersion.toInteger() + 1
def newVersionName = "${majorVersion}.${minorVersion}.${updatePatchVersion}"
props.setProperty(PropertyVersionName, newVersionName)
def writer = new FileWriter(file(PropertiesFile))
try {
props.store(writer, 'Manifest Version Properties')
writer.flush()
} finally {
writer.close()
}
}
def getDate() {
def date = new Date()
def formattedDate = date.format("dd-MM'T'HH-mm")
return formattedDate
}
repositories {
mavenCentral()
maven { url 'http://dl.bintray.com/amulyakhare/maven' }
maven { url 'https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/' }
maven { url 'https://maven.fabric.io/public' }
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
compile(name: 'GoogleConversionTrackingSdk-2.2.4', ext: 'jar')
compile(name: 'leap_sdk', ext: 'aar')
compile(name: 'SecureComponent-PROD-V1.5', ext: 'aar')
implementation project(':qrcodereaderview')
implementation project(':applib')
compile 'com.android.support:multidex:1.0.3'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup:otto:1.3.8'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.squareup.okhttp:okhttp:2.7.5'
//compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.5'
compile 'commons-codec:commons-codec:20041127.091804'
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.0'
compile 'com.birbit:android-priority-jobqueue:1.3'
compile 'com.squareup.wire:wire-runtime:1.6.1'
compile 'com.squareup:tape:1.2.3'
compile('com.crashlytics.sdk.android:crashlytics:2.6.3#aar') {
transitive = true;
}
compile('com.github.ozodrukh:CircularReveal:1.1.1#aar') {
transitive = true;
}
compile('com.moengage:moe-android-sdk:7.7.15') {
exclude group: 'com.moengage', module: 'moe-location-lib'
}
compile ('com.moengage:addon-messaging:1.1.02')
{
exclude group: 'com.android.support'
}
compile 'com.github.bumptech.glide:glide:3.7.0'
compile ('in.juspay:godel:0.6.24.1423')
{
exclude group: 'com.android.support'
}
/* compile ('fr.baloomba:viewpagerindicator:2.4.2')
{
exclude group: 'com.android.support'
}*/
compile 'com.madgag.spongycastle:core:1.54.0.0'
compile 'com.madgag.spongycastle:prov:1.54.0.0'
compile files('libs/secure-component-sdk.jar')
compile 'com.github.PhilJay:MPAndroidChart:v3.0.0'
//Charts lib
compile 'com.github.evgenyneu:js-evaluator-for-android:v2.0.0'
compile "com.android.support:customtabs:${support_version}"
//SafetyNet dependency
compile ("com.google.android.gms:play-services-safetynet:${google_play_services_version}")
{
exclude group: 'com.android.support'
exclude module: 'support-v4'
}
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.appsflyer:af-android-sdk:4.8.8'
compile 'com.android.installreferrer:installreferrer:1.0'
compile ('com.firebase:firebase-jobdispatcher:0.8.5')
{
exclude group: 'com.android.support'
}
}
I checked for duplicate dependencies and remove almost all duplicate dependencies
I didn't find any seemlier question
This is due to the following optimization: method/generalization/class.
I tried to make a release build using the following rule in your dexguard configuration:
-optimizations !method/generalization/class
Its working fine for me
Importing this project from github, I've run into this message:
Gradle 'GameOfLife-master' project refresh failed
Error:Cause: org/gradle/internal/TrueTimeProvider
I've tried solutions posted here, cleaned/rebuilt (at least attempted to) the project, invalidated caches and tried a different version of Gradle. None of that worked. Anyone else got any ideas?
Module: app - build.gradle
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
classpath 'com.jakewharton.hugo:hugo-plugin:1.1.0'
classpath "net.rdrei.android.buildtimetracker:gradle-plugin:0.5.+"
classpath 'io.fabric.tools:gradle:1.+'
classpath 'hu.supercluster:paperwork-plugin:1.2.7'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'io.fabric'
apply plugin: 'hugo'
apply plugin: "build-time-tracker"
apply plugin: 'hu.supercluster.paperwork'
paperwork {
set = [
gitInfo: gitInfo(),
gitSha: gitSha(),
buildTime: buildTime("yyyy-MM-dd HH:mm:ss", "GMT+01:00")
]
}
def versionMajor = 1
def versionMinor = 2
def versionPatch = 0
android {
compileSdkVersion androidCompileSdkVersion
buildToolsVersion androidBuildToolsVersion
defaultConfig {
applicationId 'hu.supercluster.gameoflife'
minSdkVersion androidMinSdkVersion
targetSdkVersion androidTargetSdkVersion
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
}
signingConfigs {
alpha {}
beta {}
release {}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
resValue "string", "app_name_for_buildtype", "Game of Life (debug)"
minifyEnabled false
testCoverageEnabled = false
}
alpha {
applicationIdSuffix ".alpha"
versionNameSuffix "-alpha"
resValue "string", "app_name_for_buildtype", "Game of Life (alpha)"
minifyEnabled false
testCoverageEnabled = false
lintOptions {
disable 'MissingTranslation'
}
}
beta {
applicationIdSuffix ".beta"
versionNameSuffix "-beta"
resValue "string", "app_name_for_buildtype", "Game of Life (beta)"
minifyEnabled false
testCoverageEnabled = false
}
release {
resValue "string", "app_name_for_buildtype", "Game of Life"
minifyEnabled false
proguardFile 'proguard-project.txt'
}
}
sourceSets.main {
// src/gen is the target for generated content like json model
java.srcDirs += 'build/generated/source/db'
}
// avoid errors with message 'Duplicate files copied in APK ...'
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
afterEvaluate {
def propsFile = rootProject.file('keystore.properties')
def configName = 'release'
if (propsFile.exists() && android.signingConfigs.hasProperty(configName)) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
android.signingConfigs[configName].storeFile = rootProject.file(props['storeFile'])
android.signingConfigs[configName].storePassword = props['storePassword']
android.signingConfigs[configName].keyAlias = props['keyAlias']
android.signingConfigs[configName].keyPassword = props['keyPassword']
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:support-annotations:24.2.0'
compile 'com.android.support:support-v13:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
// ---------
compile 'com.github.tslamic.adn:library:1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') { transitive = true }
compile 'com.jakewharton.timber:timber:2.5.1'
compile 'com.squareup:otto:1.3.6'
compile 'hu.supercluster:paperwork:1.2.7'
// ---------
apt "org.androidannotations:androidannotations:" + androidAnnotationsVersion
compile("org.androidannotations:androidannotations-api:" + androidAnnotationsAPIVersion )
testCompile 'junit:junit:4.11'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile('com.squareup:fest-android:1.0.+') { exclude module: 'support-v4' }
testCompile "org.robolectric:robolectric:3.0"
androidTestCompile 'com.google.guava:guava:14.0.1',
'com.squareup.dagger:dagger:1.1.0',
'org.hamcrest:hamcrest-integration:1.1',
'org.hamcrest:hamcrest-core:1.1',
'org.hamcrest:hamcrest-library:1.1',
'com.jakewharton.espresso:espresso:1.1-r3'
}
apt {
arguments {
resourcePackageName android.defaultConfig.applicationId
androidManifestFile variant.outputs[0]?.processResources?.manifestFile
}
}
apply plugin: 'idea'
idea {
module {
//and some extra test source dirs
testSourceDirs += file('src/test')
}
}
apply from: 'build-time-tracker.gradle'
You could run with --stacktrace to get a full exception stack trace
Gradle has the concept of public API and private API. Basically anything in org.gradle.internal is a part of the private API and the gradle team can change / remove these classes between gradle versions. Ideally plugins should never reference internal classes. Any plugin author referencing internal API's must understand that this code may break with a new release of Gradle.
It looks like one of your plugins is referencing the internal API (org.gradle.internal.TrueTimeProvider) and the plugin was built against one version of Gradle and you are running with a different version of gradle.
To fix, you'll need to determine which plugin is throwing the exception (--stacktrace will help here). Then you'll either need to change the plugin version to one compatible with your version of gradle, or change the gradle version you are running with.
I am trying to use Jack-Jill and Java8 for my Android app. Everything is good on my laptop but when I tried to run the project on CircleCI it's getting stuck on
transformClassesWithPreJackPackagedLibrariesForDebug
Here is my build.gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply from: 'test-environment.gradle'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
mavenCentral()
}
allprojects {
repositories {
jcenter()
}
}
android {
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false // true by default
checkAllWarnings false
checkReleaseBuilds false
ignoreWarnings true // false by default
quiet true // false by default
}
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
applicationId "com.projectname.android"
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
versionCode 1
versionName "1.0"
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
ndk{
abiFilters "armeabi-v7a"
}
jackOptions {
enabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
packagingOptions {
exclude 'com/androidquery/util/web_image.html'
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
exclude 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
exclude 'META-INF/LICENSE'
}
configurations {
all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
}
if (System.getenv("CIRCLE")) {
defaultConfig {
versionCode Integer.parseInt(System.getenv("CIRCLE_BUILD_NUM"))
versionName "1.0.30"
}
} else {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
signingConfigs {
debug {
storeFile file("../key.keystore")
storePassword "key"
keyAlias "key"
keyPassword "key"
}
staging {
storeFile file("../key.keystore")
storePassword "key"
keyAlias "key"
keyPassword "key"
}
release {
storeFile file("../key.keystore")
storePassword "key"
keyAlias "key"
keyPassword "key"
}
}
buildTypes {
debug {
ext.betaDistributionNotifications = false
signingConfig signingConfigs.debug
applicationIdSuffix ".dev"
minifyEnabled false
shrinkResources false
debuggable true
proguardFile 'proguard-release.cfg'
testProguardFile 'proguard-release.cfg'
manifestPlaceholders = [providerSuffix: ".dev"]
}
staging {
ext.betaDistributionEmailsFilePath = "staging_distribution_emails.txt"
ext.betaDistributionReleaseNotesFilePath = "release_notes.txt"
signingConfig signingConfigs.staging
applicationIdSuffix ".staging"
shrinkResources false
minifyEnabled true
jniDebuggable false
zipAlignEnabled true
proguardFile 'proguard-release.cfg'
manifestPlaceholders = [providerSuffix: ".staging"]
}
release {
signingConfig signingConfigs.release
shrinkResources false
minifyEnabled true
zipAlignEnabled true
jniDebuggable false
proguardFile 'proguard-release.cfg'
}
}
sourceSets {
main {
jniLibs.srcDirs 'src/main/libs'
jni.srcDirs = []
}
}
// productFlavors {
// all32 { minSdkVersion 15 }
// all64 { minSdkVersion 21 }
// }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':libraries:Instagram')
compile project(':libraries:librestreaming')
compile 'com.android.support:appcompat-v7:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:cardview-v7:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:design:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:support-v13:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:support-v4:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:percent:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.google.android.gms:play-services-location:' + project.GMS_VERSION
compile 'com.google.android.gms:play-services-gcm:' + project.GMS_VERSION
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android:flexbox:0.2.3'
compile group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.1.0'
compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.4.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.facebook.device.yearclass:yearclass:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'hanks.xyz:smallbang-library:0.1.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.3#aar') {
transitive = true;
}
compile "com.mixpanel.android:mixpanel-android:4.+"
compile('com.yalantis:ucrop:2.2.0') {
exclude group: 'com.android.support', module: 'appcompat'
}
compile 'com.roughike:bottom-bar:2.0.2'
compile 'com.github.kenglxn.QRGen:android:2.2.0'
compile group: 'com.pubnub', name: 'pubnub', version: '4.0.11'
compile ('io.branch.sdk.android:library:2.+') {
exclude module: 'answers-shim'
}
// dagger2
compile 'com.google.dagger:dagger:2.4'
annotationProcessor 'com.google.dagger:dagger-compiler:2.4'
provided 'javax.annotation:jsr250-api:1.0'
// butterknife
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile('com.twitter.sdk.android:twitter:2.0.0#aar') {
transitive = true;
}
}
I use tool build gradle version 2.3.0-alpha1
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
here is some of what it shows in the log console:
:app:fabricGenerateResourcesDebug:app:fabricGenerateResourcesDebug
> Building 75%:app:generateDebugResources
> Building 75% > :app:mergeDebugResources:app:mergeDebugResources
> Building 75%> Building 76% > :app:processDebugResources:app:processDebugResources
> Building 76%:app:generateDebugSources
> Building 76% > :app:transformClassesWithPreJackPackagedLibrariesForDebug:app:transformClassesWithPreJackPackagedLibrariesForDebug
> Building 76%:app:processDebugJavaRes UP-TO-DATE
> Building 77% > :app:transformResourcesWithMergeJavaResForDebug:app:transformResourcesWithMergeJavaResForDebug
> Building 77% > :app:transformJackWithJackForDebug
Seems that it's stuck like forever when it tried to do something with transformJackWithJackForDebug on 77% of building process and then it reached the build time limit (I set it as 60 mins )
Has anyone faced this problem before? Please suggest.
I know that official support for SVG didn't start until api level 23, but how do I use it in an app with the min sdk at 17?
I have had it working before, and I don't know what changed. I am using AndroidSVG library.
I get this error when I try to build a production APK
Error:(163) Error: Expected resource of type drawable [ResourceType]
Here is one of the 150 lines of code that I get this error in
socialTypeImage.setImageResource(R.raw.icon_other_blue);
I don't know what other info to provide, so if you need more, please let me know.
Thanks
I don't know if my problem is a duplicate, but if it is, none of those solutions work.
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
maven { url 'http://repository.codehaus.org' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-alpha1'
//classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.14.7'
classpath 'com.google.code.ksoap2-android:ksoap2-android:3.1.1'
classpath 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.2'
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
maven { url "http://repository.codehaus.org" }
maven { url 'https://maven.fabric.io/public' }
}
import groovyx.net.http.HTTPBuilder
def getBuildNumber(projectName) {
def http = new HTTPBuilder('http://eco-crossbar-620.appspot.com')
try {
def resp = http.get(path: "/${projectName}")
println "NEW BUILD NUMBER: ${resp.BODY}"
resp.BODY
} catch (ignored) {
println "ERROR RETRIEVING BUILD NUMBER"
0
}
}
def getWorkingBranch() {
def workingBranch = "build"
try {
workingBranch = """git --git-dir=${rootDir}/.git
--work-tree=${rootDir}/
rev-parse --abbrev-ref HEAD""".execute().text.trim()
} catch (ignored) {
// git unavailable or incorrectly configured
}
println "Working branch: " + workingBranch
return workingBranch.replaceAll("/", "-")
}
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 23
buildToolsVersion '23.0.2'
def build = getBuildNumber("lookcounter-android")
defaultConfig {
applicationId "com.lookcounter"
minSdkVersion 17
targetSdkVersion 23
versionCode 67
versionName "0.1.$versionCode"
vectorDrawables.useSupportLibrary = true
buildConfigField "String", "DEFAULT_USERNAME", "\"\""
buildConfigField "String", "DEFAULT_PASSWORD", "\"\""
resValue "string", "base64_encoded_public_key", "key"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "DEFAULT_USERNAME", "\"\""
buildConfigField "String", "DEFAULT_PASSWORD", "\"\""
debuggable false
jniDebuggable false
renderscriptDebuggable false
pseudoLocalesEnabled false
}
debug {
minifyEnabled false
debuggable true
jniDebuggable true
renderscriptDebuggable true
pseudoLocalesEnabled true
zipAlignEnabled false
}
}
signingConfigs {
dev {
storeFile file("../LookCounter.keystore")
storePassword "izpa55word"
keyAlias "lookcounterkey"
}
prod {
storeFile file("../LookCounter.keystore")
keyAlias "lookcounterprodkey"
}
}
productFlavors {
production {
buildConfigField "boolean", "DEV_BUILD", "false"
resValue "string", "app_name", "Lookcounter"
signingConfig signingConfigs.prod
versionCode 2
minSdkVersion 17
targetSdkVersion 23
}
dev {
buildConfigField "boolean", "DEV_BUILD", "true"
resValue "string", "app_name", "(DEV) Lookcounter"
signingConfig signingConfigs.dev
applicationId 'com.lookcounter'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
android.applicationVariants.all { variant ->
if (variant.buildType.name.equals("release")) {
variant.assemble.doLast {
def apkName
def dirName = System.getProperty("user.home") + "/Desktop/lookcounter/apk"
if (variant.name.contains("production")) {
dirName += "PlayStore"
apkName = "Lookcounter_v${versionCode}_PlayStore_${versionName}.apk"
} else {
dirName += "dev"
def branchName = getWorkingBranch()
if (branchName.equals("develop")) {
apkName = "Lookcounter_v${versionCode}_DEV_${build}.apk"
} else {
apkName = "Lookcounter_v${versionCode}_DEV_${branchName}_${build}.apk"
}
}
copy {
def source = variant.outputs.get(0).getOutputFile()
from source
into dirName
include source.name
rename source.name, apkName
println "Output APK copied to $dirName/$apkName"
}
}
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// compile "com.dev.sacot41:scviewpager:0.0.4"
compile project(':androidSVG')
compile files('../libraries/PriorityDeque-1.0.jar')
compile project(':cropper')
testCompile 'junit:junit:4.12'
// Possibly Keep
compile('com.doomonafireball.betterpickers:library:1.6.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
// KEEP
compile('com.nostra13.universalimageloader:universal-image-loader:1.9.5') {
exclude group: 'com.android.support', module: 'support-v7'
}
compile('com.twitter.sdk.android:tweet-composer:0.7.3#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:answers:1.3.6#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.jakewharton:butterknife:5.1.2'
compile 'org.apache.commons:commons-lang3:3.1'
compile 'com.github.clans:fab:1.6.2'
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-vector-drawable:23.2.0'
compile 'com.android.support:animated-vector-drawable:23.2.0'
}
You can't use SVGs directly as a Resource. The Android resource loading system doesn't know what an SVG is. What you need to use is something like:
SVG svg = SVG.getFromResource(R.raw.icon_other_blue);
socialTypeImage.setImageDrawable(new PictureDrawable(svg.toPictureDrawable()));
Or you can use the SVGImageView widget class that is provided. Documentation here.