I get errors when building the PhoneGap API Sample (7.4.2.0 - Section 5 of Samples) in PhoneGap. Here’s the details:
I copied the javascript phonegapapi sample project folder to my working folder for projects - all subfolders, etc.
I opened the project, and tried in on the desktop browser. It ran, but nothing works - it’s a desktop - it’s not supposed to.
Next I used Run = Build Native App with PhoneGap Build. It failed. The logs show the following:
Installing "cordova-plugin-compat" at "1.2.0" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 8.0.0, failed version requirement:
<6.3.0
Skipping 'cordova-plugin-compat' for android
and this, which is actually killing the ability to create the apk:
> Task :app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
/var/gimlet/tmp/47198922588420/3686124/app/build/intermediates/merged_manifests/debug/AndroidManifest.xml:32: AAPT: error: resource mipmap/ic_launcher (aka com.nsbasic.PhoneGapAPI:mipmap/ic_launcher) not found.
error: failed processing manifest.
At this point, I went back to a working (Pre August 1st) simple test project that did create a working apk on July 27th on the old PhoneGap. I changed the samples config.xml to correspond to mine (after tweaking it some for 9.0.0 - see https://discuss.appstudio.dev/t/app-icon-quality/1799). Here’s the differences:
line 3 - change to https:// (I’m not sure this change matters)
lines 17 thru 21 - change qualifier= to density=
lines 47 and 48 - remove gap: (I’m not sure this change matters)
add these lines before the </widget>
:
<plugin name="cordova-plugin-statusbar" source="npm" /> <preference name="StatusBarOverlaysWebView" value="{phoneGapStatusBarOverlay}" /> <preference name="StatusBarBackgroundColor" value="{phoneGapStatusBarColor}" /> <preference name="StatusBarStyle" value="{phoneGapStatusBarStyle}" />
Now the sample works when installed (either signed or not - if not - you’ll have to uninstall and reinstall any changes). However, there are still warnings, if not errors, in phonegap:
Fetching plugin “cordova-plugin-compat@^1.1.0” via npm
Installing “cordova-plugin-compat” at “1.2.0” for android
Plugin doesn’t support this project’s cordova-android version. cordova-android: 8.0.0, failed version requirement:
<6.3.0
Skipping ‘cordova-plugin-compat’ for android
It’s not really an error, but it seems like it should be cleaned up too.
George, you mentioned in another post you were fixing the samples for the density= parameter. Can you put the needed above changes in too?
Thanks