zoukankan      html  css  js  c++  java
  • RN与android原生开发混合后的环境报错问题

    RN与android原生开发混合后的环境报错问题

    需要先安装nodejs
    $ yarn --version
    1.12.1
    更新当前版本
    yarn upgrade --latest
    安装 | Yarn
    https://yarnpkg.com/lang/zh-hans/docs/install/#windows-stable
    ================
    到对应目录下用git bash here执行:
    yarn
    ================
    yarn start
    npm install
    ================
    rn混合后编译卡的问题,到D:exchangespace目录下,cmd执行下面命令打包到D:exchangespaceandroidappsrcmainassets里面直接使用,只有rn的代码更新了才需要重新打包
    react-native bundle --platform android --dev false --entry-file index.js --bundle-output androidappsrcmainassetsindex.android.bundle --assets-dest androidappsrcmain es
    =================

    有时候构建Android studio项目,会莫名出现
    error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
    Error:resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found的问题,并且还会引起一系列其他的问题。
    修改方法:
    将compileSdkVersion修改成25,并将对应的buildToolsVersion修改成25.0.2

    =================
    Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
    It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

    Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
    It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

    Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
    It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.facebook.react:react-native:+'
    }
    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.facebook.react:react-native:+'
    }
    ------------
    compile --> implementation
    testCompile --> testImplementation
    testApi --> testImplementation
    provided --> compileOnly
    ======================
    不同严重程度可以按以下三种处理:
    1.切换到project视图,删除.grade .idea 文件夹,clean project,
    2.关闭android,重新打开编译
    3.彻底清除缓存 File -> Invalidate Caches / Restart... (会清理掉本地修改的Gradle配置)
    ======================
    Quit emulator
    Quit Android Studio
    Reopen Android Studio
    Build > Clean Project
    Run/debug your app onto your device/emulator again
    ======================

  • 相关阅读:
    CMD与bat操作
    XmlHelper XML通用类
    Regex正则表达式扩展
    LONG数据类型转换为VARCHAR2并相互转换
    CLOB数据类型截取SUBSTR_按开始位置偏移量
    12c rac On redhat 7
    DML_DDL_触发器
    Linux平台 Oracle 18c RAC安装
    hadoop 透明加密
    Poco::Crypto--加解密_RSA
  • 原文地址:https://www.cnblogs.com/zdz8207/p/android-RN-devlop.html
Copyright © 2011-2022 走看看