0

I have been working on creating an Android app for a month now. Every time I have tried to run the app it crashes. I am having a very hard time reading LogCat and understanding what it is actually saying to me. So, I created a new project and copied some code from developers.android.com and tried running it, and the same thing happened. I figured it was the virtual device, so I looked up stuff on that and I found that it said I should have the SD card storage configured. So I did that as well. I still have the same problem, and can't run the app! I also have the developer option turned on within my phone as well as the unknown sources option. I only have two activities (MainActivity and Main2Activity)

There is no code in the MainActivity.java file, and there is nothing in the .xml file associated with them. I am trying to do the Up Navigation feature and this is what is happening.

Here is the output from LogCat when I debug the app in a virtual device. If I run the app rather than Debug it, I have a lot more errors but I can't post it because it goes over the 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 to 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 is unrecoverably broken and will be 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 to 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: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                                                         java.lang.Throwable: Explicit termination method 'end' not called
                                                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                                                             at java.util.zip.Inflater.<init>(Inflater.java:82)
                                                                             at com.android.okio.GzipSource.<init>(GzipSource.java:57)
                                                                             at com.android.okhttp.internal.http.HttpEngine.initContentStream(HttpEngine.java:478)
                                                                             at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:668)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:379)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:323)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:491)
                                                                             at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
                                                                             at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
                                                                             at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:802)
                                                                             at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:767)
                                                                             at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:674)
                                                                             at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:658)
                                                                             at com.google.android.gms.auth.be.j.a(SourceFile:209)
                                                                             at com.google.android.gms.auth.be.appcert.a.a(SourceFile:263)
                                                                             at com.google.android.gms.auth.be.appcert.a.a(SourceFile:132)
                                                                             at com.google.android.gms.auth.be.appcert.b.a(SourceFile:43)
                                                                             at com.google.android.gms.auth.b.b.a(SourceFile:62)
                                                                             at com.google.android.gms.auth.b.a.a(SourceFile:120)
                                                                             at com.google.android.gms.auth.b.a.a(SourceFile:61)
                                                                             at com.google.android.gms.auth.be.cron.AuthCronService.a(SourceFile:44)
                                                                             at com.google.android.gms.gcm.au.run(SourceFile:140)
02-02 21:01:16.030 1575-1595/com.google.android.gms.persistent E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                                                         java.lang.Throwable: Explicit termination method 'close' not called
                                                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                                                             at com.google.android.gms.org.conscrypt.Platform.closeGuardOpen(SourceFile:383)
                                                                             at com.google.android.gms.org.conscrypt.OpenSSLSocketImpl.startHandshake(SourceFile:297)
                                                                             at com.google.android.gms.org.conscrypt.KitKatPlatformOpenSSLSocketImplAdapter.startHandshake(SourceFile:318)
                                                                             at com.google.android.gms.common.net.SSLCertificateSocketFactory.a(SourceFile:258)
                                                                             at com.google.android.gms.common.net.SSLCertificateSocketFactory.createSocket(SourceFile:558)
                                                                             at com.android.okhttp.Connection.upgradeToTls(Connection.java:171)
                                                                             at com.android.okhttp.Connection.connect(Connection.java:151)
                                                                             at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)
                                                                             at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:208)
                                                                             at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
                                                                             at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:25)
                                                                             at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:948)
                                                                             at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:766)
                                                                             at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:674)
                                                                             at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:658)
                                                                             at com.google.android.gms.auth.be.j.a(SourceFile:209)
                                                                             at com.google.android.gms.auth.be.appcert.a.a(SourceFile:263)
                                                                             at com.google.android.gms.auth.be.appcert.a.a(SourceFile:132)
                                                                             at com.google.android.gms.auth.be.appcert.b.a(SourceFile:43)
                                                                             at com.google.android.gms.auth.b.b.a(SourceFile:62)
                                                                             at com.google.android.gms.auth.b.a.a(SourceFile:120)
                                                                             at com.google.android.gms.auth.b.a.a(SourceFile:61)
                                                                             at com.google.android.gms.auth.be.cron.AuthCronService.a(SourceFile:44)
                                                                             at com.google.android.gms.gcm.au.run(SourceFile:140)
02-02 21:01:16.040 1575-1595/com.google.android.gms.persistent E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                                                         java.lang.Throwable: Explicit termination method 'close' not called
                                                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                                                             at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:271)
                                                                             at android.net.SSLCertificateSocketFactory.verifyHostname(SSLCertificateSocketFactory.java:190)
                                                                             at android.net.SSLCertificateSocketFactory.createSocket(SSLCertificateSocketFactory.java:435)
                                                                             at com.android.okhttp.Connection.upgradeToTls(Connection.java:171)
                                                                             at com.android.okhttp.Connection.connect(Connection.java:151)
                                                                             at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)
                                                                             at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
                                                                             at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:208)
                                                                             at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
                                                                             at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:25)
                                                                             at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:948)
                                                                             at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:766)
                                                                             at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:674)
                                                                             at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:658)
                                                                             at com.google.android.gms.phenotype.service.sync.PhenotypeConfigurator.a(SourceFile:1353)
                                                                             at com.google.android.gms.phenotype.service.sync.PhenotypeConfigurator.a(SourceFile:799)
                                                                             at com.google.android.gms.phenotype.service.sync.PhenotypeConfigurator.a(SourceFile:753)
                                                                             at com.google.android.gms.phenotype.service.sync.PhenotypeConfigurator.c(SourceFile:475)
                                                                             at com.google.android.gms.phenotype.service.sync.PhenotypeConfigurator.a(SourceFile:438)
                                                                             at com.google.android.gms.gcm.au.run(SourceFile:140)
02-02 21:01:16.110 951-1292/? E/Drm: Failed to find drm plugin
02-02 21:01:18.650 951-1292/? E/Drm: Failed to find drm plugin

Here is 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 with your own action", Snackbar.LENGTH_LONG)
                    .setAction("Action", null).show();
        }
    });
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        // Respond to the action bars up/home button
        case android.R.id.home:
            NavUtils.navigateUpFromSameTask(this);
            return true;
    }
    return super.onOptionsItemSelected(item);
}

}
Andy
  • 1
  • 2
  • do some research into memory leaks, this line is repeated at the start of each error message: A resource was acquired at attached stack trace but never released. This http://stackoverflow.com/questions/25544021/a-resource-was-acquired-at-attached-stack-trace-but-never-released-see-java-io question may be a good place to start. – Theyna Feb 03 '16 at 02:14
  • I didn't open anything though. I looked at it and I can't find anything wrong with it – Andy Feb 05 '16 at 04:44

0 Answers0