pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 584 forks source link

An error occurred while packaging:Tag <provider> attribute authorities has invalid character '$'. #217

Closed 1308774130 closed 5 years ago

1308774130 commented 5 years ago

Hi. I'm trying to build cordova project and get the following error:

[aapt] C:\Users\TNQD005\Desktop\JSDGJ update\ShortSightednessDoctor\platforms\android\ant-build\AndroidManifest.xml:78: Tag attribute authorities has invalid character '$'. BUILD FAILED C:\dev\sdk\tools\ant\build.xml:649: The following error occurred while executing this line: C:\dev\sdk\tools\ant\build.xml:694: null returned: 1 Total time: 7 seconds C:\Users\TNQD005\Desktop\JSDGJ update\ShortSightednessDoctor\platforms\android\cordova\node_modules\q\q.js:126 throw e; ^ Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\TNQD005\Desktop\JSDGJ update\ShortSightednessDoctor\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen Error: cmd: Command failed with exit code 8 at ChildProcess.whenDone (C:\dev\nodejs\node_global\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:756:16) at Process.ChildProcess._handle.onexit (child_process.js:823:5)

I have spent the past a whole day trying to find a solution for this problem. if i add cordova-plugin-file-opener2 plugin, AndroidManifest.xml will be automatically add

so when i pack it ,I got the error message above How can I fix this problem?

godoyrw commented 5 years ago

I had the same error after updating the android SDK to the latest build tools.

The tools\ant\build.xml script does not contain any references for the tools.

This can be solved, by adding the tools to the build.xml and point to the correct path. For me this was build-tools\22.0.1

Please compare and update the tool section in build.xml

<!-- tools location -->
<property name="android.tools.dir" location="${sdk.dir}/tools" />
<property name="android.platform.tools.dir" location="${sdk.dir}/platform-tools" />
<property name="android.buildtools.dir" location="${sdk.dir}/build-tools/22.0.1" />
<condition property="exe" value=".exe" else=""><os family="windows" /></condition>
<condition property="bat" value=".bat" else=""><os family="windows" /></condition>
<property name="adb" location="${android.platform.tools.dir}/adb${exe}" />
<property name="lint" location="${android.tools.dir}/lint${bat}" />
<property name="zipalign" location="${android.buildtools.dir}/zipalign${exe}" />
<property name="aidl" location="${android.platform.tools.dir}/aidl${exe}" />
<property name="aapt" location="${android.buildtools.dir}/aapt${exe}" />
<property name="dx" location="${android.buildtools.dir}/dx${bat}" />
<property name="renderscript" location="${android.buildtools.dir}/llvm-rs-cc${exe}"/>
<property name="lint" location="${android.tools.dir}/lint${bat}" />
1308774130 commented 5 years ago

@godoyrw thanks for your help,but my build.xml does not give me too much valid content,I didn't see such a sentence so I don't know how to proceed ` <?xml version="1.0" encoding="UTF-8"?>

` and i'm using android 4.4; Cordova 4.1.2;does this have something to do with my version?

godoyrw commented 5 years ago

Which version are you using Android build tools!?

1308774130 commented 5 years ago

@godoyrw eclipse.And I just use this for configuration,use a CMD when build

shnist commented 5 years ago

hi @1308774130, thanks for raising this issue. Were you able to resolve it in the end?

shnist commented 5 years ago

After some investigation this appears to be an issue related to Eclipse, https://stackoverflow.com/questions/42040570/tag-provider-attribute-authorities-has-invalid-character-androidmanifest, which is no longer supported for Android development. I would advise using Android Studio instead, as per the comment on stackoverflow.