Skip to content

Conversation

@ashutoshkmr
Copy link
Contributor

@ashutoshkmr ashutoshkmr commented Sep 11, 2019

Description

Fix Deprecated API usage

Related Issues

#122

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • If the pull request affects only one plugin, the PR title starts with the name of the plugin in brackets (e.g. [cloud_firestore])
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@ashutoshkmr ashutoshkmr changed the title [Firebase_messaging] Update firebase messaging api and gradle [Firebase_messaging] Fix Deprecated API usage Sep 11, 2019
@genert
Copy link

genert commented Sep 11, 2019

Looks good. 👍

@collinjackson collinjackson merged commit 5c33e5a into firebase:master Sep 19, 2019
@mestartlearncode
Copy link

mestartlearncode commented Sep 20, 2019

Hi @ashutoshkmr and @genert
Because of this update, i get error on my build:

Step #1: Note: Recompile with -Xlint:unchecked for details.
Step #1:
Step #1: /builder/home/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-5.1.6/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseMessagingService.java:143: error: method findAppBundlePath in class FlutterMain cannot be applied to given types;
Step #1:
Step #1: String appBundlePath = FlutterMain.findAppBundlePath();
Step #1:
Step #1: ^
Step #1:
Step #1: required: Context
Step #1:
Step #1: found: no arguments
Step #1:
Step #1: reason: actual and formal argument lists differ in length

Above error is on line 143...

any idea to solve this ?

This is urgent Because my project need to deliver asap....

@ashutoshkmr
Copy link
Contributor Author

Hi @ashutoshkmr and @genert
Because of this update, i get error on my build:

Step #1: Note: Recompile with -Xlint:unchecked for details.
Step #1:
Step #1: /builder/home/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-5.1.6/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseMessagingService.java:143: error: method findAppBundlePath in class FlutterMain cannot be applied to given types;
Step #1:
Step #1: String appBundlePath = FlutterMain.findAppBundlePath();
Step #1:
Step #1: ^
Step #1:
Step #1: required: Context
Step #1:
Step #1: found: no arguments
Step #1:
Step #1: reason: actual and formal argument lists differ in length

Above error is on line 143...

any idea to solve this ?

This is urgent Because my project need to deliver asap....

what is the dependency version on you build.gradle ?
should be api 'com.google.firebase:firebase-messaging:20.0.0'

@ashutoshkmr ashutoshkmr deleted the update_messaging branch September 20, 2019 06:57
@mestartlearncode
Copy link

mestartlearncode commented Sep 20, 2019

It's flutter prj

in pubspec.yaml:

firebase_messaging: ^5.0.2

below are my dependencies at app/build.gradle:

dependencies {

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
}

@mestartlearncode
Copy link

mestartlearncode commented Sep 20, 2019

Temporary solution for me:

pubspec.yaml

firebase_messaging: ">=5.0.2 <5.1.5"

@ashutoshkmr
Copy link
Contributor Author

It's flutter prj

in pubspec.yaml:

firebase_messaging: ^5.0.2

below are my dependencies at app/build.gradle:

dependencies {

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
}

did you try updating your android sdk ?

@mestartlearncode
Copy link

mestartlearncode commented Sep 20, 2019

It's flutter prj
in pubspec.yaml:
firebase_messaging: ^5.0.2
below are my dependencies at app/build.gradle:

dependencies {

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
}

did you try updating your android sdk ?

Which Android sdk needed to use your update ?

I am using google cloud build via docker,

Btw now solved temporary by change this on pubspec.yaml

firebase_messaging: ">=5.0.2 <5.1.5"

@ashutoshkmr
Copy link
Contributor Author

It's flutter prj
in pubspec.yaml:
firebase_messaging: ^5.0.2
below are my dependencies at app/build.gradle:

dependencies {

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
}

did you try updating your android sdk ?

Which Android sdk needed to use your update ?

I am using google cloud build via docker,

Btw now solved temporary by change this on pubspec.yaml

firebase_messaging: ">=5.0.2 <5.1.5"

FlutterMain.findAppBundlePath() does not require to pass context in the latest flutter api

https://api.flutter.dev/javadoc/io/flutter/view/FlutterMain.html#findAppBundlePath-android.content.Context-

What is your flutter version ?

kroikie pushed a commit to collinjackson/flutterfire that referenced this pull request Nov 15, 2019
* Upgrade firebase-messaging to 20.0.0
* Suppress unchecked warnings
@firebase firebase locked and limited conversation to collaborators Aug 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants