blaugold / iabtcf_consent_info

Flutter plugin for reading IAB TCF v2.0 user consent information, such as made available through CMP SDKs, like Funding Choices's User Messaging Platform (UMP).
https://pub.dev/packages/iabtcf_consent_info
9 stars 8 forks source link

Support for AGP 8 #18

Open sneglia9191 opened 3 months ago

sneglia9191 commented 3 months ago

Getting this issue when building after upgrading to AGP 8+:

Incorrect package="com.gabriel.terwesten.iabtcf_consent_info" found in source AndroidManifest.xml: /Users/sneglia/.pub-cache/hosted/pub.dev/iabtcf_consent_info-3.1.0/android/src/main/AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="com.gabriel.terwesten.iabtcf_consent_info" from the source AndroidManifest.xml: /Users/sneglia/.pub-cache/hosted/pub.dev/iabtcf_consent_info-3.1.0/android/src/main/AndroidManifest.xml.

FAILURE: Build failed with an exception.

storeIt commented 2 months ago

You could fix this issue with deletion of the package line in AndroidManifest. Delete this: 'package="com.gabriel.terwesten.iabtcf_consent_info' and you will have an empty manifest tag like: ' '.

osmanozturk commented 1 month ago

Doing that is not enough, it still complains about the namespace even if you add the main gradle fix and kotlin version. Library needs an update for AGP 8

large commented 1 month ago

It does not only concern this package, but here is a hack to handle all packages that has not yet upgraded to AGP 8.x, add this to the allprojects part in your build.gradle (android):

allprojects {
    afterEvaluate { project ->
        if (project.hasProperty('android')) {
            project.android {
                if (namespace == null) {
                    namespace project.group
                }
            }
        }
    }
}

This project should though be upgraded so it is compilled with Java 17 and not 1.8 which current version is setup todo.

osmanozturk commented 1 month ago

It does not only concern this package, but here is a hack to handle all packages that has not yet upgraded to AGP 8.x, add this to the allprojects part in your build.gradle (android):

allprojects {
    afterEvaluate { project ->
        if (project.hasProperty('android')) {
            project.android {
                if (namespace == null) {
                    namespace project.group
                }
            }
        }
    }
}

This project should though be upgraded so it is compilled with Java 17 and not 1.8 which current version is setup todo.

That's what I meant by gradle fix but that didn't work out for me either. I will recheck the Java 17 part

egonbeermat commented 2 weeks ago

This is an incredibly useful package, but as the Flutter package ecosystem is gradually upgrading AGP, this package is in danger of gating that, by becoming stale. The above allprojects addition wasn't enough for me to move forward. It would be great if the author could resolve themselves / review the proposed PR for this fix, and move forward! Keep up the good work!

osmanozturk commented 2 weeks ago

I second that

This is an incredibly useful package, but as the Flutter package ecosystem is gradually upgrading AGP, this package is in danger of gating that, by becoming stale. The above allprojects addition wasn't enough for me to move forward. It would be great if the author could resolve themselves / review the proposed PR for this fix, and move forward! Keep up the good work!