Open arrrrny opened 2 days ago
I added the lintOptions as mentioned in the https://github.com/fluttercommunity/plus_plugins/issues/1986.
lintOptions {
disable 'MissingPermission'
}
But it did not build when I run. Example app is missing the gradlew folder, I needed to run flutter create .
Then within the android folder run below:
./gradlew clean
./gradlew build --refresh-dependencies
You will get exactly the same error as below:
Task :device_info_plus:lintReportDebug Wrote HTML report to file:///Users/arrrrny/Developer/sandbox/fluttercommunity%20plus_plugins%20main%20packages-device_info_plus/device_info_plus/example/build/device_info_plus/reports/lint-results-debug.html
Task :device_info_plus:lintDebug FAILED Lint found 1 errors, 3 warnings. First failure:
/Users/arrrrny/.pub-cache/hosted/pub.dev/device_info_plus-11.0.0/android/src/main/kotlin/dev/fluttercommunity/plus/device_info/MethodCallHandlerImpl.kt:70: Error: Missing permissions required by Build.getSerial: android.permission.READ_PRIVILEGED_PHONE_STATE [MissingPermission] Build.getSerial()
Explanation for issues of type "MissingPermission":
This check scans through your code and libraries and looks at the APIs
being used, and checks this against the set of permissions required to
access those APIs. If the code using those APIs is called at runtime, then
the program will crash.
Furthermore, for permissions that are revocable (with targetSdkVersion 23),
client code must also be prepared to handle the calls throwing an exception
if the user rejects the request for permission at runtime.
The full lint text report is located at:
/Users/arrrrny/Developer/sandbox/fluttercommunity plus_plugins main packages-device_info_plus/device_info_plus/example/build/device_info_plus/intermediates/lint_intermediate_text_report/debug/lintReportDebug/lint-results-debug.txt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':device_info_plus:lintDebug'.
> Lint found errors in the project; aborting build.
Fix the issues identified by lint, or create a baseline to see only new errors.
To create a baseline, run `gradlew updateLintBaseline` after adding the following to the module's build.gradle file:
```
android {
lint {
baseline = file("lint-baseline.xml")
}
}
```
For more details, see https://developer.android.com/studio/write/lint#snapshot
Lint found 1 errors, 3 warnings. First failure:
/Users/arrrrny/.pub-cache/hosted/pub.dev/device_info_plus-11.0.0/android/src/main/kotlin/dev/fluttercommunity/plus/device_info/MethodCallHandlerImpl.kt:70: Error: Missing permissions required by Build.getSerial: android.permission.READ_PRIVILEGED_PHONE_STATE [MissingPermission]
Build.getSerial()
Explanation for issues of type "MissingPermission":
This check scans through your code and libraries and looks at the APIs
being used, and checks this against the set of permissions required to
access those APIs. If the code using those APIs is called at runtime, then
the program will crash.
Furthermore, for permissions that are revocable (with targetSdkVersion 23),
client code must also be prepared to handle the calls throwing an exception
if the user rejects the request for permission at runtime.
The full lint text report is located at: /Users/arrrrny/Developer/sandbox/fluttercommunity plus_plugins main packages-device_info_plus/device_info_plus/example/build/device_info_plus/intermediates/lint_intermediate_text_report/debug/lintReportDebug/lint-results-debug.txt
Here is the content of the debug:
/Users/arrrrny/.pub-cache/hosted/pub.dev/device_info_plus-11.0.0/android/src/main/kotlin/dev/fluttercommunity/plus/device_info/MethodCallHandlerImpl.kt:70: Error: Missing permissions required by Build.getSerial: android.permission.READ_PRIVILEGED_PHONE_STATE [MissingPermission]
Build.getSerial()
~~~~~~~~~~~~~~~~~
Explanation for issues of type "MissingPermission":
This check scans through your code and libraries and looks at the APIs
being used, and checks this against the set of permissions required to
access those APIs. If the code using those APIs is called at runtime, then
the program will crash.
Furthermore, for permissions that are revocable (with targetSdkVersion 23),
client code must also be prepared to handle the calls throwing an exception
if the user rejects the request for permission at runtime.
/Users/arrrrny/.pub-cache/hosted/pub.dev/device_info_plus-11.0.0/android/build.gradle:12: Warning: A newer version of com.android.tools.build:gradle than 8.3.1 is available: 8.7.0. (There is also a newer version of 8.3.𝑥 available, if upgrading to 8.7.0 is difficult: 8.3.2) [AndroidGradlePluginVersion]
classpath 'com.android.tools.build:gradle:8.3.1'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "AndroidGradlePluginVersion":
This detector looks for usage of the Android Gradle Plugin where the
version you are using is not the current stable release. Using older
versions is fine, and there are cases where you deliberately want to stick
with an older version. However, you may simply not be aware that a more
recent version is available, and that is what this lint check helps find.
/Users/arrrrny/.pub-cache/hosted/pub.dev/device_info_plus-11.0.0/android/build.gradle:51: Warning: A newer version of org.jetbrains.kotlin:kotlin-stdlib than 1.8.22 is available: 2.0.20 [GradleDependency]
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "GradleDependency":
This detector looks for usages of libraries where the version you are using
is not the current stable release. Using older versions is fine, and there
are cases where you deliberately want to stick with an older version.
However, you may simply not be aware that a more recent version is
available, and that is what this lint check helps find.
/Users/arrrrny/.pub-cache/hosted/pub.dev/device_info_plus-11.0.0/android/src/main/kotlin/dev/fluttercommunity/plus/device_info/MethodCallHandlerImpl.kt:75: Warning: Using SERIAL to get device identifiers is not recommended [HardwareIds]
build["serialNumber"] = Build.SERIAL
~~~~~~
Explanation for issues of type "HardwareIds":
Using these device identifiers is not recommended other than for high value
fraud prevention and advanced telephony use-cases. For advertising
use-cases, use AdvertisingIdClient$Info#getId and for analytics, use
InstanceId#getId.
https://developer.android.com/training/articles/user-data-ids.html
1 errors, 3 warnings
Operating System
Mac OS Seqouia
Plugin
device_info_plus
Version
11.0.0
Flutter SDK
3.24.3
Compilation command
./gradlew clean ./gradlew build --refresh-dependencies
Dart Dependencies
No response
Native dependencies
No response
Compilation Error
For more details, see https://developer.android.com/studio/write/lint#snapshot
Lint found 1 errors, 3 warnings. First failure:
/Users/arrrrny/.pub-cache/hosted/pub.dev/device_info_plus-11.0.0/android/src/main/kotlin/dev/fluttercommunity/plus/device_info/MethodCallHandlerImpl.kt:70: Error: Missing permissions required by Build.getSerial: android.permission.READ_PRIVILEGED_PHONE_STATE [MissingPermission] Build.getSerial()