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 warnings #306

Closed
cyb3rko opened this issue Jul 18, 2023 · 3 comments · Fixed by #307
Closed

Build warnings #306

cyb3rko opened this issue Jul 18, 2023 · 3 comments · Fixed by #307
Labels
a:feature New feature or request

Comments

@cyb3rko
Copy link
Contributor

cyb3rko commented Jul 18, 2023

Shouldn't be too hard to fix.
The deprecations require some refactoring into new framework functions.

w: file:///[...]gotify/login/LoginActivity.kt:155:13 'startActivityForResult(Intent, Int): Unit' is deprecated. Deprecated in Java
w: file:///[...]gotify/login/LoginActivity.kt:166:15 'onActivityResult(Int, Int, Intent?): Unit' is deprecated. Overrides deprecated member in 'androidx.activity.ComponentActivity'. Deprecated in Java
w: file:///[...]gotify/messages/MessagesActivity.kt:249:19 'onBackPressed(): Unit' is deprecated. Overrides deprecated member in 'androidx.core.app.ComponentActivity'. Deprecated in Java
w: file:///[...]gotify/messages/MessagesModelFactory.kt:12:75 Unchecked cast: MessagesModel! to T
w: file:///[...]gotify/service/WebSocketConnection.kt:204:51 'getter for activeNetworkInfo: NetworkInfo?' is deprecated. Deprecated in Java
w: file:///[...]gotify/service/WebSocketConnection.kt:205:49 'getter for isConnected: Boolean' is deprecated. Deprecated in Java
w: file:///[...]gotify/settings/SettingsActivity.kt:113:28 'setTargetFragment(Fragment?, Int): Unit' is deprecated. Deprecated in Java
/home/runner/[...]res/values/strings.xml:39:4: Multiple substitutions specified in non-positional format of string resource string/other_error. Did you mean to add the formatted="false" attribute?
/home/runner/[...]res/values/strings.xml:5:4: Multiple substitutions specified in non-positional format of string resource string/version_failed. Did you mean to add the formatted="false" attribute?
/home/runner/[...]res/values/strings.xml:61:4: Multiple substitutions specified in non-positional format of string resource string/version_failed_status_code. Did you mean to add the formatted="false" attribute?
/home/runner/[...]res/values/strings.xml:66:4: Multiple substitutions specified in non-positional format of string resource string/versions. Did you mean to add the formatted="false" attribute?
@jmattheis jmattheis added the a:feature New feature or request label Jul 18, 2023
@cyb3rko
Copy link
Contributor Author

cyb3rko commented Jul 18, 2023

The last warning of the code build (SettingsActivity) has to be suppressed for now according to a Google employee.
Source: https://issuetracker.google.com/issues/181793702#comment3

@cyb3rko
Copy link
Contributor Author

cyb3rko commented Jul 18, 2023

I've already fixed most of them. What's left is the unchecked cast and the NetworkInfo deprecation.

My suggestions:

  • Unchecked cast: Suppress the warning, what else should we do here?
  • NetworkInfo deprecations: The recommended newer way to go is using a listener for network changes. But I believe just checking the current network info is enough here, a listener would not be helpful in my opinion. So also suppress?

What do you think @jmattheis ?

@jmattheis
Copy link
Member

Suppressing the warning looks ok. It's also done so in this android docs.

The network info is only used for logging in the websocket service, we can probably remove this, as it isn't really needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants