Google Play won't accept Apache Cordova

风流意气都作罢 提交于 2019-12-11 09:48:36

问题


I originally tried using AIDE for PhoneGap and after I submitted my app to Google Play I got the following message...

APP REJECTED
Your app submission has been rejected because it contains security vulnerabilities, which is a violation of our dangerous products policy. If the uploaded APK was an app update, the previous version is still available on Google Play. More details about this rejection have been emailed to the account owner.

I then went ahead and used Apache Cordova's Hello World example after a fresh npm install and received the following message (At this point I did not check the full error to see what version of Cordova was reqjected)...

Security alert
This app is built on a version of Apache Cordova that contains security vulnerabilities. You have until Aug 31, 2015 to resolve this. Please see the alerts page for more information.
Affects APK version 6.

My last attempt was using Adobe's PhoneGap Build as a work around (after reading the full alert on Google Play... "Please migrate your app to Apache Cordova v.3.5.1 or higher as soon as possible.") and Google Play still gave the message above. BTW My app runs fine on Android I just haven't got it accepted into Google Play.

I've been searching for a solution since last night and I haven't came across anything, and I would much rather prefer to use Adobe's PhoneGap Build than going into native Java.

Can anyone help? I don't know why these are not working for me.

After running npm info cordova It says the version is 6.0.0 but the cordova.js file says it's version 5.1.0. PhoneGap Desktop doesn't give me a cordova file, but npm info phonegap version says it's 5.4.1.

I updated the old cordova.js file to the most recent one being v5.1.0, but haven't figured out how to replace cordova-2.9.0.jar. to version v5.4.1

NOTE: Even with cordova.js v5.1.0 it's still not being accepted on Google Play.

Here's my config.xml (for PhoneGap Build)...

<?xml version='1.0' encoding='utf-8'?>
<widget xmlns = "http://www.w3.org/ns/widgets"
  xmlns:gap   = "http://phonegap.com/ns/1.0"
  id          = "com.michael.hellp"
  version     = "1.0.0">
  <name>
    Hello world
  </name>
  <description>
    Hello world description
  </description>
  <author href="http://build.phonegap.com/" email="name@website.com">
    Bruce Lee
  </author>

  <content src="index.html" />

  <icon src="icon.png" />
  <icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" />
  <icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" />
  <icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" />
  <icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" />
  <icon gap:platform="android" src="www/res/icon/android/icon-96-xhdpi.png" />
  <icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" />
  <icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" />
  <icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" />
  <icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" />
  <icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" />
  <icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" />
  <icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" />
  <icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" />
  <icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" />

  <preference name="orientation" value="default" />
  <preference name="target-device" value="universal" />
  <preference name="fullscreen" value="true" />
</widget>

回答1:


Turns out all I needed to do with PhoneGap Build is add this line of code in my config.xml file.

<preference name="phonegap-version" value="cli-5.2.0" />

So here's what my config looks like now.

<?xml version='1.0' encoding='utf-8'?>
<widget xmlns = "http://www.w3.org/ns/widgets"
  xmlns:gap   = "http://phonegap.com/ns/1.0"
  id          = "com.michael.hellp"
  version     = "1.0.0">
  <name>
    Hello world
  </name>
  <description>
    Hello world description
  </description>
  <author href="http://build.phonegap.com/" email="name@website.com">
    Bruce Lee
  </author>

  <content src="index.html" />

  <icon src="icon.png" />
  <icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" />
  <icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" />
  <icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" />
  <icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" />
  <icon gap:platform="android" src="www/res/icon/android/icon-96-xhdpi.png" />
  <icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" />
  <icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" />
  <icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" />
  <icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" />
  <icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" />
  <icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" />
  <icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" />
  <icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" />
  <icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" />

  <preference name="orientation" value="default" />
  <preference name="target-device" value="universal" />
  <preference name="fullscreen" value="true" />
  <preference name="phonegap-version" value="cli-5.2.0" />
</widget>



回答2:


I had the same issue, and the <preference name="phonegap-version" value="cli-5.2.0" /> setting as proposed by Michael Schwartz did not help.

The following resolved the issue:

$ cordova platform remove android
$ cordova platform add android@5.4.0

To check what version you are actually submitting, check platforms/android/platform_www/cordova.js for the following string:

var PLATFORM_VERSION_BUILD_LABEL = '5.4.0';

Note changing this string manually will get you in trouble elsewhere, so don't.



来源:https://stackoverflow.com/questions/35213715/google-play-wont-accept-apache-cordova

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!