React-native-onesignal: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'

Created on 29 Sep 2018  路  6Comments  路  Source: OneSignal/react-native-onesignal

Description:
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

Environment
react-native 0.57
react-native-onesignal 3.2.7

Maintenance Issue

Most helpful comment

@bayazetyan @mnlbox Thanks for point this out, we have intentionally held out on leaving this as compile as implementation and api don't exist in a number of older React Native projects. This is due to some React Native projects still being on Gradle 2.3 which would case errors for these projects.

We will however update this soon since compile will be drop completely in a future Gradle or Android Plugin release.

All 6 comments

@bayazetyan I also see this in warning in release mode:

> Configure project :react-native-onesignal 
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
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

I think it's related to gradle version and need some update.

/CC: @Nightsd01, @avishayil

@bayazetyan @mnlbox Thanks for point this out, we have intentionally held out on leaving this as compile as implementation and api don't exist in a number of older React Native projects. This is due to some React Native projects still being on Gradle 2.3 which would case errors for these projects.

We will however update this soon since compile will be drop completely in a future Gradle or Android Plugin release.

@jkasten2 does this mean new RN projects won't be able to sync/build starting 2019?

@slorber that is the case, I ran into it today. Was able to fix by manually changing the compile usages in the build.gradle file in the node_module package itself, which is not ideal. I opted to use api in place of compile for things I wasn't entirely sure when they needed to be accessible at what times. Hopefully we see a fix for this soon.

EDIT: It also appears that complileOnly works as a replacement for compile for things like 'com.facebook.react:react-native:+' that are only needed at compile time.

This has been fixed. Thanks for pointing it out

Was this page helpful?
0 / 5 - 0 ratings