我使用的是react 17和react原生的0.68.2和反应-本机批,而不是在android上构建的。我已经完成了安卓和iOS部件的所有设置(编辑所有build.gradle等)。我还没有实现这个图书馆的任何东西。这给了我一个错误,而构建在新的安装。
它给了我这个错误:
/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)如果有人已经面对过这个问题。
发布于 2022-07-26 15:23:37
我在阿诺-罗兰:https://github.com/bamlab/react-native-batch-push/issues/83的帮助下设法解决了这个问题。
在build.gradle中,您需要升级batchSdkVersion的版本
ext {
batchSdkVersion = '1.19+'
}https://stackoverflow.com/questions/73125071
复制相似问题