Amplify-js: aws-amplify-react-native:compileDebugJavaWithJavac FAILED: cannot find symbol `notification.setChannelId(channelId)`

Created on 3 Jun 2018  路  4Comments  路  Source: aws-amplify/amplify-js

My dependencies in package.json:

"dependencies": {
        "aws-amplify": "^0.4.3",
        "aws-amplify-react-native": "^0.2.14",
        "aws-sdk": "^2.167.0",
        "lodash": "^4.17.4",
        "moment": "^2.22.1",
        "prop-types": "^15.6.1",
        "react": "^16.3.1",
        "react-dom": "^16.4.0",
        "react-native": "^0.55.4",
        "react-native-camera": "^1.1.4",
        "react-native-device-info": "^0.21.5",
        "react-native-elements": "^0.19.1",
        "react-native-fbsdk": "^0.7.0",
        "react-native-i18n": "^2.0.10",
        "react-native-image-picker": "^0.26.7",
        "react-native-permissions": "^1.0.6",
        "react-native-uuid": "^1.4.9",
        "react-native-vector-icons": "^4.6.0",
        "react-navigation": "^1.0.0-beta.21",
        "react-redux": "^5.0.7",
        "redux": "^4.0.0"
    },
    "devDependencies": {
        "babel-jest": "21.2.0",
        "babel-preset-react-native": "4.0.0",
        "eslint": "^4.13.1",
        "eslint-plugin-react": "^7.5.1",
        "jest": "21.2.1",
        "react-test-renderer": "^16.4.0",
        "redux-mock-store": "^1.5.1"
    },

On Android -> Gradle sync is ok but when I run react-native- run-android the build is failing for the following error:

> Task :aws-amplify-react-native:compileDebugJavaWithJavac FAILED
<...>/node_modules/aws-amplify-react-native/android/src/main/java/com/amazonaws/amplify/pushnotification/modules/RNPushNotificationHelper.java:295: error: cannot find symbol
                    notification.setChannelId(channelId);
                                ^
  symbol:   method setChannelId(String)
  location: variable notification of type Builder
Note: <...>/node_modules/aws-amplify-react-native/android/src/main/java/com/amazonaws/amplify/pushnotification/modules/RNPushNotificationHelper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
bug

Most helpful comment

I got the same issue.
Any update?

All 4 comments

I got the same issue.
Any update?

It is fixed in the latest patch.

Just adding a comment that I'm running into this same issue from aws-amplify 0.4.8 and aws-amplify-react-native 0.2.19 to any 1.* versions. This is with react 16.3.1 and react-native 0.55.4

So far, this seems to be the main entry point for those trying to update aws-amplify to 1.* and seeing this issue. If anyone has found a workaround, that would be great to know. One difference with the original post is that the 2nd library error is debugCompileClasspath, instead of pushNotification.

Adding onto my own comment -- this is entirely related to PushNotifications -- I had thought it might be the new modularized version as of 1.* and/or something with dependencies in Android Studio. But, confirming this note: https://github.com/aws-amplify/amplify-js/issues/408 -- if you take out all of your PushNotifications it then builds.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shinnapatthesix picture shinnapatthesix  路  3Comments

guanzo picture guanzo  路  3Comments

benevolentprof picture benevolentprof  路  3Comments

cosmosof picture cosmosof  路  3Comments

lucasmike picture lucasmike  路  3Comments