suwu150 2018-07-10 11:28 采纳率: 20%
浏览 4182
已采纳

react-native打包release版本闪退

我在用react-native进行项目打包的时候,我的debug模式在真机中能够运行,在release模式下运行时闪退,我在Android studio中查看logcat的时候,出现下面代码?请问是什么原因导致的?

 07-10 19:05:07.446 12390-12436/? E/ReactNativeJS: undefined is not an object (evaluating 's.View.propTypes.style')
07-10 19:05:07.455 12390-12436/? E/ReactNativeJS: Application Lova has not been registered.

    Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
    If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').

    This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
07-10 19:05:08.012 1003-1271/? E/WifiStateMachine:  ConnectedState (when=-5ms what=131155 arg1=5!CMD_RSSI_POLL 5 0 "11223344" ac:c1:ee:3c:82:dd rssi=-51 f=2412 sc=60 link=65 tx=0.5, 0.0, 0.0  rx=0.3 bcn=0 [on:0 tx:0 rx:0 period:2983] from screen [on:0 period:-2082616660] gl hn u24 rssi=-46 ag=0 hr ticks 0,0,0 ls-=0 [56,56,56,56,61] brc=0 lrc=0
07-10 19:05:08.015 1003-1271/? E/WifiStateMachine:  L2ConnectedState (when=-8ms what=131155 arg1=5!CMD_RSSI_POLL 5 0 "11223344" ac:c1:ee:3c:82:dd rssi=-51 f=2412 sc=60 link=65 tx=0.5, 0.0, 0.0  rx=0.3 bcn=0 [on:0 tx:0 rx:0 period:3] from screen [on:0 period:-2082616657] gl hn u24 rssi=-46 ag=0 hr ticks 0,0,0 ls-=0 [56,56,56,56,61] brc=0 lrc=0
     get link layer stats 0

我的注册文件从如下所示:

 import { AppRegistry } from 'react-native';
import App from './App';

AppRegistry.registerComponent('Lova', () => App);

  • 写回答

1条回答 默认 最新

  • suwu150 博客专家认证 2018-07-17 04:40
    关注

    最后找到原因了,是因为我这篇文章中说明的问题,由于propType的原因,具体请查看https://blog.csdn.net/suwu150/article/details/81079093

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵