Closed pgiacomo69 closed 3 years ago
I dont think this is a library issue, you are having an Android resource linking failed
issue, can you build our example app and check if you get this issue?
Ok, later I can try. But yesterday I tried also to build my app against sdk 31 ad it worked. This is strange, it seems like this attribute works only with latest SDK, and it should not be included in manifest when building for SDK 30. Obviously, using the package version 4.0.1, the app is built normally.
error: attribute android:usesPermissionFlags not found
, you should not add API 31+ permissions to app on API30, example:
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"android:usesPermissionFlags="neverForLocation" />
works only on API >= 31
error: attribute android:usesPermissionFlags not found
, you should not add API 31+ permissions to app on API30, example:<uses-permission android:name="android.permission.BLUETOOTH_SCAN"android:usesPermissionFlags="neverForLocation" />
works only on API >= 31
Yes, but this line comes from package
android:usesPermissionFlags="neverForLocation"
is added to the Manifest of the Example app (see link), but it is not setup in our package, see the manifest.xml here.
So @pgiacomo69 are you sure you didn't set it up yourself in your manifest file?
No way, this is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.seleuco.unical_cr_app">
<uses-feature android:name="android.hardware.bluetooth"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> -->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="My App" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme"/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data android:name="flutterEmbedding" android:value="2"/>
</application>
</manifest>
@PieterAelse I can confirm the issue. Just create an example app, add reactive ble and you see it. What Android is doing is adding the following in the merged manifest:
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
š¤¦
@PieterAelse I can confirm the issue. Just create an example app, add reactive ble and you see it. What Android is doing is adding the following in the merged manifest:
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
š¤¦
Yessssss, now I was going crazy searching in other Packages
I managed to make it work by adding tools:node="remove"
to:
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" tools:node="remove" />
don't forgot to add xmlns:tools="http://schemas.android.com/tools"
in the top of your manifest.
@remonh87 If this is okay I can add it as doc in readme!
I managed to make it work by adding
tools:node="remove"
to:<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" tools:node="remove" />
don't forgot to add
xmlns:tools="http://schemas.android.com/tools"
in the top of your manifest.@remonh87 If this is okay I can add it as doc in readme!
But this should be used only with sdk<31? Iām curious to understand why this attribute is automagically set in sdk 30, and by who?
I managed to make it work by adding
tools:node="remove"
to:<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" tools:node="remove" />
don't forgot to add
xmlns:tools="http://schemas.android.com/tools"
in the top of your manifest. @remonh87 If this is okay I can add it as doc in readme!But this should be used only with sdk<31? Iām curious to understand why this attribute is automagically set in sdk 30, and by who?
Yes should be used only with sdk<31
yep that works for me lets do this! thanks @Taym95 . š
I have this same problem. What is the correct course of action? Is there a fix incoming?
I have this same problem. What is the correct course of action? Is there a fix incoming?
The solution in mentioned in the PR and in the comment above š
you should set Android SDK 31
@YellowShark mentioned:
you should set Android SDK 31
Would this be a more fundamental solution? After all, flutter doctor asserts:
[ā] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
@farr64 not sure if I understand your question but you can build the latest version against both SDK31 and 30. In the readme we provided instructions how to do this.
Yes, your instructions are clear.
The question is what default SDK you should choose. Apparently, you chose SDK30. So, the question is why not choose SDK31 as your default.
Thanks, @remonh87
I managed to make it work by adding
tools:node="remove"
to:<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" tools:node="remove" />
don't forgot to add
xmlns:tools="http://schemas.android.com/tools"
in the top of your manifest. @remonh87 If this is okay I can add it as doc in readme!But this should be used only with sdk<31? Iām curious to understand why this attribute is automagically set in sdk 30, and by who?
Yes should be used only with sdk<31
Thanks @Taym95
Build against Android 30 SDK Fails
To Reproduce Steps to reproduce the behavior: