I am getting this error while running the app.
Here are the Gradle files for my project.
build.gradle
buildscript {
ext.kotlin_version = '1.3.20'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
signingConfigs {
'release' {
storeFile file('/Users/jeetraval/Documents/Workspace/my-audio-app-android/test.jks')
keyAlias 'key0'
storePassword 'Test#123'
keyPassword 'Test#123'
}
}
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.jeet.myaudio"
minSdkVersion 25
targetSdkVersion 31
versionCode 5
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
signingConfig signingConfigs.release
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
/*applicationVariants.all { variant ->
renameAPK(variant)
}*/
}
}
dataBinding {
enabled = true
}
dexOptions {
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "default"
productFlavors {
prod {
versionName "1.0.3"
resValue "string", "app_name", "MyAudio"
}
}
}
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.4.1'
//noinspection GradleCompatible
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.16'
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
//noinspection GradleCompatible
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'cn.carbs.android:AvatarImageView:1.0.4'
// testImplementation 'junit:junit:4.12'
//noinspection GradleCompatible
// androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-ads:20.6.0'
// Room
implementation 'androidx.room:room-runtime:2.2.2'
kapt 'androidx.room:room-compiler:2.2.2'
kapt "com.android.databinding:compiler:3.1.4"
// Test helpers for Room
testImplementation 'androidx.room:room-testing:2.2.2'
implementation 'com.kovacorp.vocalizesdk:VocalizeSDK:0.0.7'
implementation "com.google.assistant.appactions:suggestions:1.0.0"
}
The distribution URL which I used in gradle-wrapper.properties is as follows:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
I have checked all the res files. But there is no error in any files. Please suggest any approach to solve this. Thanks in advance.
Related
I'm using the android studios IDE, SDK version 32, build tools 33, and java version 1.8
I keep getting the error
Cannot resolve symbol 'File'
And actually the gradle syncs somehow and the file is created, but I need to solve the error
This is the settings gradle:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url "https://dl.cloudsmith.io/public/cometchat/cometchat-pro-android/maven/"
}
}
}
rootProject.name = "ViegerT2"
include ':app'
include ':uikit'
project(':uikit').projectDir = new File(rootDir, 'android-java-chat-ui-
kit/uikit/')
This is the project gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is the APP gradle:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.viegert2"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
manifestPlaceholders = [file_provider: "ViagerT2"]
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
exclude 'META-INF/androidx.cardview_cardview.version'
}
buildToolsVersion '33.0.0'
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.annotation:annotation:1.4.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
//noinspection GradleCompatible
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
apply plugin: 'kotlin-android-extensions'
//implementation 'androidx.core:core-ktx:1.3.2'
//implementation 'androidx.appcompat:appcompat:1.3.1'
//implementation 'com.google.android.material:material:1.4.0'
//implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation platform('com.google.firebase:firebase-bom:29.0.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-database-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'
implementation 'com.cometchat:pro-android-chat-sdk:3.0.0'
implementation 'com.cometchat:pro-android-calls-sdk:2.1.0'
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation 'com.github.bumptech.glide:glide:4.12.0'
//implementation project(path: ':uikit-kotlin')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation project(path: ':uikit')
}
And I also have this module gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "3.0.9-1"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
renderscriptSupportModeEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', '.apt_generated']
aidl.srcDirs = ['src/main/aidl', '.apt_generated']
res.srcDirs = [
'src/main/res',
'src/main/res-components',
'src/main/res-components/calls',
'src/main/res-components/chats',
'src/main/res-components/cometchatui',
'src/main/res-components/groups',
'src/main/res-components/messagebubbles',
'src/main/res-components/messages',
'src/main/res-components/others',
'src/main/res-components/shared',
'src/main/res-components/userprofile',
'src/main/res-components/users'
]
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion = '28.0.3'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.emoji:emoji:1.1.0-rc01'
implementation 'androidx.emoji:emoji-bundled:1.1.0'
implementation 'androidx.emoji:emoji-appcompat:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.google.android.material:material:1.2.0-alpha04'
implementation 'com.facebook.shimmer:shimmer:0.4.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
//cometchat
compileOnly 'com.cometchat:pro-android-chat-sdk:3.0.9'
compileOnly 'com.cometchat:pro-android-calls-sdk:2.2.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0'
}
We are making our next project in the company with kotlin multiplatform. Everything worked fine until I tried to create a release version for android to beta test. I got this error in release versions while everything works fine in debug.
[NetworkManager] unknown exception: l.a.w: Can't locate argument-less serializer for class a. For generic classes, such as lists, please provide serializer explicitly.
here this is project level build.gradle
buildscript {
ext.kotlin_version = '1.3.70'
ext.versions = [
"ktor" : "1.3.2",
"serialization" : "0.20.0",
"coroutines" : "1.3.6",
]
repositories {
maven { url 'https://maven.google.com' }
maven { url 'https://dl.google.com/dl/android/maven2' }
maven { url "https://s3-eu-west-1.amazonaws.com/elasticode-sdk/Android/maven/" }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.70' // or any other kotlin plugin
id 'org.jetbrains.kotlin.plugin.serialization' version '1.3.70'
}
allprojects {
repositories {
maven { url 'https://maven.google.com' }
maven { url "https://s3-eu-west-1.amazonaws.com/elasticode-sdk/Android/maven/" }
google()
jcenter()
}
}
and this is common modules build.gradle
apply plugin: 'kotlin-multiplatform'
apply plugin: 'kotlinx-serialization'
kotlin {
targets {
iosArm64("ios64")
iosX64("iosSim")
configure([
ios64,
iosSim
]) {
binaries.framework {
baseName = 'PassengerCommon'
}
}
fromPreset(presets.jvm, 'android')
}
sourceSets {
commonMain.dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:${versions.serialization}"
implementation "io.ktor:ktor-client:${versions.ktor}"
implementation "io.ktor:ktor-client-json:${versions.ktor}"
implementation "io.ktor:ktor-client-serialization:${versions.ktor}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:${versions.coroutines}"
}
iosMain {
dependsOn commonMain
iosSimMain.dependsOn(it)
ios64Main.dependsOn(it)
dependencies {
// HTTP
implementation "io.ktor:ktor-client-ios:${versions.ktor}"
implementation "io.ktor:ktor-client-json-native:${versions.ktor}"
implementation "io.ktor:ktor-client-serialization-native:${versions.ktor}"
// Coroutines
api "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:${versions.coroutines}"
}
}
iosSimMain {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-iosx64:${versions.serialization}"
}
}
ios64Main {
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-iosarm64:${versions.serialization}"
}
}
androidMain.dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:${versions.serialization}"
implementation "io.ktor:ktor-client-serialization-jvm:${versions.ktor}"
implementation "io.ktor:ktor-client-okhttp:${versions.ktor}"
implementation "com.squareup.okhttp3:logging-interceptor:4.0.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}"
}
}
// Create a task building a fat framework.
task debugFatFramework(type: FatFrameworkTask) {
// The fat framework must have the same base name as the initial frameworks.
baseName = 'PassengerCommon'
// The default destination directory is '<build directory>/fat-framework'.
destinationDir = file("$buildDir/fat-framework/debug")
// Specify the frameworks to be merged.
from(
targets.ios64.binaries.getFramework("DEBUG"),
targets.iosSim.binaries.getFramework("DEBUG")
)
}
// Create a task building a fat framework.
task releaseFatFramework(type: FatFrameworkTask) {
// The fat framework must have the same base name as the initial frameworks.
baseName = 'PassengerCommon'
// The default destination directory is '<build directory>/fat-framework'.
destinationDir = file("$buildDir/fat-framework/release")
// Specify the frameworks to be merged.
from(
targets.ios64.binaries.getFramework("RELEASE"),
targets.iosSim.binaries.getFramework("RELEASE")
)
}
}
configurations {
compileClasspath
}
lastly this is the android modules build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
repositories {
flatDir {
dirs 'libs'
}
google()
mavenCentral()
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 28
defaultConfig {
applicationId "com.lines.passenger"
minSdkVersion 21
targetSdkVersion 28
versionCode 53
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
signingConfigs {
release {
try {
storeFile file('../keystores/release.jks')
storePassword *****
keyAlias "*****"
keyPassword *****
} catch (Exception ex) {
throw new Exception("You should define KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.")
}
}
debug {
storeFile file('../keystores/debug.keystore')
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
buildTypes {
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
resValue("string", "app_name", "Passenger")
signingConfig signingConfigs.debug
resValue("string", "g_maps_api_key", "*****")
manifestPlaceholders = [MAPS_API_KEY: "*****"]
resValue "string", "app_version", "${defaultConfig.versionName}"
resValue("string", "PUSHER_APP_KEY", "*****")
resValue("string", "new_relic_key", "*****")
}
release {
resValue "string", "app_version", "${defaultConfig.versionName}"
minifyEnabled true
shrinkResources true
zipAlignEnabled true
resValue("string", "app_name", "Lines")
signingConfig signingConfigs.release
resValue("string", "g_maps_api_key", "*****")
manifestPlaceholders = [MAPS_API_KEY: "*****"]
resValue("string", "PUSHER_APP_KEY", "*****")
resValue("string", "new_relic_key", "*****")
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/*.kotlin_module'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
testImplementation "io.mockk:mockk:1.9"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
implementation project(':PassengerCommon')
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation 'com.google.firebase:firebase-core:17.4.3'
implementation 'com.google.firebase:firebase-config:19.1.4'
implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
implementation 'com.google.firebase:firebase-storage:19.1.1'
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.maps.android:android-maps-utils:0.4.4'
implementation 'com.afollestad.material-dialogs:core:0.9.5.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.jakewharton:butterknife:10.0.0'
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.5.0")
implementation 'com.karumi:dexter:4.2.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.prolificinteractive:material-calendarview:1.4.3'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation 'q.rorbin:badgeview:1.1.3'
implementation 'com.jakewharton.rxbinding3:rxbinding:3.0.0-alpha2'
implementation 'info.hoang8f:android-segmented:1.0.6'
implementation 'com.elasticode.sdk:elasticode-android:2.1.1'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation 'com.pusher:pusher-websocket-android:0.7.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}"
}
apply plugin: 'com.google.gms.google-services'
If you guys need anything I will gladly provide
If the app works in debug but not in release, it's probably because Proguard minified your classes and deserialization no longer works due to different (shorter) class and property names.
Make sure you have this in your proguard:
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.SerializationKt
-keep,includedescriptorclasses class com.yourcompany.yourpackage.**$$serializer { *; } # <-- change package name to your app's
-keepclassmembers class com.yourcompany.yourpackage.** { # <-- change package name to your app's
*** Companion;
}
-keepclasseswithmembers class com.yourcompany.yourpackage.** { # <-- change package name to your app's
kotlinx.serialization.KSerializer serializer(...);
}
If deserialization still fails, please provide an example of how you are deserializing network response(s) into data classes.
when i update as to 3.6, there is an exception when i ./gradlew assembleRelease. and the infomation is like this
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:minifyReleaseWithR8'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:156)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
...
Caused by: java.lang.NullPointerException
at com.android.tools.r8.naming.A.a(:7)
at com.android.tools.r8.naming.A.c(:1)
at com.android.tools.r8.naming.w.a(:71)
at com.android.tools.r8.naming.w.a(:54)
at com.android.tools.r8.naming.w.a(:61)
at com.android.tools.r8.naming.w.a(:61)
at com.android.tools.r8.naming.w.a(:29)
at com.android.tools.r8.naming.G.a(:25)
...
my project gradle is
buildscript {
ext.kotlin_version = '1.3.61'
apply from:'config.gradle'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.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
classpath 'com.meituan.android.walle:plugin:1.1.6'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
maven { url "https://jitpack.io" }
}
}
my app gradle is
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'walle'
def dep = rootProject.ext.dependencies
def and = rootProject.ext.android
android {
compileSdkVersion and.compileSdkVersion
buildToolsVersion and.buildToolsVersion
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
defaultConfig {
applicationId and.appid
minSdkVersion and.minSdkVersion
targetSdkVersion and.targetSdkVersion
versionCode 215005
versionName '3.0'
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
abiFilters 'armeabi'
}
manifestPlaceholders = [
JPUSH_PKGNAME : ,
JPUSH_APPKEY : ' ',
JPUSH_CHANNEL : ' ',
]
}
signingConfigs {
release {
keyAlias ' '
keyPassword ' '
storeFile file('./release-key.keystore')
storePassword ' '
v1SigningEnabled true
v2SigningEnabled true
}
debug {
keyAlias ' '
keyPassword ' '
storeFile file('. ')
storePassword ' '
}
}
buildTypes {
debug {
debuggable true
minifyEnabled false
signingConfig signingConfigs.debug
buildConfigField('boolean', 'ISRELEASE', '${IS_RELEASE}')
}
release {
debuggable false
minifyEnabled true
shrinkResources true
zipAlignEnabled true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField('boolean', 'ISRELEASE', '${IS_RELEASE}')
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
encoding = 'UTF-8'
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation dep.eventbus
implementation dep.immersionbar
implementation dep.immersionbarfragment
implementation dep.SmartRefreshLayout
// implementation dep.networking
implementation project(':android-networking')
// implementation 'com.amitshekhar.android:jackson-android-networking:1.0.2'
//glide
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation dep.glide
implementation 'com.github.bumptech.glide:okhttp3-integration:4.9.0'
implementation 'androidx.annotation:annotation:1.1.0'
annotationProcessor 'androidx.annotation:annotation:1.1.0'
implementation dep.rxjava2
implementation dep.okhttp3
implementation dep.rxandroid
implementation dep.rxbinding2
implementation project(':qmui')
implementation project(':arch')
implementation project(':emoji')
implementation project(':reclib-qq')
implementation 'com.facebook.stetho:stetho:1.1.1'
//flowLayout
implementation(project(':flowlayout-lib')) {
transitive = true
exclude group: 'androidx.appcompat', module: 'appcompat'
}
implementation dep.multidex
implementation dep.banner
implementation dep.toast
implementation dep.brvah
implementation dep.gson
implementation dep.baseadapter
//webview
api dep.agentweb
api 'com.just.agentweb:filechooser:4.1.2'//
api 'com.download.library:Downloader:4.1.2'//
implementation dep.picker_view
implementation dep.picker_picture
// api dep.aliyun
implementation 'com.amap.api:3dmap:7.0.0'
implementation 'com.amap.api:location:4.7.2'
implementation 'com.amap.api:search:6.9.2'
/**kotlin*/
implementation "androidx.core:core-ktx:1.1.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//utils
implementation 'com.blankj:utilcode:1.25.9'
//tablayout//https://github.com/H07000223/FlycoTabLayout
implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2#aar'
//butter knife
implementation "com.jakewharton:butterknife:$butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"
// api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:5.5.7'
api 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:5.3.1'
implementation 'com.yanzhenjie.recyclerview:x:1.3.2'
implementation 'com.kingja.loadsir:loadsir:1.3.6'
/*lottie*/
implementation('com.airbnb.android:lottie:3.2.0') { exclude group: 'com.androidx' }
implementation 'cn.jiguang.sdk:jmessage:2.9.0' //
implementation 'cn.jiguang.sdk:jcore:2.2.2' //
implementation project(':reclib-testemoticons')
implementation 'cn.jiguang.sdk:jpush:3.4.0' //
implementation 'com.github.chrisbanes.photoview:library:1.2.4'
implementation 'com.github.mtotschnig:StickyListHeaders:2.7.1'
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
implementation 'com.yanzhenjie:permission:2.0.3'
debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:3.0_beta2'
releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:3.0_beta2'
// api project(path: ':LibEasyGlide')
implementation 'com.binioter:guideview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//bugly
implementation 'com.tencent.bugly:crashreport:3.1.7'
implementation 'com.tencent.bugly:nativecrashreport:3.7.1'
implementation 'com.meituan.android.walle:library:1.1.6'
implementation "com.google.android.material:material:$materialVersion"
api project(path: ':LibEasyGlide')
}
the bottom is some dependencies, it all Commonly used library . when my android studio is 3.5.4,it work well, but when i update to 3.6 it build failed. i have no idea with this problem
and the gradle.properties is
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
If you are use new NDK then try to add below code in gradle.properties (Project properties)
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
android.enableD8=true
android.bundle.enableUncompressedNativeLibs=false
i got this error when trying to migrate my android app to androidX
with this implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.3.0'
but it's ok with :
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v7:0.8.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.6.0'
this build.gradle class
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "net.healthintouch.hit"
minSdkVersion 21
targetSdkVersion 28
versionCode 7
versionName "1.013"
multiDexEnabled true
testInstrumentationRunner "android.support.register.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
def baseUrl
release {
baseUrl = '\"http://healthintouch.me/"'
buildConfigField 'String', 'BASE_URL', baseUrl
resValue "string", "BASE_URL", "healthintouch.me"
buildConfigField 'Boolean', 'enableCrashlytics', 'true'
debuggable false
minifyEnabled true
shrinkResources true
// useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
baseUrl = '\"http://192.168.1.3/"'
buildConfigField 'String', 'BASE_URL', baseUrl
resValue "string", "BASE_URL", "healthintouch.me"
debuggable true
ext.enableCrashlytics = false
minifyEnabled false
shrinkResources false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'androidx.core:core:1.2.0-alpha01'
implementation 'com.google.android.material:material:1.1.0-alpha07'
// implementation 'androidx.cardview:cardview:1.0.0-rc02'
// implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.databinding:databinding-adapters:3.6.0-alpha02'
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0-alpha01'
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'br.com.mauker.materialsearchview:materialsearchview:1.2.3'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation 'com.google.android:flexbox:1.0.0'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.github.arabiaweather:arabic-time-sense:1.0.1'
implementation 'com.github.mthli:Knife:v1.1'
implementation 'com.github.drawers:SpinnerDatePicker:1.0.6'
implementation 'com.github.PierfrancescoSoffritti:AndroidYouTubePlayer:7.0.1'
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.8.2'
implementation 'org.jsoup:jsoup:1.8.3'
implementation 'com.leocardz:link-preview:2.0.0#aar'
// implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.5.0-beta.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v7:0.8.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.6.0'
implementation 'com.danikula:videocache:2.7.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation "com.daimajia.swipelayout:library:1.2.0#aar"
implementation 'com.codesgood:justifiedtextview:1.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation group: 'com.github.michaelgantman', name: 'MgntUtils', version: '1.5.0.3'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
and this is buid.gradle
buildscript {
repositories {
maven { url 'https://maven.google.com' }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
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 {
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy'}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
any answer ?
I had this problem, so I upgrade the Gradle plugin version then solved.
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.