Open loxi5 opened 5 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.
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