Zygote Errors in Android Studio - android

I am getting these errors in Android Studio (logcat) when apps are being run
06-05 22:59:03.664 23521-23521/com.policia E/Zygote﹕ Zygote: error closing descriptor
libcore.io.ErrnoException: close failed: EBADF (Bad file number)
at libcore.io.Posix.close(Native Method)
at libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)
at com.android.internal.os.ZygoteInit.closeServerSocket(ZygoteInit.java:224)
at com.android.internal.os.ZygoteConnection.handleChildProc(ZygoteConnection.java:879)
at com.android.internal.os.ZygoteConnection.runOnce(ZygoteConnection.java:242)
at com.android.internal.os.ZygoteInit.runSelectLoop(ZygoteInit.java:704)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
can anybody tell me what causes these errors and how to solve them?

Related

Can't load any external fonts in android studio

Update:
I created an asset folder and inside of it is a century.ttf file. First I got a wrong encoding problem but after I followed these steps after File was loaded in the wrong encoding 'UTF-8' while pasting new font to Assets Folder in Android Studio the error message disappeared.
Then I wrote into my MainActivity:
FOURTH UPDATE:
Typeface typeface = Typeface.createFromAsset(getAssets(),"century.ttf");
Text.setTypeface(typrface);
But then my app suddenly stops.
FOURTH UPDATE:
09-08 20:17:54.742 1266-1301/? E/cutils: Failed to mkdir(/data/system/users/0): No such file or directory
09-08 20:17:54.742 1266-1301/? E/vold: Failed to prepare /data/system/users/0: No such file or directory
09-08 20:17:54.743 1266-1301/? E/vold: Failed to prepare user 0 storage
09-08 20:17:54.822 1266-1314/? E/Cryptfs: Bad magic for real block device /dev/block/vdd
09-08 20:17:54.742 1266-1301/? E/cutils: Failed to mkdir(/data/system/users/0): No such file or directory
09-08 20:17:54.742 1266-1301/? E/vold: Failed to prepare /data/system/users/0: No such file or directory
09-08 20:17:54.743 1266-1301/? E/vold: Failed to prepare user 0 storage
09-08 20:17:54.822 1266-1314/? E/Cryptfs: Bad magic for real block device /dev/block/vdd
09-08 20:17:56.997 1310-1310/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
09-08 20:17:57.012 1266-1301/? E/vold: Failed to chmod /data/system_ce/0: No such file or directory
09-08 20:17:57.012 1266-1301/? E/vold: Failed to chmod /data/misc_ce/0: No such file or directory
09-08 20:17:57.012 1266-1301/? E/vold: Failed to chmod /data/media/0: No such file or directory
09-08 20:17:57.048 1310-1310/? E/SurfaceFlinger: hwcomposer module not found
09-08 20:17:57.851 1310-1326/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
09-08 20:17:57.853 1340-1345/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
09-08 20:18:05.693 1266-1301/? E/vold: Failed to chmod /data/system_ce/0: No such file or directory
09-08 20:18:05.693 1266-1301/? E/vold: Failed to chmod /data/misc_ce/0: No such file or directory
09-08 20:18:05.693 1266-1301/? E/vold: Failed to chmod /data/media/0: No such file or directory
09-08 20:18:05.928 1405-1405/? E/cutils: Failed to read /data/.layout_version: No such file or directory
[ 09-08 20:18:05.928 1405: 1405 D/ ]
Assuming that device has multi-user storage layout; upgrade no longer supported
[ 09-08 20:18:05.928 1405: 1405 D/ ]
Upgrading to /data/misc/user directories
09-08 20:18:05.968 1416-1416/? E/perfprofd: unable to open configuration file /data/data/com.google.android.gms/files/perfprofd.conf
09-08 20:18:06.123 1403-1403/? E/EmulatedCamera_Factory: 2 cameras are being emulated. 0 of them are fake cameras.
09-08 20:18:06.123 1403-1403/? E/EmulatedCamera_HotplugThread: createFileIfNotExists: Could not create file '/data/misc/media/emulator.camera.hotplug.0', error: 'Permission denied' (13)
09-08 20:18:06.123 1403-1403/? E/EmulatedCamera_HotplugThread: createFileIfNotExists: Could not create file '/data/misc/media/emulator.camera.hotplug.1', error: 'Permission denied' (13)
09-08 20:18:06.123 1403-1403/? E/CameraService: setUpVendorTags: Vendor tag operations not fully defined. Ignoring definitions.
09-08 20:18:06.204 1402-1402/? E/RadioService: couldn't load radio module radio.primary (No such file or directory)
09-08 20:18:06.204 1402-1402/? E/SoundTriggerHwService: couldn't load sound trigger module sound_trigger.primary (No such file or directory)
09-08 20:18:07.021 1534-1534/? E/ipv6proxy: Failed to forward Neighbor Solicitation for fe80::5c01:45ff:fe1b:e65c from radio0-peer to eth0: Cannot assign requested address
09-08 20:18:07.039 1544-1544/? E/hostapd: Configuration file: /system/etc/simulated_hostapd.conf
09-08 20:18:07.308 1401-1401/? E/memtrack: Couldn't load memtrack module (No such file or directory)
09-08 20:18:07.308 1401-1401/? E/android.os.Debug: failed to load memtrack module: -2
09-08 20:18:07.695 1401-1401/? E/Typeface: Error mapping font file /system/fonts/DroidSansFallback.ttf
09-08 20:18:08.021 1534-1534/? E/ipv6proxy: Failed to forward Router Advertisement from eth0 to wlan1: Network is unreachable
09-08 20:18:08.021 1534-1534/? E/ipv6proxy: Failed to forward Router Advertisement from eth0 to radio0-peer: Cannot assign requested address
09-08 20:18:08.231 1411-1411/? E/Netd: cannot find interface dummy0
09-08 20:18:08.398 1401-1401/? E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
09-08 20:18:08.423 1401-1401/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-as.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-nb.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743) 
09-08 20:18:08.430 1401-1401/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-nn.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-nn.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743) 
09-08 20:18:08.430 1401-1401/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-or.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-or.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743) 
09-08 20:18:08.430 1401-1401/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-pa.hyb
java.io.FileNotFoundException: /system/usr/hyphen-data/hyph-pa.hyb: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:455)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247)
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118)
at android.text.Hyphenator.init(Hyphenator.java:224)
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252)
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:187)
at libcore.io.IoBridge.open(IoBridge.java:441)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:247) 
at android.text.Hyphenator.loadHyphenator(Hyphenator.java:118) 
at android.text.Hyphenator.init(Hyphenator.java:224) 
at com.android.internal.os.ZygoteInit.preloadTextResources(ZygoteInit.java:252) 
at com.android.internal.os.ZygoteInit.preload(ZygoteInit.java:206) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743) 
09-08 20:18:08.431 1401-1401/? E/Hyphenator: error loading hyphenation /system/usr/hyphen-data/hyph-pt.hyb
Process: com.example.fdai3744.t_online20, PID: 3050
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fdai3744.t_online20/com.example.fdai3744.t_online20.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTypeface(android.graphics.Typeface)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTypeface(android.graphics.Typeface)' on a null object reference
at com.example.fdai3744.t_online20.MainActivity.onCreate(MainActivity.java:25)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
FOURTH UPDATE:
Follow the instructions in the link below and go to the manifest file and add android:name="the-below-implementation" under application xml tag
https://github.com/chrisjenx/Calligraphy
Considering you use ttf fonts in asset folder, generate typeface like this.
Typeface typeface = Typeface.createFromAsset(getAssets(),"YourFontName.ttf");
Text.setTypeface(typrface);
Your code is requesting font/century (see: Caused by: java.lang.RuntimeException: Font asset not found font/century). The actual asset is font/century.tff (according to your comment), or possibly font/century.ttf (which would be the more likely file extension for TrueType fonts).
The font path you provide needs to match the actual path in assets/, including file extensions.
Try putting the ttf file into a "fonts" folder inside the "Assets" folder and then change the source path "fonts/century.ttf". My guess is that the file isn't being recognized as a font file.
This is how I have it set-up in one of my projects:

Android didn't find application class crash

In Manifest I declared
<application
android:name=com.example.App>
When the app starts, sometimes this crash happens:
java.lang.RuntimeException: Unable to instantiate application com.example.App: java.lang.ClassNotFoundException: Didn't find class "com.example.App" on path: DexPathList[[zip file "/mnt/asec/com.example.myapp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.myapp-1/lib, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4514)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Is it possible to fix it somehow?
This doesn't seems to be an app crash. This is just a verbose message raised when dalvik reinstall the apk.It won't occur on end-user's device.To fix it on your development machine, just clean and rebuild.

LocalFingerprints: cannot compute fingerprint

I am getting one strange error it occurs randomly to any time and crashes the app. i am testing on nexus 6 in Android 7.0
here is log cat
E/LocalFingerprints: cannot compute fingerprint for: content://media/external/images/media/306155
java.io.IOException: read failed: EISDIR (Is a directory)
at libcore.io.IoBridge.read(IoBridge.java:481)
at java.io.FileInputStream.read(FileInputStream.java:252)
at android.os.ParcelFileDescriptor$AutoCloseInputStream.read(ParcelFileDescriptor.java:889)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at java.security.DigestInputStream.read(DigestInputStream.java:161)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at kei.b(PG:81)
at imp.a(PG:1324)
at ilf.a(PG:131)
at com.google.android.libraries.social.autobackup.FingerprintScannerIntentService.onHandleIntent(PG:81)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.system.ErrnoException: read failed: EISDIR (Is a directory)
at libcore.io.Posix.readBytes(Native Method)
at libcore.io.Posix.read(Posix.java:169)
at libcore.io.BlockGuardOs.read(BlockGuardOs.java:231)
at libcore.io.IoBridge.read(IoBridge.java:471)
at java.io.FileInputStream.read(FileInputStream.java:252) 
at android.os.ParcelFileDescriptor$AutoCloseInputStream.read(ParcelFileDescriptor.java:889) 
at java.io.BufferedInputStream.read1(BufferedInputStream.java:273) 
at java.io.BufferedInputStream.read(BufferedInputStream.java:334) 
at java.security.DigestInputStream.read(DigestInputStream.java:161) 
at java.io.FilterInputStream.read(FilterInputStream.java:107) 
at kei.b(PG:81) 
at imp.a(PG:1324) 
at ilf.a(PG:131) 
at com.google.android.libraries.social.autobackup.FingerprintScannerIntentService.onHandleIntent(PG:81) 
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.os.HandlerThread.run(HandlerThread.java:61) 

Cocos2d-x v3.7.1 Unfortunately, libcocos2dx has stopped

I'm compiling a new project through proj.android-studio using:
cocos compile -p android --android-studio
But when I start app on android device, it shows me a message:
Unfortunately, libcocos2dx has stopped
Can you help me? What I'm doing wrong?
Here is logcat:
09-07 12:07:47.711 23074-23074/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: org.cocos2dx.TestGame, PID: 23074
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "srand" referenced by "libcocos2dcpp.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:553)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:288)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:303)
at android.app.Activity.performCreate(Activity.java:5343)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2429)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5341)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Usually the app stops working if your code contains errors.
Are there errors in your code? What does the LogCat say?

MySQLNonTransientConnectionException: Could not create connection to database server

I am dealing with a strange problem connecting to my MySQL database on Amazon RDS using JDBC. I have two different Android phones on the same network running the same code. One connects without any problems. The other is giving me the following exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2547)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:822)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
at java.sql.DriverManager.getConnection(DriverManager.java:175)
at java.sql.DriverManager.getConnection(DriverManager.java:209)
at edu.ucsb.cs.epsilon.ucsb360.DatabaseManager.Connect(DatabaseManager.java:32)
at edu.ucsb.cs.epsilon.ucsb360.Global.applicationResumed(Global.java:31)
at edu.ucsb.cs.epsilon.ucsb360.MainActivity.onResume(MainActivity.java:54)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1236)
at android.app.Activity.performResume(Activity.java:4625)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2834)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2889)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1190)
at java.net.InetAddress.lookupHostByName(InetAddress.java:394)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:245)
at java.net.InetAddress.getAllByName(InetAddress.java:220)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:249)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:305)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2461)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2498)
The database only shows 1 active connection, so I know it is not because of too many open connections. I have tried rebooting the server, but it didn't help. I am using the MySQL JDBC Connector/J version 5.1.23. The phone that works is running Android version 2.3.5 and the one that doesn't work is running Android version 4.0.4. Does anyone have any ideas as to what might be wrong?
Thanks!
Caused by: android.os.NetworkOnMainThreadException
You can't do network IO on the main thread. Move it to an AsyncTask or thread.

Categories

Resources