java - App crashes on AVD and on physical phone -
i have been working on creating android app month now. every time have tried run app crashes. having hard time reading logcat , understanding saying me. so, created new project , copied code developers.android.com , tried running it, , same thing happened. figured virtual device, looked stuff on , found said should have sd card storage configured. did well. still have same problem, , can't run app! have developer option turned on within phone unknown sources option. have 2 activities (mainactivity , main2activity)
there no code in mainactivity.java file, , there nothing in .xml file associated them. trying navigation feature , happening.
here output logcat when debug app in virtual device. if run app rather debug it, have lot more errors can't post because goes on max character count:
02-02 20:58:53.710 15712-15712/? e/memtrack: couldn't load memtrack module (no such file or directory) 02-02 20:58:53.710 15712-15712/? e/android.os.debug: failed load memtrack module: -2 02-02 20:58:53.740 1299-1332/system_process e/inputdispatcher: channel '1219634a com.jetlabb.thegoods/com.jetlabb.thegoods.mainactivity (server)' ~ channel unrecoverably broken , disposed! 02-02 20:58:54.500 15738-15738/? e/memtrack: couldn't load memtrack module (no such file or directory) 02-02 20:58:54.500 15738-15738/? e/android.os.debug: failed load memtrack module: -2 02-02 20:58:54.540 940-940/? e/egl_emulation: tid 940: eglcreatesynckhr(1237): error 0x3004 (egl_bad_attribute) 02-02 20:58:54.680 15748-15755/? e/art: failed writing handshake bytes (-1 of 14): broken pipe 02-02 21:01:16.030 1575-1595/com.google.android.gms.persistent e/strictmode: resource acquired @ attached stack trace never released. see java.io.closeable information on avoiding resource leaks. java.lang.throwable: explicit termination method 'end' not called @ dalvik.system.closeguard.open(closeguard.java:184) @ java.util.zip.inflater.<init>(inflater.java:82) @ com.android.okio.gzipsource.<init>(gzipsource.java:57) @ com.android.okhttp.internal.http.httpengine.initcontentstream(httpengine.java:478) @ com.android.okhttp.internal.http.httpengine.readresponse(httpengine.java:668) @ com.android.okhttp.internal.http.httpurlconnectionimpl.execute(httpurlconnectionimpl.java:379) @ com.android.okhttp.internal.http.httpurlconnectionimpl.getresponse(httpurlconnectionimpl.java:323) @ com.android.okhttp.internal.http.httpurlconnectionimpl.getresponsecode(httpurlconnectionimpl.java:491) @ com.android.okhttp.internal.http.delegatinghttpsurlconnection.getresponsecode(delegatinghttpsurlconnection.java:105) @ com.android.okhttp.internal.http.httpsurlconnectionimpl.getresponsecode(httpsurlconnectionimpl.java:25) @ com.google.android.gms.http.googlehttpclient.a(sourcefile:802) @ com.google.android.gms.http.googlehttpclient.a(sourcefile:767) @ com.google.android.gms.http.googlehttpclient.execute(sourcefile:674) @ com.google.android.gms.http.googlehttpclient.execute(sourcefile:658) @ com.google.android.gms.auth.be.j.a(sourcefile:209) @ com.google.android.gms.auth.be.appcert.a.a(sourcefile:263) @ com.google.android.gms.auth.be.appcert.a.a(sourcefile:132) @ com.google.android.gms.auth.be.appcert.b.a(sourcefile:43) @ com.google.android.gms.auth.b.b.a(sourcefile:62) @ com.google.android.gms.auth.b.a.a(sourcefile:120) @ com.google.android.gms.auth.b.a.a(sourcefile:61) @ com.google.android.gms.auth.be.cron.authcronservice.a(sourcefile:44) @ com.google.android.gms.gcm.au.run(sourcefile:140) 02-02 21:01:16.030 1575-1595/com.google.android.gms.persistent e/strictmode: resource acquired @ attached stack trace never released. see java.io.closeable information on avoiding resource leaks. java.lang.throwable: explicit termination method 'close' not called @ dalvik.system.closeguard.open(closeguard.java:184) @ com.google.android.gms.org.conscrypt.platform.closeguardopen(sourcefile:383) @ com.google.android.gms.org.conscrypt.opensslsocketimpl.starthandshake(sourcefile:297) @ com.google.android.gms.org.conscrypt.kitkatplatformopensslsocketimpladapter.starthandshake(sourcefile:318) @ com.google.android.gms.common.net.sslcertificatesocketfactory.a(sourcefile:258) @ com.google.android.gms.common.net.sslcertificatesocketfactory.createsocket(sourcefile:558) @ com.android.okhttp.connection.upgradetotls(connection.java:171) @ com.android.okhttp.connection.connect(connection.java:151) @ com.android.okhttp.internal.http.httpengine.connect(httpengine.java:276) @ com.android.okhttp.internal.http.httpengine.sendrequest(httpengine.java:211) @ com.android.okhttp.internal.http.httpurlconnectionimpl.execute(httpurlconnectionimpl.java:373) @ com.android.okhttp.internal.http.httpurlconnectionimpl.connect(httpurlconnectionimpl.java:106) @ com.android.okhttp.internal.http.httpurlconnectionimpl.getoutputstream(httpurlconnectionimpl.java:208) @ com.android.okhttp.internal.http.delegatinghttpsurlconnection.getoutputstream(delegatinghttpsurlconnection.java:218) @ com.android.okhttp.internal.http.httpsurlconnectionimpl.getoutputstream(httpsurlconnectionimpl.java:25) @ com.google.android.gms.http.googlehttpclient.a(sourcefile:948) @ com.google.android.gms.http.googlehttpclient.a(sourcefile:766) @ com.google.android.gms.http.googlehttpclient.execute(sourcefile:674) @ com.google.android.gms.http.googlehttpclient.execute(sourcefile:658) @ com.google.android.gms.auth.be.j.a(sourcefile:209) @ com.google.android.gms.auth.be.appcert.a.a(sourcefile:263) @ com.google.android.gms.auth.be.appcert.a.a(sourcefile:132) @ com.google.android.gms.auth.be.appcert.b.a(sourcefile:43) @ com.google.android.gms.auth.b.b.a(sourcefile:62) @ com.google.android.gms.auth.b.a.a(sourcefile:120) @ com.google.android.gms.auth.b.a.a(sourcefile:61) @ com.google.android.gms.auth.be.cron.authcronservice.a(sourcefile:44) @ com.google.android.gms.gcm.au.run(sourcefile:140) 02-02 21:01:16.040 1575-1595/com.google.android.gms.persistent e/strictmode: resource acquired @ attached stack trace never released. see java.io.closeable information on avoiding resource leaks. java.lang.throwable: explicit termination method 'close' not called @ dalvik.system.closeguard.open(closeguard.java:184) @ com.android.org.conscrypt.opensslsocketimpl.starthandshake(opensslsocketimpl.java:271) @ android.net.sslcertificatesocketfactory.verifyhostname(sslcertificatesocketfactory.java:190) @ android.net.sslcertificatesocketfactory.createsocket(sslcertificatesocketfactory.java:435) @ com.android.okhttp.connection.upgradetotls(connection.java:171) @ com.android.okhttp.connection.connect(connection.java:151) @ com.android.okhttp.internal.http.httpengine.connect(httpengine.java:276) @ com.android.okhttp.internal.http.httpengine.sendrequest(httpengine.java:211) @ com.android.okhttp.internal.http.httpurlconnectionimpl.execute(httpurlconnectionimpl.java:373) @ com.android.okhttp.internal.http.httpurlconnectionimpl.connect(httpurlconnectionimpl.java:106) @ com.android.okhttp.internal.http.httpurlconnectionimpl.getoutputstream(httpurlconnectionimpl.java:208) @ com.android.okhttp.internal.http.delegatinghttpsurlconnection.getoutputstream(delegatinghttpsurlconnection.java:218) @ com.android.okhttp.internal.http.httpsurlconnectionimpl.getoutputstream(httpsurlconnectionimpl.java:25) @ com.google.android.gms.http.googlehttpclient.a(sourcefile:948) @ com.google.android.gms.http.googlehttpclient.a(sourcefile:766) @ com.google.android.gms.http.googlehttpclient.execute(sourcefile:674) @ com.google.android.gms.http.googlehttpclient.execute(sourcefile:658) @ com.google.android.gms.phenotype.service.sync.phenotypeconfigurator.a(sourcefile:1353) @ com.google.android.gms.phenotype.service.sync.phenotypeconfigurator.a(sourcefile:799) @ com.google.android.gms.phenotype.service.sync.phenotypeconfigurator.a(sourcefile:753) @ com.google.android.gms.phenotype.service.sync.phenotypeconfigurator.c(sourcefile:475) @ com.google.android.gms.phenotype.service.sync.phenotypeconfigurator.a(sourcefile:438) @ com.google.android.gms.gcm.au.run(sourcefile:140) 02-02 21:01:16.110 951-1292/? e/drm: failed find drm plugin 02-02 21:01:18.650 951-1292/? e/drm: failed find drm plugin
here androidmanifest:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.jetlabb.thegoods"> <uses-permission android:name="android.permission.read_external_storage"/> <uses-permission android:name="android.permission.write_external_storage"/> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name=".mainactivity" android:label="@string/app_name" android:theme="@style/apptheme.noactionbar"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <!-- child activity of main activity --> <activity android:name=".main2activity" android:label="@string/title_activity_main2" android:parentactivityname=".mainactivity" android:theme="@style/apptheme.noactionbar"> <meta-data android:name="android.support.parent_activity" android:value=".mainactivity" /> </activity> </application>
main2activity.java
import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.snackbar; import android.support.v4.app.navutils; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.menuitem; import android.view.view; public class main2activity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main2); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); getactionbar().setdisplayhomeasupenabled(true); floatingactionbutton fab = (floatingactionbutton) findviewbyid(r.id.fab); fab.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { snackbar.make(view, "replace own action", snackbar.length_long) .setaction("action", null).show(); } }); } @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { // respond action bars up/home button case android.r.id.home: navutils.navigateupfromsametask(this); return true; } return super.onoptionsitemselected(item); } }
Comments
Post a Comment