phonegap / build

This is the public repository for PhoneGap Build source and bug tracking
92 stars 33 forks source link

Cordova-android seems to be pinned to 7.0.0 (7.1.2 is latest) #640

Closed KevinVlaanderen closed 5 years ago

KevinVlaanderen commented 5 years ago

Version 7.1.2 of cordova-android, as compared to 7.0.0, contains several backwards compatibility changes to ensure that plugins still work with the changed Android project structure (introduced in 7.0.0).

The used version of cordova-android can be specified in the config.xml file using the tag (e.g. <engine name="android" spec="7.1.2" />. This works as expected when using the CLI. Unfortunately, this does not seem to work on Phonegap Build.

As a result, we currently cannot upgrade our projects to the latest versions of Phonegap and Cordova, as we rely on PGB to build these apps.

PS: the version of cordova-ios also seems to be pinned, but the difference is not as big there (4.5.4 vs 4.5.5)

andersborgabiro commented 5 years ago

Have you verified that you need the backwards compatibility? I use cli-8.0.0 in most of my projects without problems, and one uses 24 plugins.

KevinVlaanderen commented 5 years ago

Hi there. Indeed we have. The android project folder is generated just fine locally when we use cordova-android 7.1.2, but breaks with errors like the one below when using 7.0.0.

As you can see, it happens with the LaunchNavigator plugin. We use a total of 38 plugins, and the same error occurs for 10 of them. They are (nearly) all at their latest versions.

Failed to install 'uk.co.workingedge.phonegap.plugin.launchnavigator': Error: ENOENT: no such file or directory, open '/Users/Kevin/Workspace/hybrid-app-template/build/platforms/android/AndroidManifest.xml' at Object.openSync (fs.js:443:3) at Object.readFileSync (fs.js:348:35) at Object.parseElementtreeSync (/Users/Kevin/Workspace/hybrid-app-template/build/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27) at new AndroidManifest (/Users/Kevin/Workspace/hybrid-app-template/build/platforms/android/cordova/lib/AndroidManifest.js:29:20) at AndroidProject.getPackageName (/Users/Kevin/Workspace/hybrid-app-template/build/platforms/android/cordova/lib/AndroidProject.js:99:12) at Api.addPlugin (/Users/Kevin/Workspace/hybrid-app-template/build/platforms/android/cordova/Api.js:223:57) at handleInstall (/usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/src/plugman/install.js:594:10) at /usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/src/plugman/install.js:357:28 at _fulfilled (/usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/node_modules/q/q.js:787:54) at /usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/node_modules/q/q.js:816:30

Failed to restore plugin "uk.co.workingedge.phonegap.plugin.launchnavigator" from config.xml. You might need to try adding it again. Error: Error: ENOENT: no such file or directory, open '/Users/Kevin/Workspace/hybrid-app-template/build/platforms/android/AndroidManifest.xml'

andersborgabiro commented 5 years ago

OK then. Time for the PGB team to update.

goya commented 5 years ago

yep versions are pinned to exact versions on phonegap build: https://build.phonegap.com/current-support (engines are not parsed or read on phonegap build - yet)

versions are selected either as

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

and / or per platform

<platform name="ios" >
    <preference name="phonegap-version" value="4.3.1" />
</platform>

<platform name="android" >
    <preference name="phonegap-version" value="7.0.0" />
</platform>

as for android 7.1.2 it should be on build this week.

KevinVlaanderen commented 5 years ago

That is good to hear. Could you please post an update here when that happens? Thanks a lot!

KevinVlaanderen commented 5 years ago

For anyone following this thread; Phonegap Build now supports the following versions:

phonegap-version Android Phonegap Version iOS Phonegap Version Windows Phonegap Version
cli-8.1.1 7.1.2 4.5.5 6.0.1

Source: https://build.phonegap.com/current-support

KevinVlaanderen commented 5 years ago

Unfortunately, trying to build using the above versions, Phonegap Build shows the following error:

screenshot 2018-11-16 08 10 22

Snippet from config.xml:

`

<engine name="ios" spec="4.5.5" />`
KevinVlaanderen commented 5 years ago

It seems the changes are now live. The build proceeds properly using cli-8.1.1. Thanks!