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()    
        );
    }
    
  • 相关阅读:
    IIS 无法下载EXE
    大数据ListView
    vss error reading from file
    fatal error LNK1107
    A Generic Singleton Class
    转 ORACLE 的FOR循环、游标、时间值函数、转换函数题目
    regsvr32.exe 会用
    MSChat 临时目录
    关于LinkedList的三种写法的效率
    旋转门压缩算法
  • 原文地址:https://www.cnblogs.com/fe-linjin/p/10636552.html
Copyright © 2011-2022 走看看