Phonegap: plugins not found in android - 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.

Related

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.

App crashing on particular Android version

I am working on an Android application. when I run my App below api 16 it works fine but when it runs on a post api 16 phone it crashes. Here is a the logact log which appears when it crashes.
06-19 20:20:05.096 5812-5812/com.ets.medecord W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x42011898)
06-19 20:20:05.106 5812-5812/com.ets.medecord E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ets.medecord/com.ets.medecord.SignupActivity2}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2218)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2268)
at android.app.ActivityThread.access$600(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5162)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:756)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:572)
at miui.dexspy.DexspyInstaller.main(DexspyInstaller.java:171)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.ets.medecord.SignupActivity2.onCreate(SignupActivity2.java:72)
at android.app.Activity.performCreate(Activity.java:5135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at com.lbe.security.service.core.client.b.x.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2182)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2268)
            at android.app.ActivityThread.access$600(ActivityThread.java:148)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5162)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:756)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:572)
            at miui.dexspy.DexspyInstaller.main(DexspyInstaller.java:171)
            at dalvik.system.NativeStart.main(Native Method)
To see code of the activity you can checkout this gist https://gist.github.com/darthvish/873dc292c841e5c86312
As you are using some deprecated features, so it may not supported for some API levels. For this you can check the api level as well as version before using the deprecated features using if condition. For example :
if(Build.VERSION.RELEASE.equals("4.4.4")) {
//Do somthing
}

Can't install apps with Eclipse ADT on my phone

I would like to install and debug projects using Eclipse ADT. It finds the device and trys to install but then I get the errors below.
The phone is a "HTC One S" and it is the Custom ROM "Codename Lungo One S" (4.3). The applications are the Kontalk project and the ApiDemos from the 17 (4.2.2) samples both build for 4.2.2.
Installing in the emulator works.
10-10 00:36:30.783: E/AndroidRuntime(2943): *** FATAL EXCEPTION IN SYSTEM PROCESS: main
10-10 00:36:30.783: E/AndroidRuntime(2943): java.lang.SecurityException: Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.
10-10 00:36:30.783: E/AndroidRuntime(2943): at android.os.Parcel.readException(Parcel.java:1431)
10-10 00:36:30.783: E/AndroidRuntime(2943): at android.os.Parcel.readException(Parcel.java:1385)
10-10 00:36:30.783: E/AndroidRuntime(2943): at android.content.pm.IPackageManager$Stub$Proxy.installPackageWithVerificationAndEncryption(IPackageManager.java:3314)
10-10 00:36:30.783: E/AndroidRuntime(2943): at com.android.commands.pm.Pm.runInstall(Pm.java:931)
10-10 00:36:30.783: E/AndroidRuntime(2943): at com.android.commands.pm.Pm.run(Pm.java:109)
10-10 00:36:30.783: E/AndroidRuntime(2943): at com.android.commands.pm.Pm.main(Pm.java:77)
10-10 00:36:30.783: E/AndroidRuntime(2943): at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
10-10 00:36:30.783: E/AndroidRuntime(2943): at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
10-10 00:36:30.783: E/AndroidRuntime(2943): at dalvik.system.NativeStart.main(Native Method)
10-10 00:36:30.793: E/JavaBinder(2943): Unknown binder error code. 0xfffffff7
10-10 00:36:30.793: E/ServiceManager(2943): error in getService
10-10 00:36:30.793: E/ServiceManager(2943): android.os.RemoteException: Unknown binder error code. 0xfffffff7
10-10 00:36:30.793: E/ServiceManager(2943): at android.os.BinderProxy.transact(Native Method)
10-10 00:36:30.793: E/ServiceManager(2943): at android.os.ServiceManagerProxy.getService(ServiceManagerNative.java:123)
10-10 00:36:30.793: E/ServiceManager(2943): at android.os.ServiceManager.getService(ServiceManager.java:55)
10-10 00:36:30.793: E/ServiceManager(2943): at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:1911)
10-10 00:36:30.793: E/ServiceManager(2943): at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:1909)
10-10 00:36:30.793: E/ServiceManager(2943): at android.util.Singleton.get(Singleton.java:34)
10-10 00:36:30.793: E/ServiceManager(2943): at android.app.ActivityManagerNative.getDefault(ActivityManagerNative.java:73)
10-10 00:36:30.793: E/ServiceManager(2943): at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)
10-10 00:36:30.793: E/ServiceManager(2943): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
10-10 00:36:30.793: E/ServiceManager(2943): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
10-10 00:36:30.793: E/ServiceManager(2943): at dalvik.system.NativeStart.main(Native Method)
10-10 00:36:30.793: E/AndroidRuntime(2943): Error reporting crash
10-10 00:36:30.793: E/AndroidRuntime(2943): java.lang.NullPointerException
10-10 00:36:30.793: E/AndroidRuntime(2943): at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)
10-10 00:36:30.793: E/AndroidRuntime(2943): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
10-10 00:36:30.793: E/AndroidRuntime(2943): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
10-10 00:36:30.793: E/AndroidRuntime(2943): at dalvik.system.NativeStart.main(Native Method)
Any ideas? Can't find anything on this on the internet?
You can try the
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
before the application tag is start in the AndroidManifest.xml.
I think you are looking for this but you can try clean and build your project first.
The problem is Codename Lungo with CM10.1 and CM10.2. This is a bug or at least you can't debug Apps with the standard procedure. It works on my phone with CL CM10 and CynogenMod 10.2.
Tim Veluwenkamp announced a new version of CL yesterday that may address the issue but I am not sure about it. I am on CM10.2 now.

Failed to inflate only on prod

Hello i have upload my new application to the google play store.
When i download my app from the play store and open it i got this error:
0-10 09:05:21.605: W/dalvikvm(22966): method Lorg/holoeverywhere/widget/aw;.getVirtualChildCount incorrectly overrides package-private method with same name in Landroid/widget/LinearLayout;
10-10 09:05:21.715: W/dalvikvm(22966): method Lorg/holoeverywhere/widget/ProgressBar;.getCurrentDrawable incorrectly overrides package-private method with same name in Landroid/widget/ProgressBar;
10-10 09:05:21.725: E/ActivityThread(22966): Failed to inflate
10-10 09:05:21.725: E/ActivityThread(22966): android.view.InflateException: Binary XML file line #22: Error inflating class org.holoeverywhere.widget.ProgressBar
10-10 09:05:21.725: E/ActivityThread(22966): at org.holoeverywhere.k.a(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at org.holoeverywhere.k.onCreateView(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at org.holoeverywhere.k.a(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at org.holoeverywhere.k.a(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at org.holoeverywhere.k.inflate(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at org.holoeverywhere.k.inflate(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at android.support.v4.app._HoloActivity.a(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at android.support.v4.app._HoloActivity.setContentView(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at com.example.workoutlog.OpeningPage.onCreate(Unknown Source)
10-10 09:05:21.725: E/ActivityThread(22966): at android.app.Activity.performCreate(Activity.java:5104)
10-10 09:05:21.725: E/ActivityThread(22966): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
10-10 09:05:21.725: E/ActivityThread(22966): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
10-10 09:05:21.725: E/ActivityThread(22966): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
10-10 09:05:21.725: E/ActivityThread(22966): at android.app.ActivityThread.access$600(ActivityThread.java:153)
10-10 09:05:21.725: E/ActivityThread(22966): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
10-10 09:05:21.725: E/ActivityThread(22966): at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 09:05:21.725: E/ActivityThread(22966): at android.os.Looper.loop(Looper.java:137)
10-10 09:05:21.725: E/ActivityThread(22966): at android.app.ActivityThread.main(ActivityThread.java:5227)
10-10 09:05:21.725: E/ActivityThread(22966): at java.lang.reflect.Method.invokeNative(Native Method)
10-10 09:05:21.725: E/ActivityThread(22966): at java.lang.reflect.Method.invoke(Method.java:511)
10-10 09:05:21.725: E/ActivityThread(22966): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
10-10 09:05:21.725: E/ActivityThread(22966): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
10-10 09:05:21.725: E/ActivityThread(22966): at dalvik.system.NativeStart.main(Native Method)
10-10 09:05:21.725: E/ActivityThread(22966): Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]
10-10 09:05:21.725: E/ActivityThread(22966): at java.lang.Class.getConstructorOrMethod(Class.java:460)
10-10 09:05:21.725: E/ActivityThread(22966): at java.lang.Class.getConstructor(Class.java:431)
10-10 09:05:21.725: E/ActivityThread(22966): ... 23 more
10-10 09:05:21.755: D/AndroidRuntime(22966): Shutting down VM
10-10 09:05:21.755: W/dalvikvm(22966): threadid=1: thread exiting with uncaught exception (group=0x41f86930)
10-10 09:05:21.755: E/AndroidRuntime(22966): FATAL EXCEPTION: main
10-10 09:05:21.755: E/AndroidRuntime(22966): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tigo/com.example.workoutlog.OpeningPage}: android.view.InflateException: Binary XML file line #22: Error inflating class org.holoeverywhere.widget.ProgressBar
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.ActivityThread.access$600(ActivityThread.java:153)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.os.Looper.loop(Looper.java:137)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.ActivityThread.main(ActivityThread.java:5227)
10-10 09:05:21.755: E/AndroidRuntime(22966): at java.lang.reflect.Method.invokeNative(Native Method)
10-10 09:05:21.755: E/AndroidRuntime(22966): at java.lang.reflect.Method.invoke(Method.java:511)
10-10 09:05:21.755: E/AndroidRuntime(22966): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
10-10 09:05:21.755: E/AndroidRuntime(22966): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
10-10 09:05:21.755: E/AndroidRuntime(22966): at dalvik.system.NativeStart.main(Native Method)
10-10 09:05:21.755: E/AndroidRuntime(22966): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class org.holoeverywhere.widget.ProgressBar
10-10 09:05:21.755: E/AndroidRuntime(22966): at org.holoeverywhere.k.a(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at org.holoeverywhere.k.onCreateView(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at org.holoeverywhere.k.a(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at org.holoeverywhere.k.a(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at org.holoeverywhere.k.inflate(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at org.holoeverywhere.k.inflate(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.support.v4.app._HoloActivity.a(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.support.v4.app._HoloActivity.setContentView(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at com.example.workoutlog.OpeningPage.onCreate(Unknown Source)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.Activity.performCreate(Activity.java:5104)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
10-10 09:05:21.755: E/AndroidRuntime(22966): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
10-10 09:05:21.755: E/AndroidRuntime(22966): ... 11 more
10-10 09:05:21.755: E/AndroidRuntime(22966): Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]
10-10 09:05:21.755: E/AndroidRuntime(22966): at java.lang.Class.getConstructorOrMethod(Class.java:460)
10-10 09:05:21.755: E/AndroidRuntime(22966): at java.lang.Class.getConstructor(Class.java:431)
10-10 09:05:21.755: E/AndroidRuntime(22966): ... 23 more
When i run the application from eclispe i dont get any of this error and everyting just running fine.
I think its the pro guard i added the my app but im not sure.
Here is my pro gurad settings:
proguard-project.txt:
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontwarn com.google.**
-dontwarn org.apache.**
-dontwarn twitter4j.**
project.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-18
android.library.reference.1=..\\Application\\Libs android\\actionbarsherlock
android.library.reference.2=..\\Application\\Libs android\\facebook-android-sdk-3.5\\facebook
android.library.reference.3=..\\Application\\Libs android\\AmbilWarna
android.library.reference.4=..\\Application\\Libs android\\HoloEverywhere-master\\addons\\preferences
android.library.reference.5=..\\Application\\Libs android\\HoloEverywhere-master\\library
android.library.reference.6=../Application/Libs android/google-play-services_lib
Thank for helping!

File write permission error in 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.

Categories

Resources