Reputation: 704
I have an Android App that is running perfectly on a version 2.3 device and one particular 4.1 emulator. It crashes on other 4.1 emulators as well as 4.1 Google Nexus device.
Any ideas?
Does this have anything to do with the size, resolution etc?
Here's the logcat output when I run it on a 4.1 emulator. Actually the code is huge, so can't really put that up here. Any hints would be great. Then I could put up the required code snippet.
10-01 11:42:30.404: E/Trace(623): error opening trace file: No such file or directory (2)
10-01 11:42:30.754: D/dalvikvm(623): GC_FOR_ALLOC freed 126K, 3% free 8126K/8327K, paused 42ms, total 44ms
10-01 11:42:30.794: D/AndroidRuntime(623): Shutting down VM
10-01 11:42:30.794: W/dalvikvm(623): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
10-01 11:42:30.804: E/AndroidRuntime(623): FATAL EXCEPTION: main
10-01 11:42:30.804: E/AndroidRuntime(623): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.example.android_compliance/com.example.android_compliance.MainActivity}: java.lang.NullPointerException
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.access$600(ActivityThread.java:130)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.os.Handler.dispatchMessage(Handler.java:99)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.os.Looper.loop(Looper.java:137)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-01 11:42:30.804: E/AndroidRuntime(623): at java.lang.reflect.Method.invokeNative(Native Method)
10-01 11:42:30.804: E/AndroidRuntime(623): at java.lang.reflect.Method.invoke(Method.java:511)
10-01 11:42:30.804: E/AndroidRuntime(623): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-01 11:42:30.804: E/AndroidRuntime(623): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-01 11:42:30.804: E/AndroidRuntime(623): at dalvik.system.NativeStart.main(Native Method)
10-01 11:42:30.804: E/AndroidRuntime(623): Caused by: java.lang.NullPointerException
10-01 11:42:30.804: E/AndroidRuntime(623): at com.example.android_compliance.MainActivity.onCreate(MainActivity.java:261)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.Activity.performCreate(Activity.java:5008)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
10-01 11:42:30.804: E/AndroidRuntime(623): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
10-01 11:42:30.804: E/AndroidRuntime(623): ... 11 more
10-01 11:43:33.693: I/Process(623): Sending signal. PID: 623 SIG: 9
Upvotes: 1
Views: 549
Reputation: 704
so herez the method that returns null on 4.1
public String visiblepassword() {
String inputm = android.provider.Settings.System.getString(getContentResolver(), android.provider.Settings.System.TEXT_SHOW_PASSWORD);
return inputm;
}
very very strangely it returns null in only one scenario...when i install the app on the device for the first time with the visible password setting enabled. so if i install first with setting disabled, it works fine. once installed, it works fine even if i change the setting and rerun the app. after initial install it returns the appropriate 1 or 0.
any ideas?
Upvotes: 0
Reputation: 5554
I think you may need to make some changes in your AndroidManifest file. They have changed some permissions and the like.
Upvotes: 0
Reputation: 311
Have you tried applying the range of the app's SDK version in the manifest file?
Like for example the line that looks like this:
<uses-sdk android:minSdkVersion="7" android:maxSdkVersion="15"/>
Upvotes: 1