Unable to build project with upgrade to android gradle 3.0

368
August 19, 2017, at 10:06 AM

I am trying to update android JavaVersion.VERSION_1_7 to JavaVersion.VERSION_1_8. I am using Android Studio 3.0 Beta 2 from canary branch. It looks like I did things by the book , but I am unable to compile my project with the new setup. I have provided a brief description of of my gradle file below and the error log as an output of assembling the build.

Here's the buildscript part of my gradle file.

Gradle buildscript

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'org.aspectj:aspectjtools:1.8.6'
    }
}

Gradle android

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 25
        renderscriptTargetApi 23
        renderscriptSupportModeEnabled true
    }
    // API 23 removes the http apache libraries, we require this to continue using them. We should
    // eventually move away from them and then remove this
    useLibrary 'org.apache.http.legacy'
    flavorDimensions "default"
    productFlavors {
        // product flavors here
    }
}

Error

Issues:
 - WARN: {PROJECT-PATH}/core/res/layout/preference_layout.xml:20 generated id android:id/summary for external package android
 - WARN: {PROJECT-PATH}/core/res/layout/preference_category_layout.xml:15 generated id android:id/title for external package android
 - ERROR: {PROJECT-PATH}/androidSDK/build/intermediates/incremental/mergeAospDebugResources/merged.dir/values/values.xml:6213 style attribute @android:attr/windowEnterAnimation not found
 - ERROR: {PROJECT-PATH}/androidSDK/build/intermediates/incremental/mergeAospDebugResources/merged.dir/values/values.xml:6214 style attribute @android:attr/windowExitAnimation not found
 - ERROR: {PROJECT-PATH}/androidSDK/build/intermediates/incremental/mergeAospDebugResources/merged.dir/values/values.xml:6226 style attribute @android:attr/windowEnterAnimation not found
 - ERROR: {PROJECT-PATH}/androidSDK/build/intermediates/incremental/mergeAospDebugResources/merged.dir/values/values.xml:6227 style attribute @android:attr/windowExitAnimation not found
 - ERROR:  failed linking references
        at com.android.builder.internal.aapt.v2.AaptV2Jni.buildException(AaptV2Jni.java:154)
        at com.android.builder.internal.aapt.v2.AaptV2Jni.makeValidatedPackage(AaptV2Jni.java:98)
        at com.android.builder.internal.aapt.AbstractAapt.link(AbstractAapt.java:40)
        ... 49 more
Answer 1

I found the error. I actually had to remove the "@" character from the attribute name:

Before:

<style name="slideUpAnimation">
    <item name="@android:windowEnterAnimation">@anim/slide_in_bottom</item>
    <item name="@android:windowExitAnimation">@anim/slide_out_bottom</item>
</style>

After

<style name="slideUpAnimation">
    <item name="android:windowEnterAnimation">@anim/slide_in_bottom</item>
    <item name="android:windowExitAnimation">@anim/slide_out_bottom</item>
</style>
READ ALSO
Issue with iOS or hosting?

Issue with iOS or hosting?

I have suddenly a strange problem with the speed of a homepage on iOS devices

206
Superpowered Android PlayBack &amp; Record Simultaneously

Superpowered Android PlayBack & Record Simultaneously

i am developing mixer using Superpowered Android C++ library, i am getting issue with the Player while Recording, player is not playing, only recorder is recordingbelow is the code, can anyone guide me where i am misplacing something

247
How to change the luminosity or contrast of an image in an android app?

How to change the luminosity or contrast of an image in an android app?

I m using Delphi Firemonkey (but I have access to the android java framework) and I would like to know if there is any way to let the user to change the contrast and the luminosity of the image they made before they send it to our server?

236
App in emulator is not updating with the project and showing a different layout

App in emulator is not updating with the project and showing a different layout

First of all, I am a totally newbie in android studio IDEWhen I am trying to show my project's results in the emulator, emulator shows me a different result than I created in project

243