3

I imported a working project from github and I find myself unable to run/rebuild project because of a problem with my styles.xml and build.grable.

Here are the links that I visited regarding this issue:

And many more..Most solutions are old (5+ years) and the ones I tried did not work:

  • Add compile 'com.android.support:appcompat-v7:25.3.1' in your build.gradle dependencies
  • Import appcompat, the import button disappeared in the current version it seems
  • Recompile/Resync/Invalidate cache/Close project/Reimport from github
  • Adding library dependance in the module settings (I am asked to upload a file?)

Please be very explicit in your answers as to what to do (open X file, do Y) as I'm new with Android Studio.

Here are the main files:

Styles.xml:

<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />   
</resources>

Build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.app.game.quizee"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:support-vector-drawable:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    testCompile 'junit:junit:4.12'
}

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

And the errors :List of errors

Thank you for your time!

Community
  • 1
  • 1
Maude
  • 512
  • 3
  • 8
  • 23
  • Can you share the link to that Github project? – Shashanth Apr 23 '17 at 09:45
  • Here is the link: https://github.com/ggegiya1/QuiZee All my team downloaded it without a problem – Maude Apr 23 '17 at 16:19
  • For me it's working properly. Delete the project and checkout fresh copy from Github and re-import it. That should work. – Shashanth Apr 23 '17 at 16:36
  • If I download the project, extract and open it, it works. But if I open android studio and import directly from github, I get this error. Any idea why the direct import creates this issue? It's frustrating because I can't commit/pull directly from Android Studio if I don't link it with github. – Maude Apr 23 '17 at 16:51
  • I used `git pull` command to copy the project from that link. If Android Studio doesn't detect VCS root, restart Android Studio that's it. After that you can pull or commit from Android Studio. Best of luck – Shashanth Apr 23 '17 at 16:59

1 Answers1

0

Gradle version: "2.3.1" was causing this in my case, fixed it by returning to version "2.2.3".

In another words change this line:

classpath 'com.android.tools.build:gradle:2.3.1'

to:

classpath 'com.android.tools.build:gradle:2.2.3'