Мое приложение не загружается и работает из-за проблем с эмулятором - PullRequest
0 голосов
/ 16 февраля 2019

Я новичок в разработке для Android и пытаюсь разработать приложение для заказа еды для Android для своего проекта.У меня нет опыта в программировании, и я занимаюсь разработкой приложения с использованием курса Youtube и Udacity для Android.Однако всякий раз, когда я пытаюсь увидеть прогресс моего приложения в эмуляторе Android, я сталкиваюсь с некоторой формой ошибки, которая не позволяет мне увидеть, как мое приложение выглядит в эмуляторе.Последняя проблема, с которой я сталкиваюсь:

com.google.android.instantapps.sdk.lib.AdbHelper$AdbCommandException: ADB 
command timed out: [shell, pm dump com.example.broncogrill]
Command output:

Error while Uploading and launching Instant App

Я не могу понять, почему эта проблема существует.Что-то не так с моим кодом или есть какая-то другая проблема с эмулятором, которая не позволяет загружать и запускать приложение?

Я пытался отключить мгновенный запуск, но это не сработало.Затем я попытался увеличить время соединения с 5000 до 50000 миллисекунд.

 package com.example.broncogrill;

 import android.graphics.Typeface;
 import android.os.Bundle;

 import 
 com.google.android.material.floatingactionbutton.FloatingActionButton;
 import com.google.android.material.snackbar.Snackbar;

 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;

 import android.view.View;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.widget.Button;
 import android.widget.TextView;

 public class MainActivity extends AppCompatActivity {

 Button btnSignIn, btnSignUp;
 TextView txtSlogan;


 @Override
 protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);

     btnSignIn = (Button)findViewById(R.id.btnSignIn);
     btnSignUp = (Button)findViewById(R.id.btnSignUp);

     txtSlogan = (TextView)findViewById(R.id.txtSlogan);
     Typeface face = 
     Typeface.createFromAsset(getAssets(),"fonts/NABILA.TTF");
     txtSlogan.setTypeface(face);

     btnSignIn.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {

         }
     });

     btnSignUp.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {

         }
     });

     Toolbar toolbar = findViewById(R.id.toolbar);
     setSupportActionBar(toolbar);

     FloatingActionButton fab = 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 onCreateOptionsMenu(Menu menu) {
     // Inflate the menu; this adds items to the action bar if it is present.
     getMenuInflater().inflate(R.menu.menu_main, menu);
     return true;
 }

 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
     // Handle action bar item clicks here. The action bar will
     // automatically handle clicks on the Home/Up button, so long
     // as you specify a parent activity in AndroidManifest.xml.
     int id = item.getItemId();

     //noinspection SimplifiableIfStatement
     if (id == R.id.action_settings) {
         return true;
     }

     return super.onOptionsItemSelected(item);
 }
 }

build.gradle

   apply plugin: 'com.android.application'

    android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.broncogrill"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    }

    dependencies {
    implementation 'com.github.jd-alexander:android-flat-button:v1.1'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:25.1.0'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
    implementation 'com.google.android.material:material:1.0.0-beta01'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0- 
    alpha4'

    // Add Libraries
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-database:16.0.6'

    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    }
    apply plugin: 'com.google.gms.google-services'

Я просто хочу решить эту проблему и запустить приложение на эмуляторе, чтобы перенести его на телефон и выполнить демонстрациюв моем классе

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...