react-native-batch-push
react-native-batch-push copied to clipboard
[android] not building on fresh install
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)
Hi, You need to upgrade the version of the Batch native sdk used by the plugin :
ext {
batchSdkVersion = '1.19+'
}
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);
}
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.
Nevermind I just forgot the import...