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

Build fails for android targetSdkVersion = 27 #48

Closed
vitorreis opened this issue Dec 10, 2018 · 4 comments
Closed

Build fails for android targetSdkVersion = 27 #48

vitorreis opened this issue Dec 10, 2018 · 4 comments

Comments

@vitorreis
Copy link

Description

Release build fails when using targetSdkVersion = 27.

/workspace/pocs/adjustPoc/android
→ ./gradlew assembleRelease

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-adjust
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
bundle: Writing bundle output to: /Users/v.reis/workspace/pocs/adjustPoc/android/app/build/generated
/assets/react/release/index.android.bundle
bundle: Done writing bundle output

error: invalid file path '/Users/v.reis/workspace/pocs/adjustPoc/node_modules/react-native-adjust/an
droid/build/intermediates/manifests/aapt/release/AndroidManifest.xml'.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-adjust:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

How to reproduce

  1. Create a reactive native project & install adjust package.
  2. Set the config to build with targetSdkVersion = 27.
    In the file ./android/build.gradle edit the following section as
buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 17
        compileSdkVersion = 27
        targetSdkVersion = 27
        supportLibVersion = "27.1.1"
    }
  1. ./gradlew assembleRelease

Criticality

We are unable to release new versions because of this behaviour...

@uerceg
Copy link
Contributor

uerceg commented Dec 10, 2018

Hi @vitorreis,

Thanks for pointing out, will be addressed as soon as possible in next RN SDK release.

Will keep you posted in here.

@uerceg
Copy link
Contributor

uerceg commented Dec 11, 2018

Hi @vitorreis

I have tried to reproduce the issue you are seeing, but no luck. I have created new empty app and have added Adjust SDK via npm repo.

build.gradle file is set to reflect exact environment you have described above:

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 17
        compileSdkVersion = 27
        targetSdkVersion = 27
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
    }
}

Warnings from issue you reported in here (#47) are there beyond any doubt (as logs below will show), but issue you are facing with not being able to assemble release version of the app with assembleRelease Gradle task, I am not able to reproduce. Here's how it looks like to me when I run clean and assembleRelease tasks in this empty app I made and added Adjust SDK to it:

➜  android ./gradlew clean
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-adjust
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html


BUILD SUCCESSFUL in 15s
2 actionable tasks: 2 executed
➜  android ./gradlew assembleRelease

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-adjust
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
bundle: Writing bundle output to: /Users/uerceg/Projects/ReactNative/AdjustBuildError/android/app/build/generated/assets/react/release/index.android.bundle
bundle: Done writing bundle output

> Task :app:transformNativeLibsWithStripDebugSymbolForRelease
Unable to strip library '/Users/uerceg/Projects/ReactNative/AdjustBuildError/android/app/build/intermediates/transforms/mergeJniLibs/release/0/lib/armeabi/libicu_common.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is.


BUILD SUCCESSFUL in 54s
57 actionable tasks: 54 executed, 3 up-to-date

If you have any advice what I might be doing wrong and how to reproduce error you're facing, would be great.

SDK will be updated anyway to switch from usage of compile keyword in favour of implementation, but in case there's something else that needs to be updated to address this issue of yours, would be good to know.

Looking forward to hear from you.

Cheers

@uerceg uerceg added the support label Dec 11, 2018
@vitorreis
Copy link
Author

Hello @uerceg , thanks for the very fast response.
Sorry for the false report, after a ./gradlew clean I couldn't reproduce it anymore... The issue seems to be a conflict caused by react-native upgrade and another library that I have in my project.

Cheers.

@uerceg
Copy link
Contributor

uerceg commented Dec 12, 2018

Lovely, thanks for the update. RN SDK update for compile -> implementation change will be live soon. Will update you in the issue once live. Cheers!

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