建立结合armv7 / x86 apk后Crosswalk集成在一个Ionic项目 [英] Building combined armv7/x86 apk after Crosswalk integration in an Ionic project
问题描述
我添加了Crosswalk到我的离子项目。当我做 ionic build android
它输出两个单独的APK文件,一个用于armv7和一个用于x86。
我想要一个单一的apk文件捆绑两个架构在一起。
我尝试设置 BUILD_MULTIPLE_APKS = false
,但它仍然在构建两个单独的apks。
有一个帖子这里说:
花了一分钟,但你可以通过注释
来获得单个构建文件cdvBuildMultipleApks =
platforms / android / gradle.properties中的true行
干杯
但是我没有任何gradle.properties文件在我的平台/ android /文件夹,我有一个project.properties文件,没有 cdvBuildMultipleApks = true $ c $
我试图手动创建一个gradle.properties文件并将 cdvBuildMultipleApks = false $ c $
更新:
我的Cordova版本是5.1.1
解决方案:
对@mudasserajaz和这里,用于:
- 创建在
/ platform / android /
目录中名为build-extras.gradle
的文件。 - 在其中放置
ext.cdvBuildMultipleApks = false
。 -
ionic build android --release
然后和Voila,它工作。
@mudasserajaz建议同样的事情,除了变量名称 cdvBuildMultipleApks = false
所以如果它不适合你,不要忘记 ext
这里有步骤:
- code> build-extras.gradle 并将其放入
platforms / android /
。将cdvBuildMultipleApks = false
添加到build-extras.gradle
中。 - 现在运行
ionic run android
,它将创建组合单个构建android-debug.apk
。
build.gradle
将自动导入 build-extras.gradle
,如果已定义。您可以看到 build.gradle
的代码:
def hasBuildExtras = file('build-extras.gradle')。exists()
if(hasBuildExtras){
apply from:'build-extras.gradle'
}
build.gradle
第57行:
配置属性。通过环境变量
build-extras.gradle或gradle.properties设置这些变量。
/ strong>在您按照这些步骤之前,请删除平台文件夹并重新安装。
观察结果:完成这些步骤后,再次在某些时候, ,然后设置 cdvBuildMultipleApks = true
或注释掉有时无法工作,您将只需要再次安装平台。 (P.S这是我个人的观察,否则删除 buid-extras.gradle
应该就够了。)
I have added Crosswalk to my ionic project. When i do ionic build android
it outputs two separate APK files, one for armv7 and one for x86.
However i want one single apk file bundling two architectures together.
I tried setting BUILD_MULTIPLE_APKS = false
but it's still building two separate apks.
There is a post here saying :
Took me a minute but you can get the single build file by commenting out the cdvBuildMultipleApks=true line in the platforms/android/gradle.properties
Cheers
But i don't have any gradle.properties file in my platforms/android/ folder, i have a project.properties file and there is no cdvBuildMultipleApks=true
line in it to comment out.
I tried to manually create a gradle.properties file and putting cdvBuildMultipleApks=false
in there but still two outputs.
Any ideas how to achieve this?
Update:
My Cordova version is 5.1.1
Solution:
What did work for me as suggested by @mudasserajaz and here, was to :
- Create a file named
build-extras.gradle
inside my/platform/android/
directory. - put
ext.cdvBuildMultipleApks=false
inside it. ionic build android --release
then and Voila, it worked.
@mudasserajaz suggested the same thing except variable name is cdvBuildMultipleApks=false
so in case it didn't work out for you, don't forget the ext
Here are steps to do that:
- Make a file
build-extras.gradle
and put it intoplatforms/android/
. Add linecdvBuildMultipleApks=false
intobuild-extras.gradle
. - Now run
ionic run android
,it will create combined single buildandroid-debug.apk
.
build.gradle
will automaticaly import build-extras.gradle
,if that is defined.You can see code of build.gradle
doing this :
def hasBuildExtras = file('build-extras.gradle').exists()
if (hasBuildExtras) {
apply from: 'build-extras.gradle'
}
Plus these instructions are clearly mentioned in build.gradle
line 57 :
Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties.
NOTE: Before you follow these steps, remove platform folder and install again.
Observations: Once you have done these steps, and again at some point you want to make separate builds, then setting cdvBuildMultipleApks=true
or commenting out sometimes wont work, you will simply have to install platform again. (P.S this is my personal observation, otherwise deleting buid-extras.gradle
should be enough.)
这篇关于建立结合armv7 / x86 apk后Crosswalk集成在一个Ionic项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!