Runtime errors with library package - Android Studio Canary 6 & Canary 7 - android

I'm unable to run the project in Canary 6 and Canary 7.
Gradle build succeeded.
At compile time it didn't show any errors.
At runtime its showing errors with all library classes(gradle dependency, jar dependency).
Some of them are,
error: package retrofit2 does not exist
error: package android.support.v7.app does not exist
error: package com.google.gson does not exist.
Error: Note: #BindView field with unresolved type (PercentRelativeLayout) must elsewhere be generated as a View or interface.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
top build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha7'
classpath 'com.google.gms:google-services:3.0.0'
// 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://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
core build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
implementation 'com.android.support:percent:26.0.0-beta2'
implementation "com.android.support:support-core-utils:26.0.0-beta2"
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.picasso:picasso:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'com.intuit.sdp:sdp-android:1.0.3'
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
implementation 'com.google.code.gson:gson:2.2.4'
implementation 'com.android.support:design:26.0.0-beta2'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}
app build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.msf.phillip"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "uat"
productFlavors {
fullUAT {
dimension "uat"
versionName "1.37.2.0"
resValue 'string', 'APP_NAME', '"Poems SG 2.0"'
buildConfigField "String", "VERSION", "\"1.2.2.0\""
buildConfigField "String", "connection_env", "\"uat\""
buildConfigField "String", "connection_url", "*******"
buildConfigField "String", "API_KEY", "************"
buildConfigField "boolean", "mandatoryUpdate", "false"
buildConfigField "String", "FLURRY_API_KEY", "*************"
}
fullRelease {
dimension "uat"
versionName "1.0.4.0"
resValue 'string', 'APP_NAME', '"Poems"'
buildConfigField "boolean", "isUAT", "false"
buildConfigField "boolean", "isInternal", "false"
buildConfigField "String", "VERSION", "\"1.0.0\""
buildConfigField "String", "connection_env", "\"prod\""
buildConfigField "String", "connection_url", "*************"
buildConfigField "String", "API_KEY", "**************"
buildConfigField "boolean", "mandatoryUpdate", "false"
buildConfigField "String", "FLURRY_API_KEY", "************"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation project(path: ':core')
implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
implementation 'com.google.android.gms:play-services-gcm:11.0.2'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.flurry.android:analytics:7.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
implementation 'com.jakewharton:butterknife:8.6.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
}
apply plugin: 'com.google.gms.google-services'

Related

What could influence the visibility of my app on the store?

I've recently updated gradle to 3.4.0 and when uploading the build to the store I received a warning message letting me know that users will not be able to see the new build.
The only difference between the old apk and the new one is that the new one only has these native platforms
Native platforms
arm64-v8a, armeabi-v7a, x86, x86_64
while the old one also has the mips abi.
I went to the store after a couple of hours after uploading he build and I can't see the new build.
Any ideas ?! Why does that influence the apk from being able to be seen from the store, if they're deprecated... ?!
Or could the problem come from another place?
EDIT
Could the problem arise from this instead by any chance?
// Butterknife requires Java 8.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
EDIT 2
Here's my entire app level build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.29.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
lintOptions { checkReleaseBuilds false }
compileSdkVersion 28
buildToolsVersion '28.0.3'
signingConfigs {
releaseSign {
storeFile file("$rootProject.projectDir/keystore_release.jks")
storePassword 'xxxxx'
keyAlias 'xxxx'
keyPassword 'xxxx'
}
}
// Butterknife requires Java 8.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.xxxx.driver"
minSdkVersion 19
targetSdkVersion 28
versionCode 27
versionName "1.0.27"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
multiDexEnabled true
splits {
abi {
reset()
include "x86", "armeabi-v7a", "armeabi-v8a", "x86_64", "mips", "mips64"
universalApk true
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseSign
}
}
flavorDimensions "default"
productFlavors {
beta {
applicationId "com.xxxx.driver.beta"
dimension "default"
resValue "string", "app_name", "Driver Beta"
resValue "string", "privacy_policy_url", "https://www.xxxxxx"
buildConfigField "String", "BASE_URL", '"https://xxxxxxx"'
buildConfigField "Boolean", "IS_BETA", "true"
buildConfigField "String", "TENANT", '"xxxxx"'
}
production {
applicationId "com.xxxxx.driver"
dimension "default"
resValue "string", "app_name", "Driver"
resValue "string", "privacy_policy_url", "https://www.xxxxx"
buildConfigField "String", "BASE_URL", '"https://xxxxx"'
buildConfigField "Boolean", "IS_BETA", "false"
buildConfigField "String", "TENANT", '"xxxx"'
}
}
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/notice'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
}
}
configurations.all {
// resolutionStrategy {
// eachDependency { DependencyResolveDetails details ->
// if (details.requested.group == 'com.android.support' && details.requested.name != 'multidex') {
// details.useVersion "28.0.0"
// }
// }
// }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'me.grantland:autofittextview:0.2.1'
implementation 'com.android.volley:volley:1.1.1'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.ybq:Android-SpinKit:1.2.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
def work_version = "2.0.1"
implementation "androidx.work:work-runtime:$work_version"
// Optional - RxJava2 support
implementation "androidx.work:work-rxjava2:$work_version"
def futures_version = "1.0.0-beta01"
implementation "androidx.concurrent:concurrent-futures:$futures_version"
implementation 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'
}
apply plugin: 'com.google.gms.google-services'
And my top level build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
So I figured it out myself. The solution was that, their system is buggy. There is nothing wrong with my app. I sent them an email and they answered after a week+. After that, everything is working fine. A number of days after posting this question, a colleague also had this issue with another app, so if you do happen to come across this issue send them an email and ask.

Failed to resolve: com.afollestad:bridge:5.1.2

I have Android Studio 3.2.1 and i having an issue syncing my project.
Error:
Failed to resolve: com.afollestad:bridge:5.1.2
Show in File
Show in Project Structure dialog
UPDATED:
the error also persists with android studio 3.4
And my gradles files are:
App:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
lintOptions {
checkReleaseBuilds false
// abortOnError false
}
signingConfigs {
Signing_Release {
keyAlias project.keyAlias
keyPassword project.keyPassword
storeFile file(project.storeFile)
storePassword project.storePassword
}
}
compileSdkVersion 28
defaultConfig {
applicationId "XXXXXXXXXXXXXXXXXXXXXXXX"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "3.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
productFlavors {
app1 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 16
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
app2 {
applicationId 'com.assertsoft.assertforms.centenarioseguridad'
buildConfigField "String", "URL_BASE", "\"https://centenarioseguridad.onfieldsystem.cl/rest/\""
versionCode 1
flavorDimensions "default"
}
app3 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 16
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
app4 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 1
minSdkVersion 1
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
app5 {
applicationId 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
buildConfigField "String", "URL_BASE", "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
versionCode 1
minSdkVersion 1
flavorDimensions "default"
signingConfig signingConfigs.Signing_Release
}
}
buildTypes {
debug {
buildConfigField "Boolean", "ANALYTICS_ENABLE", "false"
}
release {
buildConfigField "Boolean", "ANALYTICS_ENABLE", "true"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
ext {
playServicesVersion = '11.8.0'
retrofitVersion = '2.1.0'
mlVisionVersion = '18.0.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9#aar') {
transitive = true;
}
implementation project(':camara')
implementation 'androidx.multidex:multidex:2.0.1'
implementation('com.afollestad:bridge:5.1.2') {
exclude group: 'org.json', module: 'json'
}
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.jakewharton:butterknife:10.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.instacart.truetime-android:library:3.3'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-messaging:17.5.0'
implementation 'com.karumi:dexter:5.0.0'
implementation 'com.evernote:android-job:1.2.5'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.mcxiaoke.viewpagerindicator:library:2.4.1#aar'
implementation 'com.github.HotBitmapGG:RingProgressBar:V1.2.2'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.uncopt:android.justified:1.0'
implementation 'com.valdesekamdem.library:md-toast:0.9.0'
implementation 'io.realm:android-adapters:2.1.0'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'me.relex:circleindicator:1.2.2#aar'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.grappes:Infinix-Indicator:1.0.2'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.savvi.datepicker:rangepicker:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.uphyca:stetho_realm:2.3.0'
implementation 'com.github.takusemba:spotlight:1.6.1'
// implementation "com.google.firebase:firebase-ml-vision:$mlVisionVersion"
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.robertlevonyan.view:MaterialChipView:1.2.5'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.2'
// TESTING
testImplementation 'junit:junit:4.12'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
Project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//jcenter()
google()
jcenter({url "http://jcenter.bintray.com/"})
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "io.realm:realm-gradle-plugin:5.2.0"
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
//jcenter()
jcenter({url "http://jcenter.bintray.com/"})
mavenCentral()
maven { url 'https://github.com/WickeDev/stetho-realm/raw/master/maven-repo' }
maven { url "https://jitpack.io" }
maven { url "https://dl.bintray.com/dgunjit14/Infinix-Indicator" }
google()
}
// Workaround for https://issuetracker.google.com/117900475
// Remove when upgrading to AGP 3.4 or higher.
configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
config.resolutionStrategy.eachDependency { details ->
details.useVersion("3.5.0-alpha03-5252756")
}
}
}
project.ext {
keyAlias = 'xxxxxxxx'
keyPassword = 'xxxxxxxx'
storeFile = 'xxxxxx.jks'
storePassword = 'xxxxxxxxxxx'
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This library is no longer available. You can download JAR here: https://mvnrepository.com/artifact/com.afollestad/bridge/5.1.2
You should migrate to another solution as soon as possible.

Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:

I am not able to build release APK. Every time I get DexMergerException.
Here are my build.gradles:
I am using MVVM structure. I have core(package name for core is same as my app package) has my lib where I only write view models, models and network layers.
Errors I am getting:
Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
Caused by: com.android.tools.r8.utils.AbortException
Program type already present:
app build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
signingConfigs {
debug {
storeFile file(DEBUG_STORE_FILE)
}
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
v2SigningEnabled false
}
}
compileSdkVersion 27
flavorDimensions "default"
defaultConfig {
applicationId "com.puma.one8crew"
minSdkVersion 21
targetSdkVersion 27
vectorDrawables.useSupportLibrary = true
versionCode 1
multiDexEnabled true
versionName "1.0"
resValue 'string', 'facebook_app_id', FACEBOOK_APP_ID_DEV
resValue 'string', 'fb_login_protocol_scheme', FACEBOOK_LOGIN_PROTOCOL_SCHEME
manifestPlaceholders += [
FACEBOOK_APP_ID_BGY: FACEBOOK_APP_ID_DEV,
FB_LOGIN_SCHEME : FACEBOOK_LOGIN_PROTOCOL_SCHEME
]
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
/* productFlavors {
prod {
resValue 'string', 'facebook_app_id', FACEBOOK_APP_ID_DEV
resValue 'string', 'fb_login_protocol_scheme', FACEBOOK_LOGIN_PROTOCOL_SCHEME
}
stage {
resValue 'string', 'facebook_app_id', FACEBOOK_APP_ID_DEV
resValue 'string', 'fb_login_protocol_scheme', FACEBOOK_LOGIN_PROTOCOL_SCHEME
}
}*/
applicationVariants.all { variant ->
variant.outputs.all { output ->
def project = "one8crew"
outputFileName = "${project}_${variant.buildType.name}_${variant.versionName}.apk"
}
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = true //delete the already predexed libraries
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':core')
implementation 'com.android.support:animated-vector-drawable:27.0.1'
implementation 'com.android.support:customtabs:27.0.1'
implementation 'com.android.support:cardview-v7:27.0.1'
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
implementation 'com.android.support:recyclerview-v7:27.0.1'
implementation 'com.google.firebase:firebase-messaging:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:design:27.0.1'
implementation 'com.android.support:support-v13:27.0.1'
implementation 'com.alimuzaffar.lib:pinentryedittext:1.3.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
//Dependencies for LifeCycle Android ViewModel
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation project(':com.wowza.gocoder.sdk')
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
//support design lib dependency fot tab
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true;
}
}
Below is my core build.gradle and I have also updated the same version for all lib.
core build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
repositories {
flatDir {
dirs 'libs'
}
jcenter()
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
compileOnly 'com.wowza.gocoder.sdk.android:com.wowza.gocoder.sdk:1.0b7#aar'
// compile 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.google.dagger:dagger:2.11'
api('com.squareup.retrofit2:retrofit:2.1.0') {
exclude module: 'okhttp'
}
api 'com.google.code.gson:gson:2.8.1'
api 'com.squareup.retrofit2:converter-gson:2.3.0'
api 'swarajsaaj:otpreader:1.1'
api 'com.github.bumptech.glide:glide:4.3.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
//Dependencies for LifeCycle Android ViewModel
implementation 'android.arch.lifecycle:extensions:1.1.1'
// annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
compileOnly project(':com.wowza.gocoder.sdk')
compile project(':libraries:horizontalcalendar')
compile project(':libraries:calendarview')
//Library for setting fonts
api 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.android.support:multidex:1.0.3'
}
I tried so many time and I am not able to understand the reason behind this issue.
Same happened today to me and this is what solved the issue:
Find all the dependencies of com.google.android.gms:play-services.
They all have now different versions. Just place the mouse over them and correct the version numbers (i.e. for me was upgrading maps from 15.0.0 to 15.0.2 and tag-manager to 15.0.1)

android gradle build - run task before assembleRelease or assembleLive

Below is my build.gradle file for app.
build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
}
android {
signingConfigs {
liveSigning {
keyAlias 'xxxxxxx'
keyPassword 'xxxxxx'
storeFile file('D:\\xxxxx\\xxxxxxx\\xxxxx\\xxxx.jks')
storePassword 'xxxxxxx'
}
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
useLibrary 'org.apache.http.legacy'
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [];
}
defaultConfig {
applicationId rootProject.ext.applicationId
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
multiDexEnabled true
resConfigs "en"
vectorDrawables.useSupportLibrary true
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.liveSigning
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
task ndkBuild(type: Exec) {
commandLine rootProject.ext.ndkPath, '-C', file('src/main').absolutePath
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
lintOptions {
abortOnError false
}
productFlavors {
live {
minSdkVersion rootProject.ext.minSdkVersion
applicationId rootProject.ext.applicationId
signingConfig signingConfigs.liveSigning
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
resConfigs "en"
}
}
flavorDimensions "default"
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile files('libs/gson-2.2.4.jar')
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile files('libs/cordova-5.jar')
compile files('libs/org.apache.commons.io.jar')
compile files('libs/httpmime-4.2.3.jar')
compile files('libs/jsoup-1.7.3.jar')
compile files('libs/activation.jar')
compile project(':libraries:EventBus')
compile project(':libraries:PDFViewCtrlTools')
compile project(':libraries:imageannotations')
compile project(':libraries:bottom-bar')
compile project(':libraries:tooltip')
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
compile files('libs/glide-3.6.1.jar')
//compile 'com.roughike:bottom-bar:2.2.0'
compile project(':libraries:k4l-video-trimmer')
compile 'com.android.support:multidex:1.0.1'
compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.0.1'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'me.relex:circleindicator:1.2.2'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'org.apache.commons:commons-collections4:4.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'
Before I generate signed APK to upload for google play store , I want to execute command line code. And by using that command line program i want to do some pre release activity like disable logs of NDK, change url to live website and etc. So how can I execute it before assembleLive or assembleRelease ? I don't want to execute that command line code before "assembleDebug". I want to execute it only before "assembleLive or assembleRelease".
I added below code to my gradle file and it works like a charm.
task prelivetask (type: Exec) {
commandLine 'cmd','/C', 'start', 'change.cmd'
}
tasks.whenTaskAdded { task ->
if (task.name == 'assembleRelease' || task.name == 'assembleLive') {
task.dependsOn prelivetask
}
}

android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead

As per this answer and this answer I already make changes in app gradle but still it is showing me following error while building my application.
Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
What am I missing here?
Here is my App Gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
//project.ext.versionInfo.releaseVersionName = SYNCED_VERSION_NAME
android {
compileSdkVersion 23
flavorDimensions "default"
defaultConfig {
applicationId "in.something"
minSdkVersion 15
targetSdkVersion 23
versionCode 13
versionName "1.10"
multiDexEnabled true
}
productFlavors {
LIVE_BETA {
applicationIdSuffix ".beta"
resValue "string", "app_display_name", "Something(B)"
resValue "string", "SERVER_URL", "http://something/beta"
}
LIVE {
resValue "string", "app_display_name", "something"
resValue "string", "SERVER_URL", "http://something/live"
}
DEV {
applicationIdSuffix ".dev"
resValue "string", "app_display_name", "something(D)"
resValue "string", "SERVER_URL", "http://localhost/"
}
}
buildTypes {
debug {
// applicationIdSuffix "
// .debug"
// versionNameSuffix "-debug"
}
release {
//minifyEnabled true
//shrinkResources true
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
// Rename APK files
// applicationVariants.all { variant ->
// def output = variant.outputs.get(0)
// File apk = output.outputFile
// String newName = output.outputFile.name.replace(".apk", "-${variant.mergedFlavor.versionCode}-${variant.mergedFlavor.versionName}-.apk")
// .replace("app-", "${variant.mergedFlavor.applicationId}-")
// output.outputFile = new File(apk.parentFile, newName)
// }
}
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
//================== Local ========================/
implementation fileTree(include: ['*.jar'], dir: 'libs')
//compile files('libs/ksoap2-android-assembly-3.1.1-jar-with-dependencies.jar')
/** *************************************************/
//================== Default ========================/
implementation 'com.android.support:appcompat-v7:23.1.0'
implementation 'com.android.support:recyclerview-v7:23.1.0'
implementation 'com.android.support:design:23.1.0'
implementation 'com.android.support:cardview-v7:23.1.0'
/** *************************************************/
implementation 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.6.3'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.6.3'
//implementation files('libs/bouncycastle-java5-136-1.0.0.jar')
implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1'
/************ Location *****************/
implementation 'com.google.android.gms:play-services-location:8.3.0'
/** *************************************************/
/************ Common *****************/
implementation 'commons-io:commons-io:2.4'
implementation 'commons-codec:commons-codec:1.4'
/** ********************************/
implementation('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
implementation files('libs/bouncycastle-java5-136-1.0.0.jar')
}
I am using Android Studio 3.0 and gradle version is 3.0
And add below your
classpath 'io.fabric.tools:gradle:1.+'
definition
classpath "io.realm:realm-gradle-plugin:4.1.1"
For me it looks like it was upgrading Realm from
classpath "io.realm:realm-gradle-plugin:1.0.0"
to
classpath "io.realm:realm-gradle-plugin:4.1.1"

Categories

Resources