Autore Topic: Non riesco a eseguire il progetto  (Letto 402 volte)

Offline oberdank

  • Utente normale
  • ***
  • Post: 287
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    Samsung Galaxy Core LTE
  • Play Store ID:
    BuzzOne
  • Sistema operativo:
    Windows 8.1
Non riesco a eseguire il progetto
« il: 29 Agosto 2014, 09:49:20 CEST »
0
Ho da ieri iniziato a leggere un libro sulla programmazione Android.
Ho scaricato dal sito dell'editore un progetto (per Eclipse) di esempio.
Quando lancio il progetto sul pannello “Console” mi appaiono le seguenti scritte (da notare che due scritte sono in rosso).



[2014-08-29 09:28:31 - ProvaProject-2] ------------------------------
[2014-08-29 09:28:31 - ProvaProject-2] Android Launch!
[2014-08-29 09:28:31 - ProvaProject-2] adb is running normally.
[2014-08-29 09:28:31 - ProvaProject-2] Performing example.provaproject_2.MainActivity activity launch
[2014-08-29 09:28:31 - ProvaProject-2] Automatic Target Mode: launching new emulator with compatible AVD 'ProvaEmulatore-2'
[2014-08-29 09:28:31 - ProvaProject-2] Launching a new emulator with Virtual Device 'ProvaEmulatore-2'
[2014-08-29 09:28:33 - Emulator] emulator: warning: opening audio output failed
[2014-08-29 09:28:33 - Emulator]
[2014-08-29 09:28:33 - ProvaProject-2] New emulator found: emulator-5554
[2014-08-29 09:28:33 - ProvaProject-2] Waiting for HOME ('android.process.acore') to be launched...
[2014-08-29 09:28:52 - ProvaProject-2] HOME is up on device 'emulator-5554'
[2014-08-29 09:28:52 - ProvaProject-2] Uploading ProvaProject-2.apk onto device 'emulator-5554'
[2014-08-29 09:28:52 - ProvaProject-2] Installing ProvaProject-2.apk...
[2014-08-29 09:28:57 - ProvaProject-2] Success!
[2014-08-29 09:28:57 - ProvaProject-2] Starting activity example.provaproject_2.MainActivity on device emulator-5554
[2014-08-29 09:28:58 - ProvaProject-2] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=example.provaproject_2/.MainActivity }
[2014-08-29 09:37:27 - IntoProject] Dx
trouble writing output: already prepared
[2014-08-29 09:37:27 - IntoProject] ------------------------------
[2014-08-29 09:37:27 - IntoProject] Android Launch!
[2014-08-29 09:37:27 - IntoProject] adb is running normally.
[2014-08-29 09:37:27 - IntoProject] Performing com.haseman.peachPit.MyActivity activity launch
[2014-08-29 09:37:27 - IntoProject] Automatic Target Mode: launching new emulator with compatible AVD 'ProvaEmulatore-2'
[2014-08-29 09:37:27 - IntoProject] Launching a new emulator with Virtual Device 'ProvaEmulatore-2'
[2014-08-29 09:37:27 - Emulator] emulator: warning: opening audio output failed
[2014-08-29 09:37:27 - Emulator]
[2014-08-29 09:37:27 - IntoProject] New emulator found: emulator-5554
[2014-08-29 09:37:27 - IntoProject] Waiting for HOME ('android.process.acore') to be launched...
[2014-08-29 09:37:45 - IntoProject] WARNING: Application does not specify an API level requirement!
[2014-08-29 09:37:45 - IntoProject] Device API version is 10 (Android 2.3.3)
[2
014-08-29 09:37:45 - IntoProject] HOME is up on device 'emulator-5554'
[2014-08-29 09:37:45 - IntoProject] Uploading IntoProject.apk onto device 'emulator-5554'
[2014-08-29 09:37:45 - IntoProject] Installing IntoProject.apk...
[2014-08-29 09:37:47 - IntoProject] Success!
[2014-08-29 09:37:47 - IntoProject] Starting activity com.haseman.peachPit.MyActivity on device emulator-5554
[2014-08-29 09:37:48 - IntoProject] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.haseman.peachPit/.MyActivity }

Offline bradipao

  • Moderatore globale
  • Utente storico
  • *****
  • Post: 4043
  • keep it simple
  • Respect: +567
    • Github
    • Google+
    • bradipao
    • Mostra profilo
  • Dispositivo Android:
    Nexus 5
  • Play Store ID:
    Bradipao
  • Sistema operativo:
    W7
Re:Non riesco a eseguire il progetto
« Risposta #1 il: 29 Agosto 2014, 10:00:39 CEST »
0
Sembra tutto corretto:

Citazione
[2014-08-29 09:37:45 - IntoProject] Installing IntoProject.apk...
[2014-08-29 09:37:47 - IntoProject] Success!

Dovrebbe apparirti l'activity sul display, oppure un messaggio d'errore in caso ci sia crash immediato.
NON rispondo a domande nei messaggi privati
Bradipao @ Play Store

Offline oberdank

  • Utente normale
  • ***
  • Post: 287
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    Samsung Galaxy Core LTE
  • Play Store ID:
    BuzzOne
  • Sistema operativo:
    Windows 8.1
Re:Non riesco a eseguire il progetto
« Risposta #2 il: 29 Agosto 2014, 10:27:52 CEST »
0
E allora perche' ci sono quelle scritte in ROSSO?
Si tratta di warning che e' possible ignorare?

Da Eclipse ho cliccato su “File>New>Android Application Project” e ho creato il progetto “ProvaProject-3”, dopo ho selezionato “ProvaProject-3” sul pannello “Package Explorer” e quindi ho cliccato su “Run>Run As>Android Application”, e sul pannello
“Console” mi appaiono le seguenti scritte.

Da notare che ci sono scritte anche per i progetti “ProvaProject-2” e “IntoProject”.


[2014-08-29 09:28:31 - ProvaProject-2] ------------------------------
[2014-08-29 09:28:31 - ProvaProject-2] Android Launch!
[2014-08-29 09:28:31 - ProvaProject-2] adb is running normally.
[2014-08-29 09:28:31 - ProvaProject-2] Performing example.provaproject_2.MainActivity activity launch
[2014-08-29 09:28:31 - ProvaProject-2] Automatic Target Mode: launching new emulator with compatible AVD 'ProvaEmulatore-2'
[2014-08-29 09:28:31 - ProvaProject-2] Launching a new emulator with Virtual Device 'ProvaEmulatore-2'
[2014-08-29 09:28:33 - Emulator] emulator: warning: opening audio output failed
[2014-08-29 09:28:33 - Emulator]
[2014-08-29 09:28:33 - ProvaProject-2] New emulator found: emulator-5554
[2014-08-29 09:28:33 - ProvaProject-2] Waiting for HOME ('android.process.acore') to be launched...
[2014-08-29 09:28:52 - ProvaProject-2] HOME is up on device 'emulator-5554'
[2014-08-29 09:28:52 - ProvaProject-2] Uploading ProvaProject-2.apk onto device 'emulator-5554'
[2014-08-29 09:28:52 - ProvaProject-2] Installing ProvaProject-2.apk...
[2014-08-29 09:28:57 - ProvaProject-2] Success!
[2014-08-29 09:28:57 - ProvaProject-2] Starting activity example.provaproject_2.MainActivity on device emulator-5554
[2014-08-29 09:28:58 - ProvaProject-2] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=example.provaproject_2/.MainActivity }
[2014-08-29 09:37:27 - IntoProject] Dx
trouble writing output: already prepared
[2014-08-29 09:37:27 - IntoProject] ------------------------------
[2014-08-29 09:37:27 - IntoProject] Android Launch!
[2014-08-29 09:37:27 - IntoProject] adb is running normally.
[2014-08-29 09:37:27 - IntoProject] Performing com.haseman.peachPit.MyActivity activity launch
[2014-08-29 09:37:27 - IntoProject] Automatic Target Mode: launching new emulator with compatible AVD 'ProvaEmulatore-2'
[2014-08-29 09:37:27 - IntoProject] Launching a new emulator with Virtual Device 'ProvaEmulatore-2'
[2014-08-29 09:37:27 - Emulator] emulator: warning: opening audio output failed
[2014-08-29 09:37:27 - Emulator]
[2014-08-29 09:37:27 - IntoProject] New emulator found: emulator-5554
[2014-08-29 09:37:27 - IntoProject] Waiting for HOME ('android.process.acore') to be launched...
[2014-08-29 09:37:45 - IntoProject] WARNING: Application does not specify an API level requirement!
[2014-08-29 09:37:45 - IntoProject] Device API version is 10 (Android 2.3.3)
[2014-08-29 09:37:45 - IntoProject] HOME is up on device 'emulator-5554'
[2014-08-29 09:37:45 - IntoProject] Uploading IntoProject.apk onto device 'emulator-5554'
[2014-08-29 09:37:45 - IntoProject] Installing IntoProject.apk...
[2014-08-29 09:37:47 - IntoProject] Success!
[2014-08-29 09:37:47 - IntoProject] Starting activity com.haseman.peachPit.MyActivity on device emulator-5554
[2014-08-29 09:37:48 - IntoProject] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.haseman.peachPit/.MyActivity }
[2014-08-29 09:58:49 - ProvaProject-2] ------------------------------
[2014-08-29 09:58:49 - ProvaProject-2] Android Launch!
[2014-08-29 09:58:49 - ProvaProject-2] adb is running normally.
[2014-08-29 09:58:49 - ProvaProject-2] Performing example.provaproject_2.MainActivity activity launch
[2014-08-29 09:58:49 - ProvaProject-2] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'ProvaEmulatore-2'
[2014-08-29 09:58:49 - ProvaProject-2] Uploading ProvaProject-2.apk onto device 'emulator-5554'
[2014-08-29 09:58:49 - ProvaProject-2] Installing ProvaProject-2.apk...
[2014-08-29 09:58:52 - ProvaProject-2] Success!
[2014-08-29 09:58:53 - ProvaProject-2] Starting activity example.provaproject_2.MainActivity on device emulator-5554
[2014-08-29 09:58:53 - ProvaProject-2] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=example.provaproject_2/.MainActivity }
[2014-08-29 10:04:45 - SDK Manager] Created AVD 'Emulatore-1' based on Android 2.3.3, ARM (armeabi) processor,
[2014-08-29 10:04:45 - SDK Manager] with the following hardware config:
[2014-08-29 10:04:45 - SDK Manager] disk.dataPartition.size=200M
[2014-08-29 10:04:45 - SDK Manager] hw.accelerometer=yes
[2014-08-29 10:04:45 - SDK Manager] hw.audioInput=yes
[2014-08-29 10:04:45 - SDK Manager] hw.battery=yes
[2014-08-29 10:04:45 - SDK Manager] hw.camera.back=none
[2014-08-29 10:04:45 - SDK Manager] hw.dPad=no
[2014-08-29 10:04:45 - SDK Manager] hw.device.hash2=MD5:fbd5143f5b48ba972391c87c302c0c69
[2014-08-29 10:04:45 - SDK Manager] hw.device.manufacturer=Generic
[2014-08-29 10:04:45 - SDK Manager] hw.device.name=5.1in WVGA
[2014-08-29 10:04:45 - SDK Manager] hw.gps=yes
[2014-08-29 10:04:45 - SDK Manager] hw.keyboard=yes
[2014-08-29 10:04:45 - SDK Manager] hw.lcd.density=160
[2014-08-29 10:04:45 - SDK Manager] hw.mainKeys=yes
[2014-08-29 10:04:45 - SDK Manager] hw.ramSize=512
[2014-08-29 10:04:45 - SDK Manager] hw.sdCard=yes
[2014-08-29 10:04:45 - SDK Manager] hw.sensors.orientation=yes
[2014-08-29 10:04:45 - SDK Manager] hw.sensors.proximity=yes
[2014-08-29 10:04:45 - SDK Manager] hw.trackBall=no
[2014-08-29 10:04:45 - SDK Manager] skin.dynamic=no
[2014-08-29 10:04:45 - SDK Manager] vm.heapSize=16
[2014-08-29 10:07:09 - ProvaProject-2] ------------------------------
[2014-08-29 10:07:09 - ProvaProject-2] Android Launch!
[2014-08-29 10:07:09 - ProvaProject-2] adb is running normally.
[2014-08-29 10:07:09 - ProvaProject-2] Performing example.provaproject_2.MainActivity activity launch
[2014-08-29 10:07:09 - ProvaProject-2] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Emulatore-1'
[2014-08-29 10:07:09 - ProvaProject-2] Uploading ProvaProject-2.apk onto device 'emulator-5554'
[2014-08-29 10:07:10 - ProvaProject-2] Installing ProvaProject-2.apk...
[2014-08-29 10:07:13 - ProvaProject-2] Success!
[2014-08-29 10:07:13 - ProvaProject-2] Starting activity example.provaproject_2.MainActivity on device emulator-5554
[2014-08-29 10:07:14 - ProvaProject-2] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=example.provaproject_2/.MainActivity }
[2014-08-29 10:10:49 - ProvaProject-3] Dx
trouble writing output: already prepared
[2014-08-29 10:10:52 - ProvaProject-3] ------------------------------
[2014-08-29 10:10:52 - ProvaProject-3] Android Launch!
[2014-08-29 10:10:52 - ProvaProject-3] adb is running normally.
[2014-08-29 10:10:52 - ProvaProject-3] Performing example.provaproject_3.MainActivity_3 activity launch
[2014-08-29 10:10:52 - ProvaProject-3] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Emulatore-1'
[2014-08-29 10:10:52 - ProvaProject-3] Uploading ProvaProject-3.apk onto device 'emulator-5554'
[2014-08-29 10:10:52 - ProvaProject-3] Installing ProvaProject-3.apk...
[2014-08-29 10:10:56 - ProvaProject-3] Success!
[2014-08-29 10:10:56 - ProvaProject-3] Starting activity example.provaproject_3.MainActivity_3 on device emulator-5554
[2014-08-29 10:10:56 - ProvaProject-3] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=example.provaproject_3/.MainActivity_3 }

Offline bradipao

  • Moderatore globale
  • Utente storico
  • *****
  • Post: 4043
  • keep it simple
  • Respect: +567
    • Github
    • Google+
    • bradipao
    • Mostra profilo
  • Dispositivo Android:
    Nexus 5
  • Play Store ID:
    Bradipao
  • Sistema operativo:
    W7
Re:Non riesco a eseguire il progetto
« Risposta #3 il: 29 Agosto 2014, 11:27:12 CEST »
0
Quel pannello è un LOG, una sequenza di eventi con data e ora, per questo vedi anche quelli passati.

E comunque sembra tutto a posto, dovresti vedere la tua app di prova sul display.
NON rispondo a domande nei messaggi privati
Bradipao @ Play Store

Offline angelo1977

  • Utente junior
  • **
  • Post: 59
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    galaxy nexsus
  • Sistema operativo:
    window 7 e ubuntu
Re:Non riesco a eseguire il progetto
« Risposta #4 il: 29 Agosto 2014, 12:00:58 CEST »
0
In eclipse,android sdk manager  installa il pakketto delle api 10 e  vedi se risolvi

prova inserendo nel manifest
Codice (Java): [Seleziona]
<uses-sdk android:minSdkVersion="4" />

Offline GabMarioPower

  • Moderatore globale
  • Utente senior
  • *****
  • Post: 606
  • Respect: +152
    • Github
    • Google+
    • gabrielemariotti
    • GabMarioPower
    • Mostra profilo
  • Play Store ID:
    GAB+MARIO+DEV
  • Sistema operativo:
    Ubuntu 14.04 , Win 10
Re:Non riesco a eseguire il progetto
« Risposta #5 il: 29 Agosto 2014, 12:21:08 CEST »
0
posta il manifest e qualcosa sull'activity che parte

Offline oberdank

  • Utente normale
  • ***
  • Post: 287
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    Samsung Galaxy Core LTE
  • Play Store ID:
    BuzzOne
  • Sistema operativo:
    Windows 8.1
Re:Non riesco a eseguire il progetto
« Risposta #6 il: 29 Agosto 2014, 13:00:34 CEST »
0
Le API 10 mi sembrano correttamente installate (allego l'immagine dell'Android SDK Manager).

Quindi le scritte in rosso sono warning che possono essere ignorati?
Il progetto "IntoProject" dovrebbe visualizzare una stringa quando si clicca sul bottone centrale
dell'emulatore, e invece non accade nulla!
La scritta mi appare LA PRIMA VOLTA che clicco su "menu", tutte le volte successive quando clicco su "menu" mi
appaiono delle opzioni e NON la scritta.

Il file "AndroidManifest.xml" e' il seguente:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="example.provaproject_3"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="10" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity_3"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


Post unito: [time]29 Agosto 2014, 13:23:27 CEST[/time]
Il progetto "ProvaProject-3" funziona regolarmente (non fa nulla), sul pannello "Console" NON appare nulla.

Scusate nel precedente messaggio ho postato l'AndroidManifest.xml del progetto "ProvaProject-3", allego il
AndroidManifest.xml del progetto "IntoProject".

Ripeto che la app dovrebbe visualizzare una scritta ogni volta che si preme sul bottone centrale dell'emulatore.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.haseman.peachPit"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon"
       android:label="@string/app_name"
       android:name=".SampleApplication">
        <activity android:name=".MyActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MUSIC_PLAYER" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
       
      <activity android:name=".NewActivity">
         <intent-filter>
            <action android:name="com.haseman.PURPLE_PONY_POWER"/>
            <category android:name="android.intent.category.DEFAULT"/>
         </intent-filter>
      </activity>
    </application>


</manifest>

Questo e' il file "MyActivity.java"

package com.haseman.peachPit;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.Toast;

public class MyActivity extends Activity {

   private BroadcastReceiver simpleReceiver = new BroadcastReceiver() {
      public void onReceive(Context context, Intent intent) {
         if(intent.getAction() == null)
            return;
         if(intent.getAction().equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)){
            Toast.makeText(context, R.string.airplane_change, Toast.LENGTH_LONG).show();
         }
         
      }
   };
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
        registerReceiver(simpleReceiver, intentFilter);
    }
    public void onStop(){
       super.onStop();
    }
    public void onDestroy(){
       super.onDestroy();
       unregisterReceiver(simpleReceiver);   
    }
    public boolean onKeyDown(int keyCode, KeyEvent event){
       if(keyCode == KeyEvent.KEYCODE_DPAD_CENTER){
          Intent startIntent=new Intent(this, NewActivity.class);
          startActivity(startIntent);
          return true;
       }
       if(keyCode == KeyEvent.KEYCODE_DPAD_DOWN){
          Intent actionStartIntent= new Intent("com.haseman.PURPLE_PONY_POWER");
          actionStartIntent.putExtra("newBodyText", "You Pressed the Down Key!");
          startActivity(actionStartIntent);
       }
       return super.onKeyDown(keyCode, event);
    }
}


Post unito: 29 Agosto 2014, 13:39:02 CEST
Riguardo al progetto "IntoProject" ho notato che quando sull'emulatore richiamo le app (cliccando sulla griglia di quadratini) mi appare anche "IntroApplication", cliccando sulla quale mi appare la scritta "Hello World, My Activity!"
« Ultima modifica: 29 Agosto 2014, 13:39:02 CEST da oberdank, Reason: Merged DoublePost »