Cordova Hot Code Push Plugin -9 錯誤治療方法 原

iOS Plugins/HCPPlugin.m 文件需要添加一行

- (void)installWwwFolder {
    _isPluginReadyForWork = NO;
    // reset www folder installed flag
    if (_pluginInternalPrefs.isWwwFolderInstalled) {
        _pluginInternalPrefs.wwwFolderInstalled = NO;
        _pluginInternalPrefs.readyForInstallationReleaseVersionName = @"";
        _pluginInternalPrefs.previousReleaseVersionName = @"";
        HCPApplicationConfig *config = [HCPApplicationConfig configFromBundle:[HCPFilesStructure defaultConfigFileName]];
        _pluginInternalPrefs.currentReleaseVersionName = config.contentConfig.releaseVersion;
        
        [_pluginInternalPrefs saveToUserDefaults];
        
        //治療 LOCAL_VERSION_OF_APPLICATION_CONFIG_NOT_FOUND -9 錯誤
        _filesStructure = [[HCPFilesStructure alloc] initWithReleaseVersion:_pluginInternalPrefs.currentReleaseVersionName];
    }
    
    [HCPAssetsFolderHelper installWwwFolderToExternalStorageFolder:_filesStructure.wwwFolder];
}

Android HotCodePushPlugin.java 需要添加一行

    /**
     * Install assets folder onto the external storage
     */
    private void installWwwFolder() {
        isPluginReadyForWork = false;

        // reset www folder installed flag
        if (pluginInternalPrefs.isWwwFolderInstalled()) {
            pluginInternalPrefs.setWwwFolderInstalled(false);
            pluginInternalPrefs.setReadyForInstallationReleaseVersionName("");
            pluginInternalPrefs.setPreviousReleaseVersionName("");

            final ApplicationConfig appConfig = ApplicationConfig.configFromAssets(cordova.getActivity(), PluginFilesStructure.CONFIG_FILE_NAME);
            pluginInternalPrefs.setCurrentReleaseVersionName(appConfig.getContentConfig().getReleaseVersion());

            pluginInternalPrefsStorage.storeInPreference(pluginInternalPrefs);

            //治療 LOCAL_VERSION_OF_APPLICATION_CONFIG_NOT_FOUND -9 錯誤
            fileStructure.switchToRelease(pluginInternalPrefs.getCurrentReleaseVersionName());
        }

        AssetsHelper.copyAssetDirectoryToAppDirectory(cordova.getActivity().getApplicationContext(), WWW_FOLDER, fileStructure.getWwwFolder());
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章