Aller au contenu

Erreur à l'éxecution


tammikuu

Recommended Posts

Bonjour, dans le cadre d'un projet d'études je dois réaliser une appli android se connectant à une bdd distante pour récuperer des infos. a priori tout allait bien jusqu'a ce qu'eclipse m'affiche ce message à l'éxécution dans la console :

[2011-09-30 09:40:14 - CalendrierPolytech] Uploading CalendrierPolytech.apk onto device 'emulator-5554'

[2011-09-30 09:40:21 - CalendrierPolytech] Installing CalendrierPolytech.apk...

[2011-09-30 09:40:41 - CalendrierPolytech] Success!

[2011-09-30 09:40:41 - CalendrierPolytech] Starting activity com.calendrier.polytech.Main on device emulator-5554

[2011-09-30 09:40:45 - CalendrierPolytech] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.calendrier.polytech/.Main }

je précise que j'ai essayé de supprimer et réinstaller l'appli sur l'émulateur et le smartphone, j'ai vérifié le manifest et que l'appli ne tourne pas en fond ...

copie du manifest :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.polytech.calendrier"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

<application android:icon="@drawable/icon" android:label="@string/app_name">
	<activity android:name="com.calendrier.polytech.main"
			  android:label="@string/app_name">
		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
	</activity>
	<activity android:name="com.calendrier.polytech.main" android:label="@string/app_name" />
	<activity android:name=".Infos" android:label="@string/app_name" />
	<activity android:name=".Dates" android:label="@string/app_name" />
	<activity android:name=".Presentation" android:label="@string/app_name" />
	<activity android:name=".SiteWeb" android:label="@string/app_name" />

</application>
</manifest>

Lien vers le commentaire
Partager sur d’autres sites

Les traces que tu indiques ne font pas état d'erreurs...

Néanmoins, je note que dans ton manifest

- tu déclares 2 fois l'Activity com.calendrier.polytech.main : la deuxième déclaration est inutile

- le nom de cette activity est com.calendrier.polytech.main (avec un petit 'm'), alors que la trace indique que le launcher veut lancer l'activity com.calendrier.polytech.Main (avec un grand 'M')

Lien vers le commentaire
Partager sur d’autres sites

autant pour moi il s'agit de la mauvaise version du manifest,

j'ai la même "erreur" avec ces modifications :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.polytech.calendrier" android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Main" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Infos" android:label="Informations importantes" />
<activity android:name=".Dates" android:label="Dates importantes" />
<activity android:name=".Presentation" android:label="Présentation de la filière" />
<activity android:name=".SiteWeb" android:label="Page web de la filière" />
</application>
</manifest>

j'ai essayer de réinstaller eclipse, même problème, je tente une réinstallation du sdk android

Lien vers le commentaire
Partager sur d’autres sites

bon et bien après réinstallation d'eclipse et du sdk toujours cette erreur :

ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp="packageName"/.Main}

le problème c'est que même en créant un projet type hello world j'ai droit à cette ligne dès qu je modifie une ligne de code

...

Lien vers le commentaire
Partager sur d’autres sites

Encore une fois, le message que tu indiques N'EST PAS une erreur, juste un log classique lors du lancement d'une Activity...

PS: n'hésites pas à utiliser les balises < code > dans tes posts pour tes extraits de code, ça rendra ton message plus lisible

Lien vers le commentaire
Partager sur d’autres sites

effectivement le logcat me renvoi des erreurs :


09-30 15:01:54.864: ERROR/dalvikvm-heap(830): 70000000-byte external allocation too large for this process.
09-30 15:01:54.974: ERROR/GraphicsJNI(830): VM won't let us allocate 70000000 bytes
09-30 15:01:55.014: ERROR/AndroidRuntime(830): FATAL EXCEPTION: main
09-30 15:01:55.014: ERROR/AndroidRuntime(830): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.polytech.calendrier/com.polytech.calendrier.Main}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.os.Looper.loop(Looper.java:123)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.ActivityThread.main(ActivityThread.java:3683)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at java.lang.reflect.Method.invokeNative(Native Method)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at java.lang.reflect.Method.invoke(Method.java:507)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at dalvik.system.NativeStart.main(Native Method)
09-30 15:01:55.014: ERROR/AndroidRuntime(830): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.Activity.setContentView(Activity.java:1657)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at com.polytech.calendrier.Main.onCreate(Main.java:16)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     ... 11 more
09-30 15:01:55.014: ERROR/AndroidRuntime(830): Caused by: java.lang.reflect.InvocationTargetException
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at java.lang.reflect.Constructor.constructNative(Native Method)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     ... 21 more
09-30 15:01:55.014: ERROR/AndroidRuntime(830): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.content.res.Resources.loadDrawable(Resources.java:1709)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.View.<init>(View.java:1951)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.View.<init>(View.java:1899)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.view.ViewGroup.<init>(ViewGroup.java:286)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     at android.widget.LinearLayout.<init>(LinearLayout.java:120)
09-30 15:01:55.014: ERROR/AndroidRuntime(830):     ... 24 more

Lien vers le commentaire
Partager sur d’autres sites

Ben voila

09-30 15:01:55.014: ERROR/AndroidRuntime(830): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Tu as une belle erreur de saturation mémoire, visiblement en chargeant un bitmap défini dans ton layout...

Lien vers le commentaire
Partager sur d’autres sites

les erreurs arrivent au chargement du layout principal :


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:background="@drawable/background" android:gravity="center_horizontal"
android:orientation="vertical">
<TextView android:textAppearance="?android:attr/textAppearanceSmall"
android:id="@+id/txtIntro" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="@string/hello"
android:gravity="center_horizontal" android:textColor="#FF00F9FF">
</TextView>
<Button android:layout_height="wrap_content"
android:layout_width="fill_parent" android:id="@+id/btnDates"
android:text="Dates Clés">
</Button>
<Button android:layout_height="wrap_content" android:id="@+id/btnInfos"
android:layout_width="fill_parent" android:text="Informations">
</Button>
<Button android:layout_height="wrap_content" android:autoLink="web"
android:id="@+id/btnLink" android:layout_width="fill_parent"
android:text="Accès au site de l'école">
</Button>
<Button android:layout_height="wrap_content" android:text="Présentation de la filière"
android:layout_width="fill_parent" android:id="@+id/btnPresentation">
</Button>
</LinearLayout>

de ce que je comprend je lui demande d'allouer trop de mémoire, cela pourrait-il venir de l'arriere plan trop lourd ?

Ben voila

09-30 15:01:55.014: ERROR/AndroidRuntime(830): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Tu as une belle erreur de saturation mémoire, visiblement en chargeant un bitmap défini dans ton layout...

Donc c'est bien ça ...

Juste pour info, quelle est la taille standard d'un bitmap de fond d'écran ?

Lien vers le commentaire
Partager sur d’autres sites

Juste pour info, quelle est la taille standard d'un bitmap de fond d'écran ?

La plus petite possible ;) ...

Je n'ai pas de réponse précise à te donner, mais dans ton cas, ton image de background doit être vraiment trèèèèèès lourde, vu qu'il semble avoir besoin de 70Mo de mémoire

Pour infos, la taille mémoire max allouée à chaque application au runtime ne peut dépasser une certaine limite (8 ou 16 mo, il me semble, selon la version d'Android)

Lien vers le commentaire
Partager sur d’autres sites

En effet l'erreur venait de l'arriere plan .... de 3.7Mo ... j'ai honte ... :|

Le reste viens d'une petite video en 3gp.

Et en parlant de video ....

maintenant c'est elle qui fait des siennes,

code de l'activité qui gere la vidéo :


protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState);
setContentView(R.layout.presentation);
VideoView view = (VideoView)findViewById(R.id.videoView);
view.setMediaController(new MediaController(this));
setContentView(view);

view.setVideoURI(Uri.parse("android.ressource://"+this.getPackageName()+"/"+R.raw.presentation));
view.requestFocus();
view.start();

logcat :


09-30 15:28:23.846: ERROR/Zygote(32): setreuid() failed. errno: 2
09-30 15:28:34.525: ERROR/Zygote(32): setreuid() failed. errno: 17
09-30 15:28:35.945: ERROR/BatteryService(61): usbOnlinePath not found
09-30 15:28:35.945: ERROR/BatteryService(61): batteryVoltagePath not found
09-30 15:28:35.945: ERROR/BatteryService(61): batteryTemperaturePath not found
09-30 15:28:36.005: ERROR/SurfaceFlinger(61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
09-30 15:28:36.085: ERROR/SensorService(61): couldn't open device for module sensors (Invalid argument)
09-30 15:28:39.995: ERROR/System(61): Failure starting core service
09-30 15:28:39.995: ERROR/System(61): java.lang.SecurityException
09-30 15:28:39.995: ERROR/System(61):	 at android.os.BinderProxy.transact(Native Method)
09-30 15:28:39.995: ERROR/System(61):	 at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
09-30 15:28:39.995: ERROR/System(61):	 at android.os.ServiceManager.addService(ServiceManager.java:72)
09-30 15:28:39.995: ERROR/System(61):	 at com.android.server.ServerThread.run(SystemServer.java:206)
09-30 15:28:40.026: ERROR/EventHub(61): could not get driver version for /dev/input/mouse0, Not a typewriter
09-30 15:28:40.026: ERROR/EventHub(61): could not get driver version for /dev/input/mice, Not a typewriter
09-30 15:28:40.525: ERROR/SoundPool(61): error loading /system/media/audio/ui/Effect_Tick.ogg
09-30 15:28:40.525: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressStandard.ogg
09-30 15:28:40.535: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressSpacebar.ogg
09-30 15:28:40.535: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressDelete.ogg
09-30 15:28:40.535: ERROR/SoundPool(61): error loading /system/media/audio/ui/KeypressReturn.ogg
09-30 15:28:40.585: ERROR/UsbObserver(61): java.lang.NullPointerException
09-30 15:28:40.585: ERROR/UsbObserver(61):	 at com.android.server.UsbObserver.init(UsbObserver.java:131)
09-30 15:28:40.585: ERROR/UsbObserver(61):	 at com.android.server.UsbObserver.<init>(UsbObserver.java:65)
09-30 15:28:40.585: ERROR/UsbObserver(61):	 at com.android.server.ServerThread.run(SystemServer.java:402)
09-30 15:28:41.135: ERROR/ThrottleService(61): Could not open GPS configuration file /etc/gps.conf
09-30 15:28:41.745: ERROR/logwrapper(142): executing /system/bin/tc failed: No such file or directory
09-30 15:28:41.806: ERROR/logwrapper(144): executing /system/bin/tc failed: No such file or directory
09-30 15:28:41.855: ERROR/logwrapper(148): executing /system/bin/tc failed: No such file or directory

Lien vers le commentaire
Partager sur d’autres sites

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

×
×
  • Créer...