Open loxi5 opened 9 months ago
i faced the same problem when i tried to upgrade flutter to 3.19.3 i get asked to upgrade my build.gradle as the flutter docs says then i faced this error
i fixed it by adding this line inside android { // Conditional for compatibility with AGP <4.2. if (project.android.hasProperty("namespace")) { namespace 'com.pusher.channels_flutter' } inside the android/build.gradle for the pusher package source code
same issue any fix ?
I have the same issue. Someone knows how can I solve it
I have the same issue. Someone knows how can I solve it
for me this worked
Created a file on root android folder named pusher_channels_flutter_fix.gradle
and added this content
subprojects { subproject ->
if (subproject.name == 'pusher_channels_flutter') {
subproject.afterEvaluate {
// Remove the package attribute from the AndroidManifest.xml
def manifestFile = file("${subproject.projectDir}/src/main/AndroidManifest.xml")
if (manifestFile.exists()) {
def manifestContent = manifestFile.text
manifestContent = manifestContent.replaceAll('package="com.pusher.channels_flutter"', '')
manifestFile.text = manifestContent
}
// Add the namespace property to build.gradle
subproject.android {
namespace = 'com.pusher.channels_flutter'
}
}
}
}
then at the end of build.gradle
I added this line
apply from: 'pusher_channels_flutter_fix.gradle'
Was having two issues for both the manifest and the namespace
At least for me this worked! Hope it helps you also
I am getting the same issue after upgrading my compileSDKVersion and targetSDKVersion. Any Solutions?
I have the same issue. Someone knows how can I solve it
for me this worked
Created a file on root android folder named
pusher_channels_flutter_fix.gradle
and added this contentsubprojects { subproject -> if (subproject.name == 'pusher_channels_flutter') { subproject.afterEvaluate { // Remove the package attribute from the AndroidManifest.xml def manifestFile = file("${subproject.projectDir}/src/main/AndroidManifest.xml") if (manifestFile.exists()) { def manifestContent = manifestFile.text manifestContent = manifestContent.replaceAll('package="com.pusher.channels_flutter"', '') manifestFile.text = manifestContent } // Add the namespace property to build.gradle subproject.android { namespace = 'com.pusher.channels_flutter' } } } }
then at the end of
build.gradle
I added this lineapply from: 'pusher_channels_flutter_fix.gradle'
Was having two issues for both the manifest and the namespace
At least for me this worked! Hope it helps you also
I got this message * What went wrong: A problem occurred evaluating root project 'android'.
Could not read script '/Users/io/Trabajo/test/project/android/pusher_channels_flutter_fix.gradle' as it does not exist.
I have the same issue. Someone knows how can I solve it
for me this worked Created a file on root android folder named
pusher_channels_flutter_fix.gradle
and added this contentsubprojects { subproject -> if (subproject.name == 'pusher_channels_flutter') { subproject.afterEvaluate { // Remove the package attribute from the AndroidManifest.xml def manifestFile = file("${subproject.projectDir}/src/main/AndroidManifest.xml") if (manifestFile.exists()) { def manifestContent = manifestFile.text manifestContent = manifestContent.replaceAll('package="com.pusher.channels_flutter"', '') manifestFile.text = manifestContent } // Add the namespace property to build.gradle subproject.android { namespace = 'com.pusher.channels_flutter' } } } }
then at the end of
build.gradle
I added this lineapply from: 'pusher_channels_flutter_fix.gradle'
Was having two issues for both the manifest and the namespace At least for me this worked! Hope it helps you also
I got this message * What went wrong: A problem occurred evaluating root project 'android'.
Could not read script '/Users/io/Trabajo/test/project/android/pusher_channels_flutter_fix.gradle' as it does not exist.
Add the pusher_channels_flutter_fix.gradle on the anndroid
folder
I solve it. This way:
/Users/your username/.pub-cache/hosted/pub.dev/pusher_channels_flutter-2.2.1/android/build.gradle
I wrote the package name
android {
namespace 'com.pusher.channels_flutter'
.....
}
I clean my cache with flutter clean and the error disappear. The error message "Namespace not specified" indicates that the pusher_channels_flutter library you're using doesn't have a namespace defined in its build.gradle file. This is a requirement since Android Gradle Plugin 8.0
pusher_channels_flutter:
git:
url: https://github.com/dola99/pusher-channels-flutter
ref: new_version
it will clear all cached packages on your device
then
flutter pub cache clean
flutter clean
flutter pub get
flutter build apk
it will work with you
When the library is installed, building app fails with the following error:
FAILURE: Build failed with an exception.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
BU�LD FAILED in 8s Error: Gradle task assembleDebug failed with exit code 1