1

我正在用 Facebook 的 buck 构建系统编译 android 项目。但得到以下错误。

如果出现错误,我可以得出结论,它正在尝试查找平台 android-9,但 ndk 目录的平台从 android-14 开始。

我已经搜索但没有找到任何关于更改 ndk 平台的内容。

我得到的例外。

2018-02-26 08:44:49.659][error][command:null][tid:73][com.facebook.buck.cli.Main] Uncaught exception at top level
com.google.common.util.concurrent.ExecutionError: java.lang.AssertionError: /Users/user/android-ndk-r16b/platforms/android-9/arch-arm doesn't exist.
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2216)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146)
    at com.facebook.buck.rules.AbstractKnownBuildRuleTypesProvider.get(AbstractKnownBuildRuleTypesProvider.java:67)
    at com.facebook.buck.rules.KnownBuildRuleTypesProvider.get(KnownBuildRuleTypesProvider.java:15)
    at com.facebook.buck.parser.PerBuildState.getTargetNodeJob(PerBuildState.java:165)
    at com.facebook.buck.parser.Parser.resolveTargetSpecs(Parser.java:497)
    at com.facebook.buck.parser.Parser.buildTargetGraphForTargetNodeSpecs(Parser.java:395)
    at com.facebook.buck.cli.BuildCommand.createUnversionedTargetGraph(BuildCommand.java:958)
    at com.facebook.buck.cli.BuildCommand.createGraphs(BuildCommand.java:419)
    at com.facebook.buck.cli.BuildCommand.executeBuildAndProcessResult(BuildCommand.java:507)
    at com.facebook.buck.cli.BuildCommand.run(BuildCommand.java:391)
    at com.facebook.buck.cli.BuildCommand.runWithoutHelp(BuildCommand.java:358)
    at com.facebook.buck.cli.AbstractCommand.run(AbstractCommand.java:232)
    at com.facebook.buck.cli.AbstractContainerCommand.run(AbstractContainerCommand.java:79)
    at com.facebook.buck.cli.BuckCommand.run(BuckCommand.java:82)
    at com.facebook.buck.cli.Main.runMainWithExitCode(Main.java:1101)
    at com.facebook.buck.cli.Main.runMainThenExit(Main.java:395)
    at com.facebook.buck.cli.Main.nailMain(Main.java:1855)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.martiansoftware.nailgun.NGSession.run(NGSession.java:329)
Caused by: java.lang.AssertionError: /Users/user/android-ndk-r16b/platforms/android-9/arch-arm doesn't exist.
    at com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:72)
    at com.facebook.buck.android.NdkCxxPlatforms$NdkCxxToolchainPaths.processPathPattern(NdkCxxPlatforms.java:956)
    at com.facebook.buck.android.NdkCxxPlatforms$NdkCxxToolchainPaths.processPathPattern(NdkCxxPlatforms.java:969)
    at com.facebook.buck.android.NdkCxxPlatforms$NdkCxxToolchainPaths.getSysroot(NdkCxxPlatforms.java:989)
    at com.facebook.buck.android.NdkCxxPlatforms.getCommonIncludes(NdkCxxPlatforms.java:750)
    at com.facebook.buck.android.NdkCxxPlatforms.getCPreprocessorFlags(NdkCxxPlatforms.java:778)
    at com.facebook.buck.android.NdkCxxPlatforms.build(NdkCxxPlatforms.java:484)
    at com.facebook.buck.android.NdkCxxPlatforms.getPlatforms(NdkCxxPlatforms.java:291)
    at com.facebook.buck.android.NdkCxxPlatforms.getPlatforms(NdkCxxPlatforms.java:256)
    at com.facebook.buck.android.NdkCxxPlatforms.getPlatforms(NdkCxxPlatforms.java:233)
    at com.facebook.buck.android.toolchain.impl.NdkCxxPlatformsProviderFactory.create(NdkCxxPlatformsProviderFactory.java:51)
    at com.facebook.buck.rules.AbstractKnownBuildRuleTypes.createInstance(AbstractKnownBuildRuleTypes.java:270)
    at com.facebook.buck.rules.AbstractDefaultKnownBuildRuleTypesFactory.create(AbstractDefaultKnownBuildRuleTypesFactory.java:47)
    at com.facebook.buck.rules.DefaultKnownBuildRuleTypesFactory.create(DefaultKnownBuildRuleTypesFactory.java:19)
    at com.facebook.buck.rules.AbstractKnownBuildRuleTypesProvider$1.load(AbstractKnownBuildRuleTypesProvider.java:46)
    at com.facebook.buck.rules.AbstractKnownBuildRuleTypesProvider$1.load(AbstractKnownBuildRuleTypesProvider.java:42)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
    ... 25 more
4

1 回答 1

0

NDK r16 也需要其他配置更改。你可以试试这个修复

于 2018-02-26T06:12:42.987 回答