Deprecated API, unchecked/unsafe operation during Android build


#1

Hello,

I’m getting these messages for awhile now, when building for Android (release/debug):

Running full build
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Project successfully built.
Installing...
Successfully installed on device with identifier 'emulator-5554'.
Successfully transferred all files.

When I try to build with “-Xlint:deprecation” - as suggested - I’m getting an error that The option 'X' is not supported.

Just wanted make sure that are these messages safe to ignore?

Thanks.


#2

They are indeed safe to ignore, those warnings are emitted when using the tns_core_modules, as their generated Java classes need to be compatible with both pre API 21 and with devices of API 21 and up. The deprecation warnings normally warn that there are APIs whose usage is not recommended on after API 21.

Also, simply running tns run/build android does not allow you to pass any additional or custom options to the gradle build which emits those messages.


#3

Thanks @Pete.K !

(this post has over twenty characters now)