有谁知道如何使用 Meteor JS 构建 x64 apk 文件?
Has anyone know how to build x64 apk file with Meteor JS?
我尝试使用此 link 中的 gradle 方法构建 x64 位 apk 文件,但我只构建了 armv7 和 x86。
我试图分析我构建的每个 apk,none 它们显示了任何 x64 版本的提示。以下是我的应用程序的 gradle、
android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
defaultConfig {
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
}
lintOptions {
abortOnError false;
}
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
if (Boolean.valueOf(cdvBuildMultipleApks)) {
flavorDimensions "default"
productFlavors {
armv7 {
versionCode defaultConfig.versionCode*10 + 2
ndk {
abiFilters "armeabi-v7a", ""
}
}
x86 {
versionCode defaultConfig.versionCode*10 + 4
ndk {
abiFilters "x86", ""
}
}
arm64 {
versionCode defaultConfig.versionCode*10 + 6
ndk {
abiFilters "arm64-v8a", ""
}
}
x86_64 {
versionCode defaultConfig.versionCode*10 + 9
ndk {
abiFilters "x86_64", ""
}
}
all {
ndk {
abiFilters "all", ""
}
}
}
}
我也确实遵循了这个 中接受的答案的步骤。我错过了什么吗?我的流星版本是 1.8.1 。请让我知道,如果你们需要任何其他相关信息,因为我是这个平台的新手。 Tq
我终于自己找到了答案。
弄清楚,使用人行横道进行构建时会出现问题。我遇到了这个 plugin 并按照它说的去做。
然后,我神奇的得到了x64位的apk版本!这花了我几个小时,但最后还是值得的:)
这是我所做的,
1) 我从插件中获取了一些代码并包含在 root/mobile-config.js 下的 App.appendToConfig 中。以下是示例,
App.appendToConfig(`
<plugin name="phonegap-plugin-push" spec="1.6.0">
<param name="SENDER_ID" value="1044544766362" />
</plugin>
<platform name="android">
<resource-file src="google-services.json" target="google-services.json" />
</platform>
<plugin name="cordova-build-architecture" spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.4" source="git" />
<preference name="xwalk64bit" value="true" />
<preference name="buildArchitecture" value="arm64" />
`);
// the last three tags are what I included
2) 最后,运行 这个在你的 terminal/cmd 根项目下,
meteor build ~/your-directory-build --server=https://any.com
您将在 your-directory-build/android/project/build/outputs/apk/arm64/release 下看到一个 apk 文件。
请记住,该插件仍处于试验阶段。对于那些在同步应用程序 gradle 时遇到错误消息的人说 "ERROR: All flavors must now belong to a named flavor dimension",可以用
解决
干杯!
我尝试使用此 link 中的 gradle 方法构建 x64 位 apk 文件,但我只构建了 armv7 和 x86。
我试图分析我构建的每个 apk,none 它们显示了任何 x64 版本的提示。以下是我的应用程序的 gradle、
android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
defaultConfig {
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
}
lintOptions {
abortOnError false;
}
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
if (Boolean.valueOf(cdvBuildMultipleApks)) {
flavorDimensions "default"
productFlavors {
armv7 {
versionCode defaultConfig.versionCode*10 + 2
ndk {
abiFilters "armeabi-v7a", ""
}
}
x86 {
versionCode defaultConfig.versionCode*10 + 4
ndk {
abiFilters "x86", ""
}
}
arm64 {
versionCode defaultConfig.versionCode*10 + 6
ndk {
abiFilters "arm64-v8a", ""
}
}
x86_64 {
versionCode defaultConfig.versionCode*10 + 9
ndk {
abiFilters "x86_64", ""
}
}
all {
ndk {
abiFilters "all", ""
}
}
}
}
我也确实遵循了这个
我终于自己找到了答案。
弄清楚,使用人行横道进行构建时会出现问题。我遇到了这个 plugin 并按照它说的去做。
然后,我神奇的得到了x64位的apk版本!这花了我几个小时,但最后还是值得的:)
这是我所做的,
1) 我从插件中获取了一些代码并包含在 root/mobile-config.js 下的 App.appendToConfig 中。以下是示例,
App.appendToConfig(`
<plugin name="phonegap-plugin-push" spec="1.6.0">
<param name="SENDER_ID" value="1044544766362" />
</plugin>
<platform name="android">
<resource-file src="google-services.json" target="google-services.json" />
</platform>
<plugin name="cordova-build-architecture" spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.4" source="git" />
<preference name="xwalk64bit" value="true" />
<preference name="buildArchitecture" value="arm64" />
`);
// the last three tags are what I included
2) 最后,运行 这个在你的 terminal/cmd 根项目下,
meteor build ~/your-directory-build --server=https://any.com
您将在 your-directory-build/android/project/build/outputs/apk/arm64/release 下看到一个 apk 文件。
请记住,该插件仍处于试验阶段。对于那些在同步应用程序 gradle 时遇到错误消息的人说 "ERROR: All flavors must now belong to a named flavor dimension",可以用
干杯!