简体   繁体   English

Ionic 和 Crosswalk 无法生成签名的 APK

[英]Ionic and Crosswalk Can’t Generate Signed APK

I am trying to add crosswalk to my ionic.我正在尝试为我的离子添加人行横道。 My apps are launched and working fine.我的应用程序已启动并且运行良好。 However after I added Crosswalk, I can't generate signed apks anymore.但是,在添加 Crosswalk 后,我无法再生成已签名的 apk。 I tried to remove crosswalk and it works again.我试图去除人行横道,它又起作用了。 How did you guys manage to get it working?你们是如何设法让它工作的?

Here's what I did:这是我所做的:

cordova plugin add cordova-plugin-crosswalk-webview cordova platform add android ionic build android cordova 插件添加cordova-plugin-crosswalk-webviewcordova 平台添加android ionic build android

it builds fine except: BUILD SUCCESSFUL它构建得很好,除了:BUILD SUCCESSFUL

Total time: 1 mins 34.909 secs Built the following apk(s): <--- this part is empty, usually it'll show the path of the apk generated总时间:1 分 34.909 秒 构建了以下 apk(s):<--- 这部分是空的,通常它会显示生成的 apk 的路径

In Android Studio I get this error for the gradle sync.在 Android Studio 中,我收到此 gradle 同步错误。 NDK integration is deprecated in the current plugin.当前插件中不推荐使用 NDK 集成。

When I try to generate signed apk, I get this error: Missing Gradle Project Information.当我尝试生成签名的 apk 时,出现此错误:缺少 Gradle 项目信息。 Please check if the IDE successfully synchronized its state with the Gradle Project Model.请检查 IDE 是否成功将其状态与 Gradle 项目模型同步。

I tried cordova platform add android@4.1, instead of using latest one.我试过cordova平台添加android@4.1,而不是使用最新的。 And I was able to build it with sdk 22.我能够用 sdk 22 构建它。

However when I try to publish, I'm getting this problem.但是,当我尝试发布时,我遇到了这个问题。

It is forbidden to downgrade devices which previously used M permissions (target SDK 23 and above) to APKs which use old style permissions (target SDK 22 and below). This occurs in the change from version 103098 (target SDK 23) to version 104004 (target SDK 22).

The steps I followed to get signed apk is as-我为获得签名的apk而遵循的步骤是-

open terminal and go to android file打开终端并转到android文件

$ cd projectDir/platforms/android

and run this command to generate digital signature并运行此命令以生成数字签名

$ keytool -genkey -v -keystore exampleapp.keystore -alias example -keyalg RSA -keysize 2048 -validity 10000

# This will create a file in you "projectDir/platforms/android" directory with a name of exampleapp.keystore which will have digital signature. # 这将在您的“projectDir/platforms/android”目录中创建一个名为 exampleapp.keystore 的文件,该文件将具有数字签名。

# Now Create a file with name of release-signing.properties here in # 现在在此处创建一个名为 release-signing.properties 的文件

projectDir/platforms/android directory. projectDir/platforms/android 目录。

# Provide details to this file about your signature. # 提供有关您签名的此文件的详细信息。

*# signed apk details
storeFile=exampleapp.keystore
keyAlias=mindfull
storePassword=password
keyPassword=password*

Go to terminal and exit to main project directory by typing转到终端并通过键入退出到主项目目录

 $ cd ../..

Run this command to build signed apk.运行此命令以构建已签名的 apk。

$ cordova build android --release

this will run many task and show something like this-这将运行许多任务并显示如下内容-

在此处输入图片说明

Now you can upload this apk on play store and share with your friend.现在您可以在 Play 商店上传这个 apk 并与您的朋友分享。

Have a nice day !!!祝你今天过得愉快 !!! For more you can see here https://randvblog.wordpress.com/2016/07/04/generate-signed-apk-for-android-using-gradle-for-cordova-6-0-0-in-ionic/有关更多信息,您可以在此处查看https://randvblog.wordpress.com/2016/07/04/generate-signed-apk-for-android-using-gradle-for-cordova-6-0-0-in-ionic/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM