zoukankan      html  css  js  c++  java
  • @react-native-community/async-storage在Android上的手动link问题

    PS C:UserslinjinDesktopRN_APP> react-native link @react-native-community/async-storage
    error Something went wrong while linking. Error: Expected "/* Begin ", "/* End ", """, or [A-Za-z0-9_.] but "<" found.
    Please file an issue here: https://github.com/react-native-community/react-native-cli/issues
    error Expected "/* Begin ", "/* End ", """, or [A-Za-z0-9_.] but "<" found.
    

    解决方案

    1.在项目结构android/settings.gradle中添加如下代码:
    rootProject.name = 'MyApp'
    
    include ':app'
    
    + include ':@react-native-community_async-storage'
    + project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
    
    2.在项目结构android/app/build.gradle添加如下dependencies:
    dependencies {
      ...
    + implementation project(':@react-native-community_async-storage')
    }
    
    3.在MainApplication.java添加如下代码:
    package com.myapp;
    
    + import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
    
    ...
    
    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
    +       new AsyncStoragePackage()    
        );
    }
    
  • 相关阅读:
    漫谈架构读书笔记
    软件架构怎样进行架构
    大型网站技术架构阅读笔记6
    beta里程碑总结
    团队总结
    用户体验
    小强大扫荡
    团队测试计划
    团队第二次冲刺第十天
    团队第二次冲刺第九天
  • 原文地址:https://www.cnblogs.com/fe-linjin/p/10636552.html
Copyright © 2011-2022 走看看