File write permission error in Android - android

I am writing a file to SDCard and set <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> it works good upto 3.x but on 4.0 it gives the below error.
java.io.IOException: open failed: EACCES (Permission denied)
at java.io.File.createNewFile(File.java:940)
at com.gt.mLearning.app.VideoViewActivity.copyFile(VideoViewActivity.java:204)
at com.gt.mLearning.app.VideoViewActivity.access$3(VideoViewActivity.java:193)
at com.gt.mLearning.app.VideoViewActivity$Loader.doInBackground(VideoViewActivity.java:61)
at com.gt.mLearning.app.VideoViewActivity$Loader.doInBackground(VideoViewActivity.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:264)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at java.io.File.createNewFile(File.java:933)
Any help or suggestion?
rohit

Just guessing but did you probably have your phone still connected to the computer? This error might happen if your sd card is still locked as a usb device.
Hope this helped,
Tobias

Latter on I discovered that the issue is device specific. I installed the File Manager app from Android market and it shows no write permission. It mean the Android OS implementation of that manufacturer do not provide write permission which is causing the issue.

Probably you have hard-coded the external storage directory and it works on particular devices.
Environment.getExternalStorageDirectory();
Posting your code will help much more than just the log.

You may check you've just updated your Android O/S, too. Some major change cause sdcard problem. For me, I update my Android O/S in SHV-E160K from 2.3.5 to 4.1.2 with Odin which is samsung firmware update application. And I faced problem.
My detailed error message is as follows :
02-14 11:00:43.057 22288-22288/? W/System.err﹕ java.io.IOException: open failed: EACCES (Permission denied)
02-14 11:00:43.057 22288-22288/? W/System.err﹕ at java.io.File.createNewFile(File.java:940)
02-14 11:00:43.057 22288-22288/? W/System.err﹕ at com.sec.android.util.IAPDeviceInfoEditor.activity.EditorActivity.createDeviceInfo(EditorActivity.java:222)
02-14 11:00:43.057 22288-22288/? W/System.err﹕ at com.sec.android.util.IAPDeviceInfoEditor.activity.EditorActivity.onClick(EditorActivity.java:121)
02-14 11:00:43.057 22288-22288/? W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
02-14 11:00:43.057 22288-22288/? W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:511)
02-14 11:00:43.057 22288-22288/? W/System.err﹕ at android.view.View$1.onClick(View.java:3685)
02-14 11:00:43.057 22288-22288/? W/System.err﹕ at android.view.View.performClick(View.java:4192)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at android.view.View$PerformClick.run(View.java:17248)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:615)
02-14 11:00:43.067 172-485/? V/AudioHardwareMSM8660﹕ open driver
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:92)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at android.os.Looper.loop(Looper.java:137)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:4950)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:511)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:997)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at libcore.io.Posix.open(Native Method)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ at java.io.File.createNewFile(File.java:933)
02-14 11:00:43.067 22288-22288/? W/System.err﹕ ... 16 more
The reason is 4.1.2 couldn't recognize file system in 2.3.5. I solve this formatting sdcard storage. format doesn't mean delete your personal information such as address, memo or history. After format, it works like magic.

This may help you.
I faced the same issue when writing the file on sdcard. I have set all required permission to write the file but i used file object like below:
Wrong :
File myFile = new File(Environment.getExternalStorageDirectory().getAbsoluteFile()+fileName);
Correct:
File myFile = new File(Environment.getExternalStorageDirectory().getAbsoluteFile(), fileName);
That means the path was wrong.

Related

Picasso is not loading images from the external storage

Using Picasso (version 2.5.2) in my android project and trying to load all the images stored in the device in a grid view. Picasso is successfully loading all the images stored in the internal storage but not loading those from the external storage. Also, not getting any errors in the log.
I also checked if the file exists and loaded that successfully in a view using Glide library.
Sample external file path:
/storage/0403-0201/DCIM/Camera/IMG_20180309_120329.jpg
#CommonsWare, Thanks a lot! I attached Picasso.Listener and got the following stack trace-
W/System.err﹕ java.io.IOException: Cannot reset
W/System.err﹕ at com.squareup.picasso.MarkableInputStream.reset(MarkableInputStream.java:99)
W/System.err﹕ at com.squareup.picasso.BitmapHunter.decodeStream(BitmapHunter.java:140)
W/System.err﹕ at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:217)
W/System.err﹕ at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:159)
W/System.err﹕ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
W/System.err﹕ at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:394)
W/System.err﹕ java.io.IOException: Cannot reset
W/System.err﹕ at com.squareup.picasso.MarkableInputStream.reset(MarkableInputStream.java:99)
W/System.err﹕ at com.squareup.picasso.BitmapHunter.decodeStream(BitmapHunter.java:140)
W/System.err﹕ at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:217)
W/System.err﹕ at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:159)
W/System.err﹕ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
W/System.err﹕ at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:394)
I explored this error and found that Picasso 2.5.2 does not display big images and same has been filed as a bug on Picasso github page.
https://github.com/square/picasso/issues/907
Solution: Picasso 2.5.x is having the bug but version 2.4.0 is working fine.

single WebView layout to view urls from my main activity

I want to reuse a custom xml which I for various links from my main Activity.
I assume it's using a LayoutInflater.
But I am struggling with the code.
I was using the main_Activity xml for the code originally.
But I thought it would save space in the app if it inflated the same WebView for all the links within the app.
this is the xml for the custom layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:id="#+id/MyWebView">
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/webViewCustom">
</WebView>
</LinearLayout>
then this is the Java code I have tried.
I think that might be where my problem lies
switch (position){
case 0:
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(view.getWidth(),view.getHeight());
lp.leftMargin = (int) view.getX();
lp.topMargin = (int) view.getY();
LayoutInflater li = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
RelativeLayout ll = (RelativeLayout) li.inflate(R.layout.custom_webview, null);
webViewCustom.getSettings().setJavaScriptEnabled(true);
webViewCustom.getSettings().setBuiltInZoomControls(true);
webViewCustom.loadUrl(AeonnoxCusBckGrndMJDUrl);
MjdLayout.addView(ll, lp);
break;
this is how originaly had it within my mainActivity java. and each link has a seperate webView attached to a drawer. but i want 1 Activity that inflates/Opens all links when each button is pressed it just reuses the one view
TrustedSellersDrawer.openDrawer(MJDwebViewDrawerRight);
MJDwebViewDrawerRight.getSettings().setJavaScriptEnabled(true);
MJDwebViewDrawerRight.getSettings().setBuiltInZoomControls(true);
MJDwebViewDrawerRight.loadUrl(AeonnoxCusBckGrndMJDUrl);
The logcat
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:409)
11-13 18:13:46.578 552-587/? W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
11-13 18:13:46.578 552-587/? W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
11-13 18:13:46.578 552-587/? W/System.err﹕ at com.sec.android.hardware.SecHardwareInterface.setBatteryADC(SecHardwareInterface.java:393)
11-13 18:13:46.578 552-587/? W/System.err﹕ at com.android.server.power.PowerManagerService$DisplayBlankerImpl$1.run(PowerManagerService.java:5324)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:733)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.Looper.loop(Looper.java:146)
11-13 18:13:46.578 552-587/? W/System.err﹕ at android.os.HandlerThread.run(HandlerThread.java:61)
11-13 18:13:46.578 552-587/? W/System.err﹕ Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.Posix.open(Native Method)
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-13 18:13:46.578 552-587/? W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:393)
11-13 18:13:46.578 552-587/? W/System.err﹕ ... 8 more
my last few questions have been marked down quite alot for unknown reasons, so please be nice.

AWS API Gateway REST DELETE method call from android app working fine in emulator but not working from device?

I am calling AWS API Gateway REST service from my android app through AsyncTask. All method working fine both in emulator and device. But when I call delete then in emulator working fine but from device it is giving an error that
java.lang.reflect.UndeclaredThrowableException
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at $Proxy1.userDelete(Native Method)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.example.nmsapp.CustomUserAdapter$DeleteUsers.doInBackground(CustomUserAdapter.java:130)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.example.nmsapp.CustomUserAdapter$DeleteUsers.doInBackground(CustomUserAdapter.java:107)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:288)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ Caused by: java.net.ProtocolException: DELETE does not support writing
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpURLConnectionImpl.initHttpEngine(HttpURLConnectionImpl.java:258)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:86)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:254)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.amazonaws.http.UrlHttpClient.writeContentToConnection(UrlHttpClient.java:128)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.amazonaws.http.UrlHttpClient.execute(UrlHttpClient.java:65)
09-28 15:32:03.133 12335-12824/com.example.nmsapp W/System.err﹕ at com.amazonaws.mobileconnectors.apigateway.ApiClientHandler.invoke(ApiClientHandler.java:91)
Android Menifest permission are:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
DELETE with body can lead to unexpected behavior. Per HTTP/1.1 RFC2616, this is neither allowed not disallowed. However, depending on which HTTP library you use, the behavior may vary. As for the generated API Gateway client, its uses HttpURLConnection as recommended by Android. Nevertheless, the implementation of HttpURLConnection is platform dependent. Priory to API level 19, it's close to Java's standard implementation by Sun, where ProtocolException will be thrown on DELETE with body. Since API level 19, Android switches to OkHttp which permits such behavior (see https://github.com/square/okhttp/issues/605). This should explain why it works on some place but not the other. In summary, I suggest you avoid defining an API which does DELETE with body.

How can i run Jacoco in android studio for code coverage

I have a debug flavor in android studio already. My gradle config file for my app module contains the following:
debug{
testCoverageEnabled true
}
then i run the following command in the terminal:
gradlew createDebugCoverageReport
and indeed I get a report but the app also crashes with a read only error and I cannot seem to figure it out. I'm using a mac. Here is the stack trace:
**java.io.FileNotFoundException: /jacoco.exec: open failed: EROFS (Read-only file system)**
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:416)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at org.jacoco.agent.rt.internal_932a715.output.FileOutput.openFile(FileOutput.java:67)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at org.jacoco.agent.rt.internal_932a715.output.FileOutput.startup(FileOutput.java:49)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at org.jacoco.agent.rt.internal_932a715.Agent.startup(Agent.java:122)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at org.jacoco.agent.rt.internal_932a715.Agent.getInstance(Agent.java:50)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at org.jacoco.agent.rt.internal_932a715.Offline.<clinit>(Offline.java:31)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at mypackage.org.duckduck.MainApplication.$jacocoInit(MainApplication.java)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at mypackage.org.duckduck.MainApplication.<clinit>(MainApplication.java)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at java.lang.Class.newInstanceImpl(Native Method)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at java.lang.Class.newInstance(Class.java:1319)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.app.Instrumentation.newApplication(Instrumentation.java:983)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.app.Instrumentation.newApplication(Instrumentation.java:968)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4480)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.app.ActivityThread.access$1300(ActivityThread.java:146)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:99)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.os.Looper.loop(Looper.java:137)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5168)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:511)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:564)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ Caused by: libcore.io.ErrnoException: open failed: EROFS (Read-only file system)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at libcore.io.Posix.open(Native Method)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:400)
03-01 00:04:56.871 19006-19006/mypackage.org.duckduck W/System.err﹕ ... 24 more
I had the same problem running jacoco on an USB device.
Using Genymotion solved the issue.
Since, I dont see your entire gradle file I'm not sure if you already have this the right way but one suggestion is don't apply the jacoco plug-in explicitly if you are in the gradle file. Gradle's most recent version comes packaged with JaCoCo.
This was breaking my tests until recently when I tried without that line.
Another thing is I just run
gradle connectedCheck
from the terminal(Mac) or command prompt (windows) and this generates the html code coverage report for me.
Hopefully trying this fixes your issue too.
This warning seems irrelevant:
The error message went away when mounting the root file system read-write
mount -o remount,rw rootfs /
, and just setting write permissions for all users (only do this on an emulator!!!, it is really insecure)
chmod 777 /
Unfortunately, my tests were broken before and after, changing this did not fix them at all.
So unless there is a real problem, you could just treat this as a message that requires no action.

Phonegap: plugins not found in android

it seems that i messed up something with my configuration. After an Update of cordova and some cleaning operations all plugins cant be found by android. It says:
10-10 20:49:47.040 611-611/com.phonegap.helloworld W/System.err﹕ java.lang.ClassNotFoundException: org.apache.cordova.ContactManager
10-10 20:49:47.050 611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.Class.classForName(Native Method)
10-10 20:49:47.050 611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.Class.forName(Class.java:234)
10-10 20:49:47.060 611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.Class.forName(Class.java:181)
10-10 20:49:47.060 611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginEntry.getClassByName(PluginEntry.java:117)
10-10 20:49:47.060 611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginEntry.createPlugin(PluginEntry.java:93)
10-10 20:49:47.070 611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:267)
10-10 20:49:47.070 611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginManager.execHelper(PluginManager.java:221)
10-10 20:49:47.070 611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginManager.exec(PluginManager.java:216)
10-10 20:49:47.080 611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
10-10 20:49:47.080 611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:221)
10-10 20:49:47.091 611-611/com.phonegap.helloworld W/System.err﹕ at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:566)
10-10 20:49:47.091 611-611/com.phonegap.helloworld W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 20:49:47.091 611-611/com.phonegap.helloworld W/System.err﹕ at android.os.Looper.loop(Looper.java:123)
10-10 20:49:47.100 611-611/com.phonegap.helloworld W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:3683)
10-10 20:49:47.100 611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
10-10 20:49:47.100 611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:507)
10-10 20:49:47.110 611-611/com.phonegap.helloworld W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-10 20:49:47.110 611-611/com.phonegap.helloworld W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-10 20:49:47.110 611-611/com.phonegap.helloworld W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
10-10 20:49:47.121 611-611/com.phonegap.helloworld W/System.err﹕ Caused by: java.lang.NoClassDefFoundError: org.apache.cordova.ContactManager
10-10 20:49:47.130 611-611/com.phonegap.helloworld W/System.err﹕ ... 19 more
10-10 20:49:47.140 611-611/com.phonegap.helloworld W/System.err﹕ Caused by: java.lang.ClassNotFoundException: org.apache.cordova.ContactManager in loader dalvik.system.PathClassLoader[/data/app/com.phonegap.helloworld-1.apk]
10-10 20:49:47.150 611-611/com.phonegap.helloworld W/System.err﹕ at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
10-10 20:49:47.150 611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
10-10 20:49:47.150 611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
10-10 20:49:47.150 611-611/com.phonegap.helloworld W/System.err﹕ ... 19 more
10-10 20:49:47.161 611-611/com.phonegap.helloworld I/System.out﹕ Error adding plugin org.apache.cordova.ContactManager.
10-10 20:49:47.161 611-611/com.phonegap.helloworld D/PluginManager﹕ exec() call to unknown plugin: Contacts
10-10 20:49:47.180 611-611/com.phonegap.helloworld I/Web Console﹕ error in contacts: at file:///android_asset/www/js/contacts.js:30
How can i get the plugins working?
I am using phonegap 3.0.0c
If you navigate to your phonegap root directory and type "phonegap local plugin list", what does it say?
If nothing happens then try to reinstall every plugin with "phonegap local plugin add link/to/plugin".
But if the plugin listing generate an output with every installed plugin, try to delete the "android.json" in the plugins directory and build your android project again.
It should create a new android project with all plugins, which you downloaded previously.

Categories

Resources