You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently upgraded react-native version to 0.72.4 and found that android no longer builds due to a couple of issues, you can check both of them on reproducible repo https://github.com/Oleksii27/DfuExample on master branch. To reproduce:
cd android
./gradlew build
And you'll notice couple of build errors
minSdkVersion incompatibility:
> Task :react-native-nordic-dfu:processDebugAndroidTestManifest FAILED
/dev/AwesomeProject/node_modules/react-native-nordic-dfu/android/build/intermediates/tmp/manifest/androidTest/debug/tempFile1ProcessTestManifest8717370557204022401.xml:5:5-74 Error:
uses-sdk:minSdkVersion 18 cannot be smaller than version 21 declared in library [com.facebook.react:react-android:0.72.4] /Users/.gradle/caches/transforms-3/6fe00d6361b0f0c55549aec89a7f6742/transformed/jetified-react-android-0.72.4-debug/AndroidManifest.xml as the library might be using APIs not available in 18
Suggestion: use a compatible library with a minSdk of at most 18,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)
See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.
Which is caused by minSdkVersion 18 in build.gradle
I've solved it by applying a patch, where I inherited projects minSdkVersion, which I believe is a good solution. I could submit a pull request for that if it's fine.
The second one is a gradle lint problem which appears after applying the above patch:
> Task :app:lintDebug FAILED
Lint found 1 errors, 5 warnings. First failure:
/dev/AwesomeProject/android/app/src/main/AndroidManifest.xml: Error: When targeting Android 13 or higher, posting a permission requires holding the POST_NOTIFICATIONS permission (usage from no.nordicsemi.android.dfu.DfuBaseService) [NotificationPermission]
Explanation for issues of type "NotificationPermission":
When targeting Android 13 and higher, posting permissions requires holding
the runtime permission android.permission.POST_NOTIFICATIONS.
The full lint text report is located at:
/dev/AwesomeProject/android/app/build/intermediates/lint_intermediate_text_report/debug/lint-results-debug.txt
FAILURE: Build failed with an exception.
Hi! 👋
I've recently upgraded react-native version to 0.72.4 and found that android no longer builds due to a couple of issues, you can check both of them on reproducible repo https://github.com/Oleksii27/DfuExample on master branch. To reproduce:
And you'll notice couple of build errors
minSdkVersion
incompatibility:Which is caused by
minSdkVersion 18
inbuild.gradle
I've solved it by applying a patch, where I inherited projects
minSdkVersion
, which I believe is a good solution. I could submit a pull request for that if it's fine.Which is caused by a native
no.nordicsemi.android.dfu.DfuBaseService
class, I believe it has something to do withDfuBaseService
class using some notification posting, but I don't have much experience with java and I haven't really looked at their code. I have found thatAndroid-DFU-Library
uses this permission in theirAndroidManifest
in the example https://github.com/NordicSemiconductor/Android-DFU-Library/blob/b37200033f5d3fe412994e05dd20dd57e14acfe5/app/src/main/AndroidManifest.xmlWhich I suppressed by creating a lint config
But as far as I understand this only "suppresses" the error and I don't know about the consequences.
You can check both fixes on a patched branch of an example repo
The text was updated successfully, but these errors were encountered: