Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Fresh install fails on resources (icon) not found #23

Closed
HarelM opened this issue May 2, 2021 · 7 comments · Fixed by #26
Closed

[Android] Fresh install fails on resources (icon) not found #23

HarelM opened this issue May 2, 2021 · 7 comments · Fixed by #26
Assignees
Labels
android Related to the Android platform bug Something isn't working

Comments

@HarelM
Copy link
Collaborator

HarelM commented May 2, 2021

Describe the bug
When adding the plugin to a cordova project the android build fails due to missing icon

To Reproduce
Steps to reproduce the behavior:
cordova plugin add <this plugin>
cordova build android

Expected behavior
Should work

Desktop (please complete the following information):

  • OS: [Android]

Additional context
changing the @mipmap/icon to @mipmap/ic_launcher solves this issue.
Might be only my environment though, not sure, but it's not a great developer experience.
Also the icon that exists is a default one and not the app icon.
The build has warnings.

I would like to address all these issues related to icon definition in this issue, either by documentation or by proper cordova intallation/build code.

@HarelM
Copy link
Collaborator Author

HarelM commented May 2, 2021

I think this issue is the same as:
mauron85#553
Which was also reported here:
apache/cordova-android#678
I think the solution to this issue is simply change the default parameter value from icon to ic_launcher and writing in the documentation that this plugin supports Cordova 8.x and above.

@RaddishIoW
Copy link

I'm going to be working on another Android issue today, so I'll check this out too.

@RaddishIoW RaddishIoW self-assigned this May 3, 2021
@HarelM
Copy link
Collaborator Author

HarelM commented May 3, 2021

Go ahead. I think the only change that is needed is changing the default value of the parameter, the rest of the issues I saw in the build are not related to this plugin, I think...

@RaddishIoW
Copy link

Right, yep - lets make sure that we're targeting only Cordova Android >= 8.0 and API >= 26. I'll add these checks to the plugin, and modify the docs to match.

RaddishIoW added a commit that referenced this issue May 3, 2021
@HarelM
Copy link
Collaborator Author

HarelM commented May 3, 2021

Go ahead. The docs still has an example of old config style which is inside config.xml, this is no longer relevant as it moved to package.json. Worth fixing this too I believe...

@RaddishIoW
Copy link

Ah right - this section?

<plugin name="cordova-background-geolocation-plugin" spec="cordova-background-geolocation-plugin@~1.0.0">
  <variable name="GOOGLE_PLAY_SERVICES_VERSION" value="11+" />
  <variable name="ANDROID_SUPPORT_LIBRARY_VERSION" value="26+" />
  <variable name="ICON" value="@mipmap/ic_launcher" />
  <variable name="SMALL_ICON" value="@mipmap/ic_launcher" />
  <variable name="ALWAYS_USAGE_DESCRIPTION" value="App requires background tracking " />
  <variable name="MOTION_USAGE_DESCRIPTION" value="App requires motion detection" /> 
</plugin>

@HarelM
Copy link
Collaborator Author

HarelM commented May 3, 2021

Yup. :-)

@RaddishIoW RaddishIoW linked a pull request May 3, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Related to the Android platform bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants