我刚刚从 AppStore 更新到 Xcode 12.0.1,打开了我的旧项目,构建后出现错误。
当我研究 SO 以寻求解决方案时,一些回答提到了在构建设置中更改架构和仅更改构建活动架构设置。所以我做了,但这没有帮助。
正如我提到的,我遇到了同样的问题,但他们没有帮助我上传了我使用的解决方案的屏幕截图。
我收到以下错误消息:
错误:解析错误:第 29 行:意外的标记非法
对应的代码行是mobx观察者装饰器:
@observer
class Wrapper extends Component<IProps> {
Run Code Online (Sandbox Code Playgroud)
我有以下 rollup.config.js:
import typescript from 'rollup-plugin-typescript2'
import jsx from 'rollup-plugin-jsx'
import pkg from './package.json'
export default {
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
},
{
file: pkg.module,
format: 'es',
},
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
plugins: [
jsx( {factory: 'React.createElement'} ),
typescript({
typescript: require('typescript'),
}),
],
}
Run Code Online (Sandbox Code Playgroud)
我的 tsconfig.json:
{
"compilerOptions": {
"declaration": true,
"declarationDir": "./dist",
"module": "es6",
"experimentalDecorators": true,
"outDir": …Run Code Online (Sandbox Code Playgroud) 我有一个 ipfs 加密的视频 URL。
我无法在 avplayer 中播放视频,但 URL 在 webview 中播放良好。
这是网址: https: //ipfs.moralis.io:2053 /ipfs/QmUjWnQZVVNmTSVak2QDhTxMkn3dPQozxawa1sm3jE5bLr
let currentURL = URL(string: "https://ipfs.moralis.io:2053/ipfs/QmUjWnQZVVNmTSVak2QDhTxMkn3dPQozxawa1sm3jE5bLr")!
let playerItem = AVPlayerItem(url: currentURL)
playerItem.addObserver(self, forKeyPath: "status", options: NSKeyValueObservingOptions(), context: nil)
player = AVPlayer(playerItem: playerItem)let playerLayer = AVPlayerLayer(player: player)
playerLayer.frame = self.avplayerUIView.bounds
self.avplayerUIView.layer.addSublayer(playerLayer)
player.play()
Run Code Online (Sandbox Code Playgroud)
另外,我已将 AVUrlAssets 与视频扩展和视频编解码器一起使用,但视频仍然无法播放
let mimeType = "video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\""
let asset: AVURLAsset = AVURLAsset(url: videoURL!, options: ["AVURLAssetOutOfBandMIMETypeKey" : mimeType])
Run Code Online (Sandbox Code Playgroud) 在我的 Angular 7 应用程序中,我有一个用于跟踪活动用户任务的服务。在该服务中,计时器每秒运行一次,以检查是否有任何任务在 30 秒内仍未完成。如果发现任何任务已过期,则该任务将通过服务上的事件发射器发出,以便在其他地方处理。当应用程序在浏览器中运行时,这一切都有效,但是当我尝试编写单元测试来测试 fakeAsync 环境中的行为时,tick(X)不会提前时间(或者 fakeAsync 不会模拟任何“new Date()”的时间' 在服务中创建以tick()正常工作)。
由于我是角度单元测试的新手,我也承认问题可能是我如何设置测试(事实上,我怀疑这就是问题所在)。
我发现许多关于旧版本 Angular 的帖子都存在 Date 未正确模拟的问题,因此建议的解决方法是使用 asyncScheduler 绕过勾选或导入其他 npm 包,或者,我什至尝试了来自区。我已经尝试过这些但没有成功。我还通过运行下面的简单测试来测试fakeAsync()和tick()功能,该测试通过了:@angular/core/testing
it('should tick', fakeAsync(() => {
const firstDate = new Date();
tick(30000);
const secondDate = new Date();
expect(secondDate.getTime() - firstDate.getTime()).toBe(30000);
}));
Run Code Online (Sandbox Code Playgroud)
这是该服务的简化版本:
export class UserTaskTrackerService {
TaskExpired = new EventEmitter<UserTask>
private activeUserTasks: UserTask[] = []
private oneSecondTimer;
private timerSubscription$;
constructor() {
this.oneSecondTimer = timer(1000, 1000);
this.timerSubscription$ = this.oneSecondTimer.subscribe(() …Run Code Online (Sandbox Code Playgroud) 我正在使用此命令ng update @angular/cli @angular/corefor将角度版本从 6 更新到 8,但它显示了以下问题。
Package "@nguniversal/module-map-ngfactory-loader" has an incompatible peer dependency to "@angular/core" (requires ">=7.0.0-rc.0 <8.0.0||>=6.0.0-rc.0 <7.0.0", would install "8.2.5").
Package "@nguniversal/module-map-ngfactory-loader" has an incompatible peer dependency to "@angular/common" (requires ">=7.0.0-rc.0 <8.0.0||>=6.0.0-rc.0 <7.0.0", would install "8.2.5").
Package "@nguniversal/module-map-ngfactory-loader" has an incompatible peer dependency to "@angular/platform-server" (requires ">=7.0.0-rc.0 <8.0.0||>=6.0.0-rc.0 <7.0.0", would install "8.2.5").
Run Code Online (Sandbox Code Playgroud)
发现不兼容的对等依赖项。看上面。
我的桌面上有一个名为 work 的文件夹,用于保存我所有的 php 项目。我使用 MAMP 并且所有项目都设置为在虚拟主机上工作,例如,如果我有一个名为 test 的项目,我可以通过这个 URL http://test.dev访问这个项目。
一切正常,直到我开始出现此错误时更新到macOS Catalina。
(1) 不允许的操作:无法打开索引目录:
/Users/username/Desktop/work/php/development/projectname。
我为我的用户和员工组设置了工作文件夹和所有子文件夹的读写权限,我尝试了所有终端权限
commands: chmod 777, 755, etc.
Run Code Online (Sandbox Code Playgroud) 我有一个隐藏在滚动条上的标题,所以我用来ProgressViewOffset在标题下方显示刷新控制加载器。
它在 Android 上运行良好。但是在 IOS 中我们不支持偏移。但我最终使用了 contentInset 和 contentOffset 但我没有得到它。
refreshControl: (
<RefreshControl
// refreshing
refreshing={this.props.isloading}
onRefresh={this.onRefresh}
progressViewOffset={200}
/>
),
contentInset: {top: 200},
onMomentumScrollBegin,
onMomentumScrollEnd,
onScrollEndDrag,
ItemSeparatorComponent: this.renderSeparator,
onScrollEventThrottle: 16,
automaticallyAdjustContentInsets: false,
contentOffset: {x: 0, y: -200},
Run Code Online (Sandbox Code Playgroud)
PS:当我使用 contentContainerStyle 和 contentInset 时,refreshcontrol 和内容之间有一个空格...
实际上,我试图将pdf文件标记为一个句子,首先我使用pypdf2但面临数据丢失和格式不正确的问题。所以我尝试使用 ocr 但在将 pdf 转换为图像时我面临 poppler 问题谁能帮我解决这个问题
pages = convert_from_path(PDF_file, 600)
Run Code Online (Sandbox Code Playgroud)
FileNotFoundError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\pdf2image\pdf2image.py in _page_count(pdf_path, userpw, poppler_path)
239 env["LD_LIBRARY_PATH"] = poppler_path + ":" + env.get("LD_LIBRARY_PATH", "")
--> 240 proc = Popen(command, env=env, stdout=PIPE, stderr=PIPE)
241
~\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
774 errread, errwrite,
--> 775 restore_signals, start_new_session)
776 except:
~\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, …Run Code Online (Sandbox Code Playgroud) ios ×3
angular ×1
angular6 ×1
angular8 ×1
avplayer ×1
cocoapods ×1
decorator ×1
ipfs ×1
jasmine ×1
mamp ×1
moralis ×1
python-3.x ×1
react-native ×1
rollup ×1
rxjs ×1
scrollview ×1
swift ×1
typescript ×1
xcode ×1
xcode12 ×1