【问题标题】:Red Screen Error from Debug Build appear in Release Build来自 Debug Build 的红屏错误出现在 Release Build 中
【发布时间】:2019-04-22 17:54:25
【问题描述】:

我正在使用./gradlew assembleRelease 构建我的应用程序的发布版本。获取 api 时,如果发生网络请求失败,则只会在以前的应用程序的发布版本中出现警告消息Connection error....etc。在调试版本中,会出现红屏错误和警告消息。现在在发布版本中,也会显示红屏错误。

export function GetUserDetail(){
  return function(dispatch, getState) {
    return AsyncStorage.getItem('loginState')
      .then((result) => {
        if (result!==null){
          var json=JSON.parse(result);
         fetch(////domainurl/////, {
            method: 'POST',
            headers: {
              'Accept': 'application/json',
              'Content-Type': 'application/json',
              'Authorization' : json.token,
            },
            body: JSON.stringify({
              "params": {
              }
            })
          }).then(e => e.json())
          .then(function(response){
            console.log(response);
            dispatch(getuserdetail(response.result));
          }).catch((error) => {
            ToastAndroid.show('Connection Error, Please check if you have internet connnection', ToastAndroid.SHORT);
            console.error(error,"ERRRRRORRR");
          });
        }
        else{

        }
      })
    }
}

预期:发布版本 - 出现警告消息

实际:发布构建 - 出现警告消息和红屏错误

【问题讨论】:

    标签: react-native


    【解决方案1】:

    问题已解决,显然 public boolean getUseDeveloperSupport() 返回 true 而不是返回 BuildConfig.Debug。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多