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

Build fails on GitlabCI

Open Sharlaan opened this issue 4 years ago • 3 comments

I am currently upgrading Batch to latest (7.0.3) for Android, from an old v5. "react-native": "0.66.4"

I followed the migration steps and managed to produce a build for v6.0.0.

I then continued the migration until latest (v7.0.3) since apparently no breaking change between v6 to 7, but then i does not compile, producing 2 errors :

> Task :bam.tech_react-native-batch:compileReleaseJavaWithJavac
/builds/applications/CovoiticiMobile/node_modules/@bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNUtils.java:113: error: no suitable method found for put(java.lang.String,java.net.URI)

                batchEventData.put(key, URI.create(valueMap.getString("value")));
                              ^
    method com.batch.android.BatchEventData.put(java.lang.String,java.lang.String) is not applicable
      (argument mismatch; java.net.URI cannot be converted to java.lang.String)
    method com.batch.android.BatchEventData.put(java.lang.String,float) is not applicable
      (argument mismatch; java.net.URI cannot be converted to float)
    method com.batch.android.BatchEventData.put(java.lang.String,double) is not applicable
      (argument mismatch; java.net.URI cannot be converted to double)
    method com.batch.android.BatchEventData.put(java.lang.String,int) is not applicable
      (argument mismatch; java.net.URI cannot be converted to int)
    method com.batch.android.BatchEventData.put(java.lang.String,long) is not applicable
      (argument mismatch; java.net.URI cannot be converted to long)
    method com.batch.android.BatchEventData.put(java.lang.String,boolean) is not applicable
      (argument mismatch; java.net.URI cannot be converted to boolean)
    method com.batch.android.BatchEventData.put(java.lang.String,java.util.Date) is not applicable
      (argument mismatch; java.net.URI cannot be converted to java.util.Date)
/builds/applications/CovoiticiMobile/node_modules/@bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNBatchModule.java:529: error: no suitable method found for setAttribute(java.lang.String,java.net.URI)

                editor.setAttribute(key, URI.create(url));
                      ^
    method com.batch.android.BatchUserDataEditor.setAttribute(java.lang.String,long) is not applicable
      (argument mismatch; java.net.URI cannot be converted to long)
    method com.batch.android.BatchUserDataEditor.setAttribute(java.lang.String,double) is not applicable
      (argument mismatch; java.net.URI cannot be converted to double)
    method com.batch.android.BatchUserDataEditor.setAttribute(java.lang.String,boolean) is not applicable
      (argument mismatch; java.net.URI cannot be converted to boolean)
    method com.batch.android.BatchUserDataEditor.setAttribute(java.lang.String,java.util.Date) is not applicable
      (argument mismatch; java.net.URI cannot be converted to java.util.Date)
    method com.batch.android.BatchUserDataEditor.setAttribute(java.lang.String,java.lang.String) is not applicable
      (argument mismatch; java.net.URI cannot be converted to java.lang.String)
Note: /builds/applications/CovoiticiMobile/node_modules/@bam.tech/react-native-batch/android/src/main/java/tech/bam/RNBatchPush/RNBatchModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
> Task :bam.tech_react-native-batch:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bam.tech_react-native-batch:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org/
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5m 1s
415 actionable tasks: 415 executed

I don't see how to solve this issue ?

Sharlaan avatar May 04 '22 08:05 Sharlaan

Hi,

You need to update the native dependency to 1.18 or higher

abarisain avatar May 04 '22 08:05 abarisain

Thanks for the very fast answer ! Indeed it is still @ batchSdkVersion = '1.17+' Trying with 1.19+ ... EDIT: it compiled ! thanks !

Sharlaan avatar May 04 '22 08:05 Sharlaan

I can confirm that after setting batchSdkVersion = '1.19+' on my build.gradle file my Android project stopped crashing and started building!

I'm working with React Native v0.68.2 and Batch v7.0.3

samcampisi avatar May 17 '22 13:05 samcampisi