-2

For 2 weeks now I have not been able to build any of my apps in android studio and it has become rather frustrating.

I am getting the following errors:

  • Error:resource style/Base.AlertDialog.AppCompat (aka com.almac.engineerapp:style/Base.AlertDialog.AppCompat) not found.
  • Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

I am aware that you can do the appt2.enable = false in the gradle.properties but this does not work for me.

I have also ensured that my build tools is 26.0.2 or something similar as advised by other posts and this hasn't worked.

I have not seen any other solutions and although this is similar I do not feel this is a duplicate post.

build.gradle:

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
    applicationId "com.almac.engineerapp"
    minSdkVersion 25
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
                                                                                 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-   android.txt'), 'proguard-rules.pro'
    }
  }
 }

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
implementation 'com.android.volley:volley:1.1.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

}

can someone please help

Rajeey3
  • 67
  • 10
  • Does it build on the command line? You could just remove all of the build file and its dependencies, then import the project as just a collection of source files. If you can't find the error in the build script that's what I would do. – markspace Jan 18 '18 at 16:56
  • I wouldn't be too sure how to work with command line. I have just been shown how to run the apps normally through the IDE – Rajeey3 Jan 18 '18 at 16:57

1 Answers1

1

I haven't been able to run the latest version of Android Studio for about a week before I decided to downgrade and use I believe Android 2. I can't tell what's wrong with your error but try an earlier version and if it works, it shouldn't cause you a lot of problems!

I've been developing my apps on Android 2.x for about 3 months now and I haven't experienced any real "version-related" problems.

Good luck,

ChanceVI
  • 200
  • 9
  • Thanks for the answer! although I have also tried downgrading and then it tells me to upgrade my gradle. weird thing is the girl I am working with has exact same gradle and all code as me and hers is working fine – Rajeey3 Jan 18 '18 at 17:01
  • Try deleting the file "gradle" or renaming it with something else and doing what Android Studio tells you to do when you open it. It will try to re-create it itself and maybe it will fix it? – ChanceVI Jan 18 '18 at 17:06