Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explanation for issues of type "ResourceCycle": when generate signed Apk

Tags:

android

I am getting error after update to appcompat-v7:24.0.0-alpha1 on generating the signed apk.

Error:Error: Style Resource definition cycle: TextAppearance.AppCompat.Light.SearchResult.Title => TextAppearance.AppCompat.SearchResult.Title => TextAppearance.AppCompat.SearchResult.Title [ResourceCycle]
like image 868
Pankaj Kumar Avatar asked Mar 19 '16 05:03

Pankaj Kumar


4 Answers

Temporary but Working Solution: I was searching for the solution for about two days but I was unable to create signed apk, finally I found the answer on this thread: https://code.google.com/p/android/issues/detail?id=203407

Just put these 3 lines in your 'app' build.gradle file under android()

lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

finally your build.gradle file will be like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '24.0.0 rc2'

    defaultConfig {
        applicationId "abc.xyz"
        minSdkVersion 9
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
//Here the magic Begins
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
//Here the magic Ends
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('src/main/libs/YouTubeAndroidPlayerApi.jar')
    compile 'de.greenrobot:greendao:2.1.0'
}

I hope this answer will help you. This will create your build, later when proper 24 support libraries release available, you have to change it properly.

like image 146
Naveed Ahmad Avatar answered Oct 13 '22 23:10

Naveed Ahmad


Faced same issue, here's right fix for it.

Start your SDK Manager, goto Extras section, here you can see update for Support Library. Install it.

Then open build.gradle/app.gradle change

compile 'com.android.support:appcompat-v7:24.0.0-alpha1'

to

compile 'com.android.support:appcompat-v7:24.0.0-alpha2'

Problem solved! cheers.

like image 35
Yogesh Avatar answered Oct 14 '22 01:10

Yogesh


https://code.google.com/p/android/issues/detail?id=203407 check it for more details...

paste it in your Gradle of your project

classpath 'com.android.tools.build:gradle:2.1.0-alpha1'

compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
compile 'com.android.support:design:24.0.0-alpha1'
compile 'com.android.support:support-v4:24.0.0-alpha1'
compile 'com.android.support:cardview-v7:24.0.0-alpha1'
like image 28
Nandkishor mewara Avatar answered Oct 14 '22 00:10

Nandkishor mewara


Downgrade local maven repository for support libraries.

Reverting back to 26 solves my problems.

See https://code.google.com/p/android/issues/detail?id=203546#c10

like image 42
aniki.kvn Avatar answered Oct 14 '22 01:10

aniki.kvn