小编Nic*_*der的帖子

Tl.xcodeproj 链接的框架 'Pods_Tl.framework' 缺少此目标所需的一个或多个架构:armv7

我刚刚从 AppStore 更新到 Xcode 12.0.1,打开了我的旧项目,构建后出现错误。

这是错误的图像:
在此处输入图片说明

当我研究 SO 以寻求解决方案时,一些回答提到了在构建设置中更改架构和仅更改构建活动架构设置。所以我做了,但这没有帮助。

这是构建设置架构部分的图片:
在此处输入图片说明

在此处输入图片说明

正如我提到的,我遇到了同样的问题,但他们没有帮助我上传了我使用的解决方案的屏幕截图。

xcode ios cocoapods xcode-build-settings xcode12

18
推荐指数
2
解决办法
6725
查看次数

Rollup typescript 装饰器支持

我收到以下错误消息:

错误:解析错误:第 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)

rollup decorator typescript

6
推荐指数
1
解决办法
2274
查看次数

如何在 swift 中使用 avplayer 播放来自 ipfs url 的视频

我有一个 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)

ios avplayer swift ipfs moralis

5
推荐指数
1
解决办法
889
查看次数

如何在计时器触发后正确调用函数进行单元测试。角度 7、RXJS 6

在我的 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)

jasmine rxjs angular

3
推荐指数
1
解决办法
5188
查看次数

将 Angular 6 升级到 8 时,我得到了不兼容的对等依赖(使用 ng update @angular/core)

我正在使用此命令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)

发现不兼容的对等依赖项。看上面。

angular6 angular8

3
推荐指数
1
解决办法
2741
查看次数

在我更新到 MacOs Catalina MAMP 后停止工作

我的桌面上有一个名为 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)

mamp macos-catalina

3
推荐指数
1
解决办法
7121
查看次数

用于 IOS 刷新控制 React Native 的 ProgressViewOffset

我有一个隐藏在滚动条上的标题,所以我用来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 和内容之间有一个空格...

scrollview ios react-native react-native-flatlist

2
推荐指数
1
解决办法
1951
查看次数

PDFInfoNotInstalledError:无法获取页数。poppler 是否已安装并在 PATH 中?

实际上,我试图将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)

python-3.x

2
推荐指数
1
解决办法
8049
查看次数