Bug? : AndroidManifest can't compile when installing package flutter_sound #1106
-
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi Ludo. It seems that the error is not with Flutter Sound but with your Android manifest file. |
Beta Was this translation helpful? Give feedback.
-
For info: here is the Manifest that we use in our example. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. Definitely tied to Flutter Sound as my manifest builds correctly and fails as soon as I install the package. I think to reproduce you have to set <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="My App Name"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
...
</application>
</manifest> |
Beta Was this translation helpful? Give feedback.
-
Thank you @nbarraille for the info. Unfortunately I can't reproduce your issue. It seems that you forgot the <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="Manifest.permission.CAPTURE_AUDIO_OUTPUT" />
<application >
<activity
android:name=".MainActivity"
android:label="My App Name"
android:icon="@mipmap/ic_launcher"
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>
`` |
Beta Was this translation helpful? Give feedback.
-
Hi Again I find my solution, needed to change my manifest a bit : I'm using visual studio code and when i create a new flutter project I have this basic manifest wich cause the issue:
I just made some little modification at the top such as :
And now I don't have the issue. For some reason it was only when I installed the flutter_sound project package that the error occured even though it seems to be an AndroidManifest issue. |
Beta Was this translation helpful? Give feedback.
-
i have the same error : C:\Users\Lenovo\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_sound-9.16.3\android\src\main\java\xyz\canardoux\fluttersound\FlutterSound.java uses or overrides a deprecated API. |
Beta Was this translation helpful? Give feedback.
Hi Again I find my solution, needed to change my manifest a bit :
I'm using visual studio code and when i create a new flutter project I have this basic manifest wich cause the issue: