heap / react-native-heap

A React Native integration for Heap
MIT License
82 stars 36 forks source link

No suitable method found for w(String) #334

Closed amq closed 2 years ago

amq commented 2 years ago

Getting this error with the android build:

> Task :heap_react-native-heap:compileReleaseJavaWithJavac FAILED
/home/runner/work/reactnative-app/reactnative-app/node_modules/@heap/react-native-heap/android/src/main/java/com/heapanalytics/reactnative/RNHeapLibraryModule.java:86: error: no suitable method found for w(String)
        Log.w("Property objects must be flattened before being sent across the JS bridge. If you get this warning please inspect for non-flattenable objects being sent to Heap");
           ^
    method Log.w(String,String) is not applicable
      (actual and formal argument lists differ in length)
    method Log.w(String,String,Throwable) is not applicable
      (actual and formal argument lists differ in length)
    method Log.w(String,Throwable) is not applicable
      (actual and formal argument lists differ in length)
1 error

Seems like this

Log.w("Property objects must be flattened before being sent across the JS bridge. If you get this warning please inspect for non-flattenable objects being sent to Heap");

Should be:

Log.w("RNHeapLibraryModule", "Property objects must be flattened before being sent across the JS bridge. If you get this warning please inspect for non-flattenable objects being sent to Heap");

Should I open a PR?

defnotsuhas commented 2 years ago

Have the same issue, Commenting for further Updates.

TheRogue76 commented 2 years ago

I added a PR. https://github.com/heap/react-native-heap/pull/335. Don't know what further steps need to be taken for the code to be merged

Edit: I just saw your suggested fix. Pretty much did the same thing

gregbrinker commented 2 years ago

@TheRogue76 what is the "suggested fix" you're referring to?

I just made a patch package with Log.w("RNHeapLibraryModule", ...) and it works fine now. Not sure what all the other changes were in that PR though.

bnickel commented 2 years ago

This has been fixed in #349 and will be released today.