How to fix gradle which stopped working - error while syncing? - android

I have an Issue with gradle in my Android Project. I feel stupid I could't solve this Issue myself. I closed the project yesterday evening end reopend it this morning, So gradle wasn't touched at all. This morning i got the following error
Could not compile build file 'D:\Code\Android\workouttracker\app\build.gradle'.
> startup failed:
build file 'D:\Code\Android\workouttracker\app\build.gradle': 87: Unexpected input: '{' # line 87, column 14.
dependencies {
So i guessed it must be a missing braket, but I couldn't find one in my build gradle, maybe I am stupid or blind.
I get the same error when I run gradlew in the project direcroy
Here is my build.gradle (After me trieing to fix it)
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
configurations.implementation {
exclude group: 'org.jetbrains' , module:'annotations'
exclude group: 'org.jetbrains.kotlin' , module:'kotlin-stdlib'
exclude group: 'com.intellij', module:'annotations'
exclude group: 'com.intellij', module:'annotations'
exclude group: 'com.intellij', module:'annotations'
}
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
compileSdkVersion 30
buildToolsVersion '32.0.0-rc1'
defaultConfig {
applicationId 'ch.workouttracker'
minSdkVersion 28
targetSdkVersion 30
versionCode 901
versionName '0.9.0.1'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resConfigs "de" // And any other languages you support
}
signingConfigs {
release {
storeFile file("C:\\Users\\DonBolli\\.android\\debug.keystore")
storePassword ANDROID_STORE_PASSWORD
keyAlias 'workouttrackerkey'
keyPassword ANDROID_KEY_PASSWORD
}
debug {
storeFile file("C:\\Users\\DonBolli\\.android\\debug.keystore")
storePassword ANDROID_STORE_PASSWORD
keyAlias 'workouttrackerkey'
keyPassword ANDROID_KEY_PASSWORD
}
}
buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.md'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/DEPENDENCIES'
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
allprojects {
repositories {
mavenCentral()
maven { url = "https://maven.fabric.io/public" }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//Firebase
implementation platform('com.google.firebase:firebase-bom:29.0.0')
implementation ("com.google.firebase:firebase-core:20.0.0") {
exclude group: "com.android.support", module: "support-v4"
}
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.firebase:firebase-analytics:20.0.0'
implementation 'com.google.firebase:firebase-plugins:2.0.0'
implementation 'com.google.firebase:firebase-ml-vision:24.0.0'
implementation ("com.google.firebase:firebase-auth:21.0.1") {
exclude group: "com.android.support", module: "support-v4"
}
implementation 'com.google.firebase:firebase-database:20.0.2'
implementation 'com.google.firebase:firebase-storage:20.0.0'
//CrashAlyrics
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
//Graphview
implementation 'com.jjoe64:graphview:4.2.1'
implementation 'org.apache.commons:commons-lang3:3.4'
//Google Play
implementation ("com.google.android.gms:play-services-base:17.6.0") {
exclude group: "com.android.support", module: "support-v4"
}
implementation 'com.google.android.gms:play-services-auth:19.2.0'
//Support
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.appcompat:appcompat-resources:1.1.0"
implementation "androidx.navigation:navigation-fragment-ktx:2.2.1"
implementation "androidx.drawerlayout:drawerlayout:1.0.0"
implementation "androidx.gridlayout:gridlayout:1.0.0"
implementation "androidx.preference:preference:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "io.reactivex.rxjava2:rxjava:2.2.13"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
// Gradle
implementation com.android.tools.build:gradle);
//Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
/**
* dependency to request the runtime permissions.
*/
implementation 'com.karumi:dexter:4.2.0'
// code generator for view
implementation "com.jakewharton:butterknife:10.2.0"
annotationProcessor "com.jakewharton:butterknife-compiler:10.2.0"
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

There was an error inside the dependencies
// Gradle
implementation com.android.tools.build:gradle);
Changed this to
// Gradle
implementation 'com.android.tools.build:gradle'

Related

How to create App bundle for beta for release?

In the console, I see different versions of the application, but I don't quite understand how I can create an App Bundle beta in the Android Studio.
For example I am trying to create from Android Studio in this way:
Build -> Build Bundle(s)/APk -> Build Bundle(s)
Q: How i can create beta?
Here is code of my build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'idea'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'realm-android'
apply plugin: 'git-repo'
apply from: './jacoco.gradle'
apply from: "./common-methods.gradle"
android {
signingConfigs {
release
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/maven/com.squareup.retrofit/retrofit/pom.properties'
exclude 'META-INF/maven/com.squareup.retrofit/retrofit/pom.xml'
}
dexOptions {
javaMaxHeapSize "2048m"
jumboMode = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
defaultConfig {
applicationId "com.sai.android"
testApplicationId "com.sai.android.tests"
multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
buildToolsVersion '30.0.2'
minSdkVersion 19
compileSdkVersion 30
targetSdkVersion 30
versionCode 209
versionName '2.12.1'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
lintOptions {
disable 'MissingTranslation' // google services plugin is causing missing translation issue
}
testCoverageEnabled false
}
debug {
debuggable true
lintOptions {
disable 'MissingTranslation' // google services plugin is causing missing translation issue
}
testCoverageEnabled true
// applicationIdSuffix ".debug"
}
}
flavorDimensions "default"
productFlavors {
production {
dimension "default"
}
staging {
dimension "default"
}
acceptance {
dimension "default"
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
bundle {
language {
// Specifies that the app bundle should not support configuration APKs for language resources.
// These resources are instead packaged with each base and dynamic feature APK.
enableSplit = false
}
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:29.0.0'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':rasp')
implementation 'com.saltedge.android.common:views-lib:0.1.8.1#aar'
implementation 'com.saltedge.android.common:tools-lib:0.1.4#aar'
implementation 'com.saltedge.android.common:models-lib:0.1.3#aar'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "androidx.preference:preference-ktx:1.1.1"
implementation "androidx.work:work-runtime-ktx:2.5.0"
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.gms:play-services-identity:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.google.firebase:firebase-crashlytics:18.0.0'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation('com.twitter.sdk.android:twitter:3.3.0#aar') {
transitive = true
}
implementation 'com.tubb.smrv:swipemenu-recyclerview:5.4.8'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.yandex.android:mobmetricalib:3.2.2'
implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
implementation 'net.danlew:android.joda:2.10.2'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
implementation('com.theartofdev.edmodo:android-image-cropper:2.8.0') {
exclude group: "com.android.support"
}
implementation 'net.objecthunter:exp4j:0.4.8'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
implementation ("com.github.bumptech.glide:glide:4.11.0") {
exclude group: "com.android.support"
}
implementation 'com.caverock:androidsvg:1.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation('androidx.multidex:multidex-instrumentation:2.0.0') {
exclude group: 'com.android.support', module: 'multidex'
}
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.3.0'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation('androidx.test.espresso:espresso-idling-resource:3.1.0', {
exclude module: 'support-annotations'
})
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'recyclerview-v7'
})
androidTestImplementation 'org.hamcrest:hamcrest-core:2.2'
androidTestImplementation 'org.hamcrest:hamcrest-integration:1.3'
androidTestImplementation 'org.hamcrest:hamcrest-library:2.2'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.3.1'
androidTestImplementation 'org.mockito:mockito-android:3.2.4'
testImplementation 'org.mockito:mockito-core:3.3.3'
}
idea {
module {
testOutputDir = file('build/test-classes/debug')
}
}
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/glomadrian/maven" }
androidCommonGit("https://git.saltedge.com/shared/android-common.git")
}
setupSigning("./signing.properties", "release")
apply plugin: 'com.google.gms.google-services'
The version names which you show in your screenshot are all derived only from versionName property in your app module's build.gradle file. It does not matter in which Google Play Store release channel you put your app. The version name for your APK / AAB does not change.
If you want to create a version with a -beta suffix, you will need to actually add it to the version name value and create an APK / AAB.
Google Play store allows you to specify an own version name which will be visible in the store listing. You can do this when you create a release. But it won't affect the actually version name that is packaged with the APK / AAB.
Automatically change version name based on flavor or build type
It is however possible to automatically change the versionName (and applicationId) based on the flavor and / or build type. You can add a suffix to the version name with versionNameSuffix. This makes sense for example if you want to easily destinguish production, staging and acceptance test versions which you list in your example.
android{
...
flavorDimensions "default"
productFlavors {
production {
dimension "default"
}
staging {
dimension "default"
versionNameSuffix "-staging"
}
acceptance {
dimension "default"
versionNameSuffix "-acceptance"
}
}
}
Specify versionName in your gradle file here is the docs

Unable to reduce APK size

I am trying to reduce APK size by enabling minifyEnabled true and shrinkResources true in Gradle file and after enabling when I am building APK its size is not reducing its size is same as before.
Here is how I set my configuration:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.mobile.go"
minSdkVersion 16
targetSdkVersion 29
versionCode 19
versionName "1.18"
multiDexEnabled true
ndk.abiFilters 'armeabi-v7a','arm64-v8a'
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
debug {
minifyEnabled true
shrinkResources true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
configurations.all {
resolutionStrategy.force 'com.android.support:multidex:1.0.3'
}
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'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
// Returns whether lint should be quiet (for example, not write informational messages such as paths to report files written)
quiet true
// Whether lint should set the exit code of the process if errors are found
abortOnError false
// Returns whether lint will only check for errors (ignoring warnings)
ignoreWarnings true
// Returns whether lint should check for fatal errors during release builds. Default is true.
// If issues with severity "fatal" are found, the release build is aborted.
checkReleaseBuilds false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation project(':logging')
implementation project(':library')
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.mikepenz:iconics-core:2.5.10#aar'
implementation 'com.mikepenz:google-material-typeface:2.2.0.1.original#aar'
// implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
implementation 'com.github.lecho:hellocharts-library:1.5.8#aar'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
implementation 'com.parse:parse-android:1.10.0'
implementation 'pl.bclogic:pulsator4droid:1.0.3'
implementation 'com.hedgehog.ratingbar:app:1.1.2'
implementation('com.inscripts:CometChat:7.33.+')
{
transitive = true;
exclude module: 'gson'
}
implementation('com.inscripts:CometChatUI:7.33.+')
{
transitive = true;
exclude module: 'gson'
}
implementation 'org.jsoup:jsoup:1.8.1'
implementation 'com.android.support:multidex:1.0.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0#aar') {
transitive = true;
}
// for push notification
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
// Required for Flurry Analytics integration
implementation 'com.flurry.android:analytics:12.0.3'
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
}
repositories {
maven { url "https://jitpack.io" }
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
What am I missing?
In gradle code above,minifyenabled and shrinkresources are true for debug build,please check if you are building apk in release variant.
Other mechanisms to reduce apk size is to convert drawables to webp format as below.
select drawables and right click to get as below.
Then select lossy or lossless encoding because some drawables can't be converted into webp with lossless.
For more techniques,
https://medium.com/#kevalpatel2106/how-you-can-decrease-application-size-by-60-in-only-5-minutes-47eff3e7874e

Android: Unable to sync an old project, Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve error

I tried to open an old project, which is not mine, but it's not able to sync and build properly with the errors of Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve de.keyboardsurfer.android.widget:crouton:1.8.5. Show Details Affected Modules: app
the error is shown for almost each dependency,
i tried invalidating caches and restarting, cleaning the project and adding google to reporsitories.
here is my project gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter{ url "http://jcenter.bintray.com/" }
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
here is the app module gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.safesoft.inv.hyper"
minSdkVersion 16
targetSdkVersion 28
versionCode 14
versionName "1.0.10"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true //important
ndk
{
abiFilters "armeabi-v7a", "x86", "armeabi", "mips"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
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'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation('de.keyboardsurfer.android.widget:crouton:1.8.5#aar') {
// exclusion is not necessary, but generally a good idea.
exclude group: 'com.google.android', module: 'support-v4'
}
implementation 'com.haozhang.libary:android-slanted-textview:1.2'
implementation 'com.haozhang.libary:android-slanted-textview:1.2'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.uniquestudio:checkbox:1.0.1'
implementation 'com.labo.kaji:swipeawaydialog:0.1.0'
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation 'com.emmasuzuki:easyform:1.1.0'
implementation 'com.google.android.gms:play-services-maps:11.6.0'
implementation 'com.github.paolorotolo:expandableheightlistview:1.0.0'
implementation 'com.victor:lib:1.0.4'
implementation 'eu.inloop:simplerecycleradapter:0.3.1'
implementation 'me.grantland:autofittextview:0.2.+'
implementation 'com.jzxiang.pickerview:TimePickerDialog:1.0.1'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation 'com.jakewharton:butterknife:8.0.1'
implementation 'com.dropbox.core:dropbox-core-sdk:3.0.5'
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
implementation 'pl.coreorb:selection-dialogs:0.9.1'
//Button
implementation 'com.rilixtech:materialfancybuttons:1.8.7'
implementation 'com.google.android.gms:play-services-vision:11.6.0'
implementation 'me.dm7.barcodescanner:core:1.9.8'
implementation 'me.dm7.barcodescanner:zbar:1.9.8'
//implementation 'me.dm7.barcodescanner:zxing:1.9.8'
//Icons
implementation 'com.rilixtech:entypo-typeface:1.0.0.3'
implementation 'co.lemonlabs:expandable-button-menu:1.0.0'
//Date time pickr
implementation 'com.github.florent37:singledateandtimepicker:1.2.2'
// externel librery
implementation project(':folding-cell')
implementation project(':lib_badge')
implementation project(':library_bth')
implementation project(':materialbarcodescanner')
implementation project(path: ':SpinKitLib')
implementation project(':sweet_alert_dialog_library')
// /Libs
implementation files('libs/Jaybird2_2_4.jar')
implementation files('libs/telpo_api.jar')
implementation files('libs/core-3.1.0.jar')
implementation files('libs/opencsv-3.9.jar')
implementation files('libs/httpmime-4.0.3.jar')
implementation files('libs/dropbox-android-sdk-1.6.3.jar')
testImplementation 'junit:junit:4.12'
implementation 'junit:junit:4.12'
implementation files('libs/commons-net-1.4.1.jar')
}
Here is the project's hierarchy:
i should mention that this is a new job, and this project was made by the old developer 4 years ago, and i have to change some things inside the app (changing listViews with recyclerViews for example).

Error: Program type already present: android.support.v4.os.ResultReceiver?

I am using firebase messgessing sdk for push-notification. Here am not using androidx plugin. When am build its throw some error.
My gradle...
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.android.xxxxx"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// packagingOptions {
// pickFirst 'META-INF/*'
// exclude 'META-INF/proguard/androidx-annotations.pro'
// }
android.packagingOptions {
pickFirst 'META-INF/*'
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
configurations.all { exclude group: 'com.android.support', module: 'support-v4' }
dependencies {
ext {
support_library_version = '28.0.0'
}
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
// implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.android.support:multidex:1.0.3'
// implementation 'com.google.android.gms:play-services-gcm:17.0.0'
}
apply plugin: 'com.google.gms.google-services'
Error is...
Error: Program type already present: android.support.v4.os.ResultReceiver
once i remove the firebase sdk build is working fine. I search many solutions but still not working please anyone give me a solution.
Advance thanks...

Error: Program type already present: org.intellij.lang.annotations.JdkConstants$PatternFlags 3

I'm still stuck with this error. I deleted the build folder, the .gradle Folder and the gradle folder. Still the same error when building. I run out of ideas what I could try. This is my current build.gradle (app level)
apply plugin: 'com.android.application'
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
}
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'ch.workouttracker'
minSdkVersion 24
targetSdkVersion 28
multiDexEnabled true
versionCode 1
versionName "0.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resConfigs "de" // And any other languages you support
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions{
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
productFlavors {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
allprojects {
repositories {
maven { url = "https://maven.fabric.io/public" }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//Firebase
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
//Graphview
implementation 'com.jjoe64:graphview:4.2.1'
implementation 'org.apache.commons:commons-lang3:3.4'
//Google Play
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-identity:16.0.0'
//FirebaseUI
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.firebaseui:firebase-ui-storage:1.2.0'
implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
implementation 'com.twitter.sdk.android:twitter-core:3.1.1'
//Support
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-core-utils:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1 '
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:preference-v7:27.1.1'
//Firebase
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
implementation 'com.google.firebase:firebase-plugins:1.1.5'
implementation 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Do you have any ideas what I could try next? Any idea is welcome, I have no clue what else I could try. I keep developing, but I can't build it anymore, which makes it quit hard.
I don't really know what's the problem. I tried to search on google finding few solutions.
Only thing I came up with is please add the following line in your App level build.gradle.
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
}
Hope that will be helpful. I'm waiting for your answer.
Your error is org.intellij.lang.annotations.JdkConstants$PatternFlags 3
Ask Question
Maybe you can use this
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
compile.exclude group: 'com.intellij', module:'annotations'
compile.exclude group: 'org.intellij', module:'annotations'
}
With this pice of code i could fix the problem.
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
compile.exclude group: 'com.intellij', module:'annotations'
}

Categories

Resources