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

[Android] AsyncTask is deprecated #22

Open
birdofpreyru opened this issue Dec 12, 2023 · 2 comments
Open

[Android] AsyncTask is deprecated #22

birdofpreyru opened this issue Dec 12, 2023 · 2 comments
Labels
On Hold Blocked for some reason. P2 Important issue.

Comments

@birdofpreyru
Copy link
Owner

Android's AsyncTask class was deprecated in API level 30, thus its uses in the library should be replaced by java.util.concurrent or Kotlin concurrency utilities.

@birdofpreyru birdofpreyru added the P1 High priority issue. label Dec 12, 2023
@birdofpreyru birdofpreyru added P2 Important issue. and removed P1 High priority issue. labels Jan 28, 2024
@birdofpreyru birdofpreyru added the On Hold Blocked for some reason. label Apr 5, 2024
@cixio
Copy link

cixio commented May 30, 2024

I think this is the same issue on build?

> Task :dr.pogodin_react-native-fs:compileReleaseKotlin
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:3:19 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:14:20 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:14:20 'constructor AsyncTask<Params : Any!, Progress : Any!, Result : Any!>()' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:88:33 'publishProgress(vararg LongArray?): Unit' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:91:29 'publishProgress(vararg LongArray?): Unit' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:98:37 'publishProgress(vararg LongArray?): Unit' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:128:15 'onProgressUpdate(vararg Progress!): Unit' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Downloader.kt:134:33 Parameter 'ex' is never used
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:8:19 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:136:26 This declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:144:11 'execute(vararg String?): AsyncTask<String?, Void?, kotlin.Exception? /* = java.lang.Exception? */>!' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:148:33 The corresponding parameter in the supertype 'ReactNativeFsSpec' is named 'assetPath'. This may cause problems when calling this function with named arguments.
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:148:47 The corresponding parameter in the supertype 'ReactNativeFsSpec' is named 'destination'. This may cause problems when calling this function with named arguments.
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:292:24 'execute(vararg DownloadParams?): AsyncTask<DownloadParams?, LongArray?, DownloadResult!>!' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:443:34 This declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress. See https://youtrack.jetbrains.com/issue/KT-47902 for details
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:452:19 'execute(vararg String?): AsyncTask<String?, Void?, kotlin.Exception? /* = java.lang.Exception? */>!' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:522:31 Unsafe use of a nullable receiver of type Array<(out) File!>?
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:782:22 'execute(vararg UploadParams?): AsyncTask<UploadParams?, IntArray?, UploadResult!>!' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:838:45 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:838:45 'constructor AsyncTask<Params : Any!, Progress : Any!, Result : Any!>()' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsModule.kt:899:27 Unsafe use of a nullable receiver of type Array<(out) File!>?
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/ReactNativeFsPackage.kt:23:53 'constructor ReactModuleInfo(String!, String!, Boolean, Boolean, Boolean, Boolean, Boolean)' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Uploader.kt:3:19 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Uploader.kt:18:18 'AsyncTask<Params : Any!, Progress : Any!, Result : Any!>' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Uploader.kt:18:18 'constructor AsyncTask<Params : Any!, Progress : Any!, Result : Any!>()' is deprecated. Deprecated in Java
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Uploader.kt:38:47 Parameter 'result' is never used
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Uploader.kt:84:33 Type mismatch: inferred type is String? but String was expected
w: file:///[...]/node_modules/@dr.pogodin/react-native-fs/android/src/main/java/com/drpogodin/reactnativefs/Uploader.kt:119:33 Type mismatch: inferred type is String? but String was expected

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

Build is successful, no worries until now.

@birdofpreyru
Copy link
Owner Author

Well, there are different warnings in your log. The AsyncTask deprecation (this ticket subject) is among them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Hold Blocked for some reason. P2 Important issue.
Projects
None yet
Development

No branches or pull requests

2 participants