0
votes

I have the next problem. I tried to find the solution but I haven't found anything to solve my problem.

I'm new in phonegap development and I'm doing some "tests". Now, I want to show all contacts in the smartphone.

Following this enter link description here , first I add the plugin with: cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts.git

but I used phonegap instead of cordova.

Next I add: (in app/res/xml/config.xml)

<feature name="Contacts">
    <param name="android-package" value="org.apache.cordova.ContactManager" />
</feature>

(in app/AndroidManifest.xml)

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

Finally, I used the full example.

But, when I launch the App occurs the next error in Eclipse: enter image description here I don't know how to solve the problem :S

Thanks for your time!

2

2 Answers

6
votes

If you are using the CLI (command line tools) (which you are), you shouldn't need to edit any of the files in platforms/android/res/config.xml or /platforms/android/AndroidManifest.xml because the tools will do that for you.

Anyway, the problem seems to be that <param name="android-package" value="org.apache.cordova.ContactManager" /> should in fact be <param name="android-package" value="org.apache.cordova.contacts.ContactManager" />. This is what I get on a fresh install of the CLI.

Can you try to do npm update -g cordova (or phonegap) and then run the commands again and see if it works? I'm not sure why the namespace was wrong for you; the change for this was 8 days ago, maybe you are just using an old cordova/phonegap version?

4
votes

I had the exact same problem before with inappBrowser the docs are wrong for v 3.3 and up instead of

<feature name="InAppBrowser"> 
    <param name="android-package" value="org.apache.cordova.InAppBrowser"/>
</feature>

it needs to be

<feature name="InAppBrowser"> 
   <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
</feature>

you can actually check what't the correct mapping info if you look under

plugins/your-plugin/config.xml

 <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="InAppBrowser"> 
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
</feature>

cheers