美文网首页
React Native Mac 上调试android实况直播

React Native Mac 上调试android实况直播

作者: glenlg | 来源:发表于2019-04-28 16:40 被阅读0次

    Building and installing the app on the device (cd android && ./gradlew installDebug)...
    Could not install the app on the device, read the error above for details.
    Make sure you have an Android emulator running or a device connected and have
    set up your Android development environment:

    未发现错误的详细信息
    google查询说要把gradlew权限修改,然而还是不成功.
    思考:命令执行到./gradlew installDebug就没了.那单独执行下看看.
    发现错误!!!:-bash: ./android/gradlew: /usr/bin/env: bad interpreter: Operation not permitted

    最后解决方法:
    Try:

    xattr -l ./gradlew
    and

    xattr -d com.apple.quarantine ./gradlew

    unable to load script from assets 'index.android bundle'.

    查到旧的解决方法已经不能成功了,没其它提示,只能终极解决了.

    删除所有打包文件,重新运行成功!

    3.Module HMRClient is not a registerd callable module

    打开hot reload后加载报错.
    android Q 新版本不支持后台运行.

    4.transparent (指定背景颜色应该是透明的。这是默认)

    5.android Q字体大小不自动变换.
    系统设置调整大小

    6.ios下表现正常,android打开hot reload 报错,联接不上服务器.修改代码后reload也不生效.

    无赖,重新init项目,copy代码.运行解决.

    7.WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.

    /node_modules/react-native/react.gradle
    修改为:https://github.com/facebook/react-native/blob/master/react.gradle

    8.rnpm-install ERR! ERRPACKAGEJSON No package found. Are you sure this is a React Native project?

    Package name not found in /Users/betadmin/BettingForFootball/android/app/src/debug/AndroidManifest.xml

    Error: Package name not found in /Users/betadmin/BettingForFootball/android/app/src/debug/AndroidManifest.xml

    at Object.projectConfigAndroid [as projectConfig] (/Users/betadmin/BettingForFootball/node_modules/react-native/local-cli/core/android/index.js:46:11)
    
    at Object.keys.forEach.key (/Users/betadmin/BettingForFootball/node_modules/react-native/local-cli/core/index.js:101:36)
    
    at Array.forEach (<anonymous>)
    
    at Object.getProjectConfig (/Users/betadmin/BettingForFootball/node_modules/react-native/local-cli/core/index.js:100:28)
    
    at Object.link [as func] (/Users/betadmin/BettingForFootball/node_modules/react-native/local-cli/link/link.js:121:22)
    
    at Promise.resolve.then (/Users/betadmin/BettingForFootball/node_modules/react-native/local-cli/cliEntry.js:117:22)
    

    在AndroidManifest.xml中加入package="com.<小写包名>"后,link正常
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.bettingforfootball">

    9.终端查看日志:
    adb logcat *:S ReactNative:V ReactNativeJS:V

    10.UnhandledPromiseRejectionWarning: Error: spawnSync /Users/betadmin/testing/football/node_modules/react-native/local-cli/setup_env.sh EACCES

    chmod -R 777 node_modules

    11.Failed to read key my-key-alias from store "/Users/betadmin/sportball/android/app/my-release-key.keystore": keystore password was incorrect

    在android/build.gradle修改gradle版本时,未修改gradleVersion = '4.10.2'
    用android studio打包成功

    相关文章

      网友评论

          本文标题:React Native Mac 上调试android实况直播

          本文链接:https://www.haomeiwen.com/subject/gakjnqtx.html