[
https://issues.apache.org/jira/browse/CB-13471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464282#comment-16464282
]
ASF GitHub Bot commented on CB-13471:
-------------------------------------
raphinesse commented on issue #10: CB-13471 : added unit test for config file
provider
URL: https://github.com/apache/cordova-common/pull/10#issuecomment-386702465
@stevengill @audreyso
The condition in [this
line](https://github.com/apache/cordova-common/blob/master/src/ConfigChanges/ConfigFile.js#L198)
has to be changed to work on Windows, since `file` will be `res\xml` (mind the
backslash). Changing the condition to the following fixes it:
```js
file.includes(path.join('res', 'xml'))
```
However, we still need to extend the test itself. It could be that someone
uses the following on a Windows machine:
```js
configFile.resolveConfigFilePath('project_dir', 'android', 'res/xml'))
```
Then we would fail again. Thus, we have to normalize the given path right at
the start of `configFile.resolveConfigFilePath`:
```js
file = path.normalize(file);
```
These two changes taken together will make the following test (and all
others) pass on Windows:
```js
it('resolveConfigFilePath should return file path', function () {
[path.join('res', 'xml'), 'res/xml'].forEach(function (file) {
var configPath = path.join('project_dir', 'app', 'src', 'main',
file, 'xml');
expect(configFile.resolveConfigFilePath('project_dir', 'android',
file)).toBe(configPath);
});
});
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Fix compile error with cordova-plugin-camera and file providers
> ---------------------------------------------------------------
>
> Key: CB-13471
> URL: https://issues.apache.org/jira/browse/CB-13471
> Project: Apache Cordova
> Issue Type: Sub-task
> Components: cordova-android
> Reporter: Joe Bowser
> Assignee: Joe Bowser
> Priority: Blocker
>
> File Providers fails due to an AAPT error:
> /Users/jbowser/cordova/mobilespec/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:64:35-54:
> AAPT: No resource found that matches the given name (at 'resource' with
> value '@xml/provider_paths').
> /Users/jbowser/cordova/mobilespec/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:62:
> error: Error: No resource found that matches the given name (at 'resource'
> with value '@xml/provider_paths').
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]