Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release build fails due flutter_twitter dependency #14

Closed
deadsoul44 opened this issue Dec 14, 2019 · 12 comments
Closed

Release build fails due flutter_twitter dependency #14

deadsoul44 opened this issue Dec 14, 2019 · 12 comments

Comments

@deadsoul44
Copy link

Hello, app build is failing in release mode due to flutter_twitter dependency. There is no problem in debug mode.

`flutter run --release
Launching lib\main.dart on MYA L41 in release mode...

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':flutter_twitter:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\ASUS.gradle\caches\transforms-2\files-2.1\4b381a4f7d559d64bcbc7773e0474fc4\core-1.0.0\res\values\values.xml:57:5-88:25
: AAPT: error: resource android:attr/fontVariationSettings not found.

 C:\Users\ASUS\.gradle\caches\transforms-2\files-2.1\4b381a4f7d559d64bcbc7773e0474fc4\core-1.0.0\res\values\values.xml:57:5-88:25

: AAPT: error: resource android:attr/ttcIndex not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get
    full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 12s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 73.3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the
incompatibility.
Building plugin cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.
Running Gradle task 'assembleAarRelease'... `

@Andrious
Copy link
Member

I suspect it's instead a compatibility issue with Android: "android:attr/fontVariationSettings not found"

@deadsoul44
Copy link
Author

deadsoul44 commented Dec 16, 2019

Most of the people talk about changing compile sdk version to 28 in those links. In my build.gradle, it is already set to 28. flutter_twitter package can be outdated. Its first and last release is on May, before AndroidX hell.

@Andrious
Copy link
Member

I will look into this further...

@Andrious
Copy link
Member

You may have a resource the requires an even 'higher' SDK version, 29.

resource android:attr/fontVariationSettings not found. and android:attr/ttcIndex not found. error out of no where

@deadsoul44
Copy link
Author

It didn't work. We can close this issue if you think it is not related to auth and flutter_twitter.

@Andrious
Copy link
Member

Allow me to look into it in a day or two....it's working for me, but there's something I may be missing.

@deadsoul44
Copy link
Author

I removed all the stuff related flutter_twitter from the auth library and tried again and it worked.

@Andrious
Copy link
Member

Ah! Excellent! For you, it allows you to get on with it. For me, it's a clue. Thanks. I'll see what I can do to address this. Removing flutter_twitter may be an option.

@Andrious
Copy link
Member

Andrious commented Dec 29, 2019

Are you using the following Google Play services?: com.google.android.gms:play-services-gcm
Others having been having this problem due to the latest BREAKING CHANGE in Google Play service and Firebase. Specially you will have problem with the packages which are dependent on - com.google.android.gms:play-services-gcm

I am not using that particular package. If you are, possibly this solution will allow you to return the 'twitter stuff.': facebook/react-native#25293 (comment)

Here are the contents of my gradle files as a cross reference:

android/build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.3.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app/build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "com.XXXXXXXXX"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            signingConfig signingConfigs.debug

            minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            minifyEnabled false
            shrinkResources false
            debuggable true
        }
    }
//    buildTypes {
//        release {
//            // TODO: Add your own signing config for the release build.
//            // Signing with the debug keys for now, so `flutter run --release` works.
//            signingConfig signingConfigs.debug
//        }
//    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}


// ADD THIS AT THE BOTTOM
// Otherwise, Default FirebaseApp is not initialized in this process
apply plugin: 'com.google.gms.google-services'

@deadsoul44
Copy link
Author

I am not using gcm. I am using the following dependencies.

`
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-firestore:21.3.1'
implementation 'com.google.android.gms:play-services-ads:18.3.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
}

apply plugin: 'com.google.gms.google-services'`

@Andrious Andrious closed this as completed Apr 3, 2020
@deadsoul44
Copy link
Author

I tried v 5.0.1 but I still have this issue.

Launching lib\main.dart on SM G610F in release mode...
Running Gradle task 'assembleRelease'...
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_twitter-1.1.3\android\src\main\java\com\roughike\fluttertwitterlogin\fluttertwitterlogin\TwitterLoginPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Calling mockable JAR artifact transform to create file: C:\Users\ASUS\.gradle\caches\transforms-2\files-2.1\e95c58dd8e2fee499975833834cedce7\android.jar with input C:\Users\ASUS\AppData\Local\Android\sdk\platforms\android-27\android.jar

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_twitter:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\ASUS\.gradle\caches\transforms-2\files-2.1\b45528a27205a01405ad6f4395a0759b\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.

     C:\Users\ASUS\.gradle\caches\transforms-2\files-2.1\b45528a27205a01405ad6f4395a0759b\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4m 43s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin firebase_admob...
Running Gradle task 'assembleAarRelease'...
Downloading https://services.gradle.org/distributions/gradle-4.10.2-all.zip
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Unzipping C:\Users\ASUS\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv\gradle-4.10.2-all.zip to C:\Users\ASUS\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details


FAILURE: Build failed with an exception.

* Where:
Build file 'C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_admob-0.9.0+10\android\build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'firebase_admob'.
> Failed to apply plugin [id 'com.android.library']
   > Minimum supported Gradle version is 5.1.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_admob-0.9.0+10\android\gradle\wrapper\gradle-wrapper.properties to gradle-5.1.1-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 17s

Finished with error: The plugin firebase_admob could not be built due to the issue above.

@deadsoul44
Copy link
Author

Updating the compileSdkVersion of flutter_twitter to 29 solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants