Skip to content

[local_auth]: The targetSdk version should not be declared in the android manifest file. #78541

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

Closed
nikhilbadyal opened this issue Mar 18, 2021 · 7 comments
Assignees
Labels
found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: local_auth Plugin for local authentification P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version t: gradle "flutter build" and "flutter run" on Android

Comments

@nikhilbadyal
Copy link

Steps to Reproduce

1.Sync project with gradle files

My local auth version
local_auth 1.1.0

Expected results:
No warnings

Actual results:

The targetSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Move targetSdkVersion to build file and sync project
Affected Modules: android.local_auth
Logs
[✓] Flutter (Channel stable, 2.0.2, on Microsoft Windows [Version 10.0.19042.868], locale en-IN)
    • Flutter version 2.0.2 at E:\Software\IDEs\Android\flutter
    • Framework revision 8962f6dc68 (7 days ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at E:\Software\IDEs\Android\android-sdk
    • Platform android-S, build-tools 30.0.3
    • ANDROID_HOME = E:\Software\IDEs\Android\android-sdk
    • Java binary at: E:\Software\IDEs\Android\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = E:\Software\Browsers\Chrome\Chrome Stable x64 Launcher.exe

[✓] Android Studio (version 4.1.0)
    • Android Studio at E:\Software\IDEs\Android\android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
    • IntelliJ at E:\Software\IDEs\Intellij\Intellij
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 89.0.774.54

• No issues found!
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Mar 19, 2021
@darshankawar
Copy link
Member

@ProblematicDude
Can you also provide your manifest file ?
Thanks.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 19, 2021
@nikhilbadyal
Copy link
Author

Here it is

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="myAppNamegoeshere">
	<uses-permission android:name="android.permission.INTERNET" />
   	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    	<uses-permission android:name="android.permission.CAMERA" />
   	<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    	<uses-permission android:name="android.permission.USE_FINGERPRINT" />
   <application
        android:label="notes"
	android:requestLegacyExternalStorage="true"
        android:icon="@mipmap/launcher_icon">
        <activity
            android:name=".MainActivity"
            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">

            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />

            <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>
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 19, 2021
@darshankawar
Copy link
Member

Thanks for reporting this.

I think the local_auth plugin missed out to remove the uses-sdk entry from it's manifest file and hence gradle shows this message.

Screenshot 2021-03-19 at 4 35 20 PM

Source:

Screenshot 2021-03-19 at 4 36 28 PM

Other plugin, such as camera doesn't have the said entry:

Screenshot 2021-03-19 at 4 37 17 PM

flutter doctor -v
[✓] Flutter (Channel stable, 2.0.2, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-GB)
    • Flutter version 2.0.2 at /Users/dhs/documents/Fluttersdk/flutter
    • Framework revision 8962f6dc68 (7 days ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.54.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • Mac OS X 10.15.4 19E2269
      darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 89.0.4389.90

! Doctor found issues in 1 category.

@darshankawar darshankawar added p: first party p: local_auth Plugin for local authentification t: gradle "flutter build" and "flutter run" on Android has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 2.0 Found to occur in 2.0 and removed in triage Presently being triaged by the triage team labels Mar 19, 2021
@darshankawar darshankawar changed the title The targetSdk version should not be declared in the android manifest file. [local_auth]: The targetSdk version should not be declared in the android manifest file. Mar 19, 2021
@nikhilbadyal
Copy link
Author

Yes, ik that. I reported , because i don't like red lines on the terminal ^_^

@cyanglaz cyanglaz added the P2 Important issues not at the top of the work list label Mar 25, 2021
@stuartmorgan-g stuartmorgan-g added the platform-android Android applications specifically label Jun 13, 2021
@exaby73
Copy link
Member

exaby73 commented May 19, 2022

Issue is reproducible in latest stable and master channels of Flutter, with the plugin version 2.0.2.

Logs
The targetSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Move targetSdkVersion to build file and sync project
Affected Modules: android.local_auth_android

On checking the AndroidManifest.xml of the local_auth_android plugin, uses-sdk still exists as pointed out initially by @darshankawar.

AndroidManifest.xml (local_auth_android)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="io.flutter.plugins.localauth">
    <uses-sdk android:targetSdkVersion="29"/>
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />
</manifest>
flutter doctor -v (Stable)
[✓] Flutter (Channel stable, 3.0.0, on macOS 12.3.1 21E258 darwin-arm, locale en-US)
    • Flutter version 3.0.0 at /Users/nabeelparkar/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (7 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/nabeelparkar/Library/Android/sdk/
    • Platform android-32, build-tools 32.1.0-rc1
    • ANDROID_SDK_ROOT = /Users/nabeelparkar/Library/Android/sdk/
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Applications/Brave Browser.app/Contents/MacOS/Brave Browser

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 67.1.4
    • Dart plugin version 221.5591.52

[✓] VS Code (version 1.67.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Brave Browser 101.1.38.115

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
flutter doctor -v (Master)
[✓] Flutter (Channel master, 3.1.0-0.0.pre.799, on macOS 12.3.1 21E258 darwin-arm, locale en-US)
    • Flutter version 3.1.0-0.0.pre.799 at /Users/nabeelparkar/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 348a2b4f2f (2 hours ago), 2022-05-19 00:33:08 -0400
    • Engine revision 1965c92ea4
    • Dart version 2.18.0 (build 2.18.0-130.0.dev)
    • DevTools version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/nabeelparkar/Library/Android/sdk/
    • Platform android-32, build-tools 32.1.0-rc1
    • ANDROID_SDK_ROOT = /Users/nabeelparkar/Library/Android/sdk/
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Applications/Brave Browser.app/Contents/MacOS/Brave Browser

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 67.1.4
    • Dart plugin version 221.5591.52

[✓] VS Code (version 1.67.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (4 available)
    • V2050 (mobile)            • 3085425058000NM • android-arm64  • Android 12 (API 31)
    • sdk gphone arm64 (mobile) • emulator-5554   • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos           • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)              • chrome          • web-javascript • Brave Browser 101.1.38.119

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@exaby73 exaby73 added found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 and removed found in release: 2.0 Found to occur in 2.0 labels May 19, 2022
@stuartmorgan-g stuartmorgan-g self-assigned this May 21, 2023
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@stuartmorgan-g
Copy link
Contributor

This was fixed in flutter/packages#3748

@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Jul 10, 2023
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: local_auth Plugin for local authentification P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version t: gradle "flutter build" and "flutter run" on Android
Projects
None yet
Development

No branches or pull requests

6 participants