wowmaking / react-native-iron-source

Iron Source SDK React Native bridge
30 stars 37 forks source link

support android X build #44

Closed hoavo closed 4 years ago

hoavo commented 5 years ago

Fix for the issue below when build on React Native >60:

Screen Shot 2019-10-14 at 4 47 22 PM

> Task :@wowmaking_react-native-iron-source:compileReleaseJavaWithJavac FAILED
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceRewardedVideoModule.java:6: error: package an
droid.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceInterstitialsModule.java:6: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceBannerModule.java:4: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceOfferwallModule.java:6: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceRewardedVideoModule.java:136: error: cannot find symbol
    private void sendEvent(String eventName, @Nullable WritableMap params) {
                                              ^
  symbol:   class Nullable
  location: class RNIronSourceRewardedVideoModule
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceInterstitialsModule.java:95: error: cannot find symbol
    private void sendEvent(String eventName, @Nullable WritableMap params) {
                                              ^
  symbol:   class Nullable
  location: class RNIronSourceInterstitialsModule
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceBannerModule.java:266: error: cannot find symbol
    private void sendEvent(String eventName, @Nullable WritableMap params) {
                                              ^
  symbol:   class Nullable
  location: class RNIronSourceBannerModule
/Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceOfferwallModule.java:133: error: cannot find symbol
    private void sendEvent(String eventName, @Nullable WritableMap params) {
                                              ^
  symbol:   class Nullable
  location: class RNIronSourceOfferwallModule
Note: /Volumes/Data/Projects/Trivia-app/node_modules/@wowmaking/react-native-iron-source/android/src/main/java/co/squaretwo/ironsource/RNIronSourceBannerModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors
StanislavMayorov commented 5 years ago

Hi. Thank you for contribution.

Does it break RN 59 compatibility? Did you try to use this tool https://github.com/mikehardy/jetifier ?

fearmear commented 5 years ago

Unfortunately we have to stay compatible with RN <= 59 that is why we're still relying on Jetifier.

fearmear commented 4 years ago

Since jetifier has a reverse mode it's safe to merge this. For anyone using RN < 0.60 you can add npx jetifier -r to your npm postintall script to make newer version compatible with your project.