react-native-batch-push icon indicating copy to clipboard operation
react-native-batch-push copied to clipboard

[android] not building on fresh install

Open loupmasneri opened this issue 4 years ago • 4 comments

Using:

  • react-native 0.69.1 or 0.68.2
  • react 0.17+

so link: https://stackoverflow.com/q/73125071/12637199

error:

/Users/xxx/xxx/xxx/packages/native-client/node_modules/@bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNUtils.java:113: error: no suitable method found for put(String,URI)
                batchEventData.put(key, URI.create(valueMap.getString("value")));
                              ^
    method BatchEventData.put(String,String) is not applicable
      (argument mismatch; URI cannot be converted to String)
    method BatchEventData.put(String,float) is not applicable
      (argument mismatch; URI cannot be converted to float)
    method BatchEventData.put(String,double) is not applicable
      (argument mismatch; URI cannot be converted to double)
    method BatchEventData.put(String,int) is not applicable
      (argument mismatch; URI cannot be converted to int)
    method BatchEventData.put(String,long) is not applicable
      (argument mismatch; URI cannot be converted to long)
    method BatchEventData.put(String,boolean) is not applicable
      (argument mismatch; URI cannot be converted to boolean)
    method BatchEventData.put(String,Date) is not applicable
      (argument mismatch; URI cannot be converted to Date)
/Users/xxx/xxx/xxx/packages/native-client/node_modules/@bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNBatchModule.java:529: error: no suitable method found for setAttribute(String,URI)
                editor.setAttribute(key, URI.create(url));
                      ^
    method BatchUserDataEditor.setAttribute(String,long) is not applicable
      (argument mismatch; URI cannot be converted to long)
    method BatchUserDataEditor.setAttribute(String,double) is not applicable
      (argument mismatch; URI cannot be converted to double)
    method BatchUserDataEditor.setAttribute(String,boolean) is not applicable
      (argument mismatch; URI cannot be converted to boolean)
    method BatchUserDataEditor.setAttribute(String,Date) is not applicable
      (argument mismatch; URI cannot be converted to Date)
    method BatchUserDataEditor.setAttribute(String,String) is not applicable
      (argument mismatch; URI cannot be converted to String)

loupmasneri avatar Jul 26 '22 14:07 loupmasneri

Hi, You need to upgrade the version of the Batch native sdk used by the plugin :

    ext {
        batchSdkVersion = '1.19+'
    }

arnaud-roland avatar Jul 26 '22 15:07 arnaud-roland

Hi, You need to upgrade the version of the Batch native sdk used by the plugin :

    ext {
        batchSdkVersion = '1.19+'
    }

Thank you! You also need to remove this in MainActivity.java:

public void onNewIntent(Intent intent) {
    Batch.onNewIntent(this, intent);
    super.onNewIntent(intent);
    }

loupmasneri avatar Jul 26 '22 15:07 loupmasneri

This code should not be a problem in your activity. Please do not remove it, else you could encounter some issues with Push and In-App messages.

If you have an error message when this code is added, please let me know.

arnaud-roland avatar Jul 26 '22 15:07 arnaud-roland

Nevermind I just forgot the import...

loupmasneri avatar Jul 26 '22 15:07 loupmasneri