不变违规:requireNativeComponent:未找到“ ISvgImage” 在UIManager中
如何解决此问题?
答案 0 :(得分:0)
我通过以下方式解决了与RNCViewPager相关的类似问题(在UIManager中未找到RNCViewPager):
我在settings.gradle
include ':@react-native-community_viewpager'
project(':@react-native-community_viewpager').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/viewpager/android')
然后我将以下内容添加到app/build.gradle
implementation project(':@react-native-community_viewpager')
然后我用导入更新了Android Application class
import com.reactnativecommunity.viewpager.RNCViewPagerPackage;
,然后将其添加到RN软件包列表中:
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new MapsPackage(),
new Interactable(),
new LocationServicesPackage(),
new AnalyticsPackage(),
new ConfigPackage(),
new BlurViewPackage(),
new RNI18nPackage(),
new NavigationPackage(),
new RemoteConfigPackage(),
new LottiePackage(),
new ReanimatedPackage(),
new GeolocationPackage(),
new NetInfoPackage(),
new RNCViewPagerPackage()
);
}
};
完整的堆栈跟踪和详细信息在这里: