问题
I have a small mobile app that was uploaded to Phonegap Build to bundle the app for different platform, I only insterested in the android bundle for now.
The challenge is after uploading the app and phonegap gives the apk I install on my device, the icon to launch the app on the device is the generic phonegap icon, I already added this to my config file and the files are in place correctly in the icon folder
<!-- Define app icon for each platform. -->
<icon src="icon/icon.png" />
<icon src="icon/icon_036.png" gap:platform="android" gap:density="ldpi" />
<icon src="icon/icon_048.png" gap:platform="android" gap:density="mdpi" />
<icon src="icon/icon_072.png" gap:platform="android" gap:density="hdpi" />
I also observed that on opening the apk with winrar in the res folder I still have the default phonegap icon in place while my splash screen has been updated and working on device normally.
Is there anything I am missing??
回答1:
I faced a similar problem. Please see if your config.xml
file is in the same folder as index.html
and in that same folder you make a separate folder named img
and place icon.png
in that folder. You are also making the mistake of not giving icon a default tag:
<icon src="img/icon.png" gap:role="default" />
give it a try!
回答2:
Go into your ProjectRoot->platforms->android->res directory
Iterate through each folder and replace "icon.png" with your custom icon image that is of the equivalent sizing.
Finally, in your root config.xml file, add:
<preference name="prerendered-icon" value="true"/>
beneath the author property.
HTH
来源:https://stackoverflow.com/questions/19901059/phonegap-build-no-app-icon-on-device