Gustash / react-native-giphy-keyboard

React Native implementation of the Giphy SDK for iOS and Android
12 stars 9 forks source link

Android build issues ( maven migration ) #13

Closed raienko closed 3 years ago

raienko commented 3 years ago

@Gustash , @filipef101 Hi guys, faced following issues during android build:

../node_modules/react-native-giphy-keyboard/android/src/main/java/com/reactnativegiphykeyboard/GiphyModule.kt: (7, 22): Unresolved reference: core
../node_modules/react-native-giphy-keyboard/android/src/main/java/com/reactnativegiphykeyboard/GiphyModule.kt: (8, 22): Unresolved reference: core
../node_modules/react-native-giphy-keyboard/android/src/main/java/com/reactnativegiphykeyboard/GiphyModule.kt: (74, 28): Cannot access class 'com.giphy.sdk.core.models.enums.RatingType'. Check your module classpath for missing or conflicting dependencies
../node_modules/react-native-giphy-keyboard/android/src/main/java/com/reactnativegiphykeyboard/GiphyModule.kt: (74, 28): Cannot access class 'com.giphy.sdk.core.models.enums.RenditionType'. Check your module classpath for missing or conflicting dependencies
../node_modules/react-native-giphy-keyboard/android/src/main/java/com/reactnativegiphykeyboard/GiphyModule.kt: (110, 9): Object is not abstract and does not implement abstract member public abstract fun onGifSelected(media: Media): Unit defined in com.giphy.sdk.ui.views.GiphyDialogFragment.GifSelectionListener
../node_modules/react-native-giphy-keyboard/android/src/main/java/com/reactnativegiphykeyboard/GiphyModule.kt: (112, 9): 'onGifSelected' overrides nothing
../node_modules/react-native-giphy-keyboard/android/src/main/java/com/reactnativegiphykeyboard/GiphyModule.kt: (112, 43): Unresolved reference: Media

Seems like giphy-android-sdk moved from http://giphy.bintray.com/giphy-sdk to maven central ( https://bintray.com announced deprecation )

Please check this commit: https://github.com/Giphy/giphy-android-sdk/commit/7a880993798f6f221f90569822121efa41877197

Environment:

"react-native": "0.63.4" "react-native-giphy-keyboard": "2.0.0" Platform: Android ( both debug and release )

iwantadventureinthegreatwidesomewhere commented 3 years ago

@raienko Same issue for me on Android. Removed the maven { url 'http://giphy.bintray.com/giphy-sdk' } from build.gradle and replaced it with mavenCentral() but had build issues with some of the imports in the module.

filipef101 commented 3 years ago

doesnt work changing to mavenCentral()?

iwantadventureinthegreatwidesomewhere commented 3 years ago

doesnt work changing to mavenCentral()?

I couldn’t get it to work. After I made the changes I still got the same issues as @raienko when building on Android. Were you able to make it work?

iwantadventureinthegreatwidesomewhere commented 3 years ago

In the module's build.gradle file, I added implementation 'com.giphy.sdk:core:3.1.6' below the implementation for com.giphy.sdk:ui:1.1.2 and now it builds. But the app crashes upon startup. The errors were related to core missing so I tried using com.giphy.sdk:core.

raienko commented 3 years ago
  1. moved to mavenCentral() instead of maven { url 'http://giphy.bintray.com/giphy-sdk' }
  2. added implementation 'com.giphy.sdk:core:version' ( tried several versions 3.1.6, 1.0.3, etc )

These steps resolve build issues, but app crashes right on launch ( same issue as @iwantadventureinthegreatwidesomewhere faced ).

raienko commented 3 years ago

From logcat:

E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    Process: com.xxx.xxx, PID: 14733
    java.lang.AbstractMethodError: abstract method "boolean 
com.facebook.soloader.nativeloader.NativeLoaderDelegate.loadLibrary(java.lang.String, int)"
        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:51)
        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:30)
        at com.facebook.jni.HybridData.<clinit>(HybridData.java:34)
        at com.facebook.hermes.reactexecutor.HermesExecutor.initHybridDefaultConfig(Native Method)
        at com.facebook.hermes.reactexecutor.HermesExecutor.<init>(HermesExecutor.java:33)
        at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1017)
        at java.lang.Thread.run(Thread.java:919)

2021-04-26 12:27:18.052 14733-15774/com.xxx.xxx E/GraphResponse: {
  HttpStatus: 400,
  errorCode: 100,
  subErrorCode: 33,
  errorType: GraphMethodException,
  errorMessage: Unsupported get request. Object with ID '715712572117658' does not exist,
  cannot be loaded due to missing permissions, or does not support this operation.
  Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
}
raienko commented 3 years ago

@filipef101 could you, please, share your last working ui/core libs versions combination? Which com.giphy.sdk:core version was suitable for com.giphy.sdk:ui:1.1.2 ?

OlegPanfyorov commented 3 years ago

We've faced the same issue! Can someone help? Our release is blocked :( @filipef101

filipef101 commented 3 years ago

I am no longer working with any project that uses this library. CC: @reyalpsirc

reyalpsirc commented 3 years ago

We also faced problems with this and in the end we removed the library for Android from the project

iwantadventureinthegreatwidesomewhere commented 3 years ago

@reyalpsirc What did you use instead? I can make my own version using just the GIPHY API and building the component myself, but it likely won't be as good as the packages dedicated to this.

reyalpsirc commented 3 years ago

@iwantadventureinthegreatwidesomewhere We are not using giphy for now on Android. We just postponed that for later since we had other issues in our hands for now

JulianKingman commented 3 years ago

Try mavenCentral() with implementation 'com.giphy.sdk:ui:2.0.9'

filipef101 commented 3 years ago

https://github.com/Gustash/react-native-giphy-keyboard/pull/16

Gustash commented 3 years ago

This package has now been deprecated in favor of the official @giphy/react-native-sdk library.