IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

erreur dans R.java


Sujet :

Android

  1. #1
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut erreur dans R.java
    bonsoir,
    mon code fonctionnait normalement jusqu'au moment ou j'ai ajouté une methode de calcul de durée d'une séquence vidéo
    depuis ce temps aucune erreur dans le code mais le fichier R.java me génere l'erreur suivante:
    Syntax error on token "int", VariableDeclaratorId expected after this token
    j'ai éliminé les modifs, j'ai fait copier/coller d'une ancienne version de la classe
    j'ai fait mille fois project->clean mais l'erreur persiste encore j'ai meme éliminé R.java mais en vain

    pouvez vous m'aider??
    merci d'avance

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    179
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 179
    Points : 100
    Points
    100
    Par défaut
    ne surtout pas toucher a R.java directement .
    c ' est un fichier qui est genere automatiquement selon tes supports xml

    pourrait on avoir son contenu stp

    Merci

  3. #3
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Points : 4 240
    Points
    4 240
    Par défaut
    Le fichier R va mal se générer ou refuser de se générer si tu as une ou des erreurs dans ton code (Java ou XML).
    Du coup regarde bien dans Eclipse, si tu ne vois pas d'erreur dans ton code.
    Si vous jugez mon post utile dans la résolution de votre problème, n'hésitez pas à utiliser le système de vote afin d'améliorer la qualité du forum

  4. #4
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut
    bonjour,
    en fait meme si je change le R.java manuellement, systèmatiqument il se regènere
    le hic que je n'ai pas d'erreur dans mon code

    j'ai trouvé dans le net un ancien post qui a le meme problème que moi,l'erreur pour lui etait sans le fichier string.xml, il maquait d'introduire un nom..bof qui n'est pas le cas pour moi
    j'ai vérifié tout les fichiers xml: string layout value ..

    voila mon fichier R.java

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    /* AUTO-GENERATED FILE.  DO NOT MODIFY.
     *
     * This class was automatically generated by the
     * aapt tool from the resource data it found.  It
     * should not be modified by hand.
     */
    
    package com.pfe.embeddedRichMediaPlayer;
    
    public final class R {
        public static final class anim {
            public static final int cycle_7=0x7f040000;
            public static final int hyperspace_in=0x7f040001;
            public static final int layout_animation_row_left_slide=0x7f040002;
            public static final int push_left_in=0x7f040003;
            public static final int push_left_out=0x7f040004;
            public static final int slide_left=0x7f040005;
            public static final int zoom_enter=0x7f040006;
            public static final int zoom_exit=0x7f040007;
        }
        public static final class attr {
        }
        public static final class drawable {
            public static final int android=0x7f020000;
            public static final int btn_media_player=0x7f020001;
            public static final int btn_media_player_disabled=0x7f020002;
            public static final int btn_media_player_disabled_selected=0x7f020003;
            public static final int btn_media_player_pressed=0x7f020004;
            public static final int btn_media_player_selected=0x7f020005;
            public static final int fullscreen=0x7f020006;
            public static final int ic_media_pause=0x7f020007;
            public static final int ic_media_play=0x7f020008;
            public static final int icon=0x7f020009;
            public static final int media_button_background=0x7f02000a;
            public static final int reset=0x7f02000b;
            public static final int slide=0x7f02000c;
            public static final int stop=0x7f02000d;
            public static final int video=0x7f02000e;
        }
        public static final class id {
            public static final int ImageView01=0x7f070002;
            public static final int SeekBarVol=0x7f07000a;
            public static final int VideoSlide=0x7f070009;
            public static final int address=0x7f07000d;
            public static final int cancel=0x7f07000f;
            public static final int fullscreen=0x7f070008;
            public static final int label=0x7f07000c;
            public static final int layoutswitcher=0x7f070000;
            public static final int ok=0x7f07000e;
            public static final int playPause=0x7f070005;
            public static final int reset=0x7f070007;
            public static final int stop=0x7f070006;
            public static final int surface=0x7f070001;
            public static final int time=0x7f07000b;
            public static final int time_current=0x7f070004;
            public static final int timeline=0x7f070003;
        }
        public static final class idtime_current {
            public static final int =0x7f080000;
        }
        public static final class layout {
            public static final int main=0x7f030000;
            public static final int my_player_gui=0x7f030001;
            public static final int url_gui=0x7f030002;
        }
        public static final class string {
            public static final int app_name=0x7f050000;
        }
        public static final class style {
            public static final int MediaButton=0x7f060000;
            public static final int Theme_NoBackground=0x7f060001;
        }
    }
    la ligne d'erreur est celle en rouge

    merci

  5. #5
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    179
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 179
    Points : 100
    Points
    100
    Par défaut
    bah en fait tu as un type déclaré sans variable.

    Tu dois surement avoir une erreur quelque part pour que R.java le genere ainsi.
    Essaie de le supprimer , et de re cleaner le projet car c ' est assez bizarre

  6. #6
    Rédacteur
    Avatar de MrDuChnok
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2002
    Messages
    2 112
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juin 2002
    Messages : 2 112
    Points : 4 240
    Points
    4 240
    Par défaut
    Oui, si le fichier se génère mal, c'est que y'a une erreur dans le code d'où il puise les infos.
    Tu as vérifiés tes Id pour les composants dans les layout XML ? ils sont bien formés ?
    Si vous jugez mon post utile dans la résolution de votre problème, n'hésitez pas à utiliser le système de vote afin d'améliorer la qualité du forum

  7. #7
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut
    ah si c'est vrai que dans mon fichier de layout il y a pas d'erreur mais lorsque j'ai basculé en mode design, le layout ne s'affiche pas m'indiquant une exception:
    ArrayIndexOutOfBoundsException1
    donc surement l'erreur provient de ce layout

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    <?xml version="1.0" encoding="utf-8"?>
     
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
     
     
    <ViewFlipper
        android:layout_margin="6dip"
        android:id="@+id/layoutswitcher"
        android:layout_width="fill_parent"
        android:layout_height="180px">
     
     
     <SurfaceView android:id="@+id/surface" 
             android:layout_width="fill_parent" 
             android:layout_height="180px">
             </SurfaceView>
     
     
      <ImageView
       android:id="@+id/ImageView01"
        android:layout_width="wrap_content" 
        android:layout_height="180px"
        android:layout_gravity="center">
        </ImageView>
     
     
    </ViewFlipper>
     
     
    <RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="100px">
     
    <ProgressBar android:id="@+id/timeline"
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="2px"
    />
     
     
     <TextView android:text="00:00"  
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/timeCurrent" 
    android:layout_below="@id/timeline">
    </TextView>
     
     <ImageButton
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_below="@id/timeline"
    android:layout_toRightOf="@+idtime_current/"
    android:src="@drawable/ic_media_play"
    android:id="@+id/playPause">
     </ImageButton>
     
     
     
     <ImageButton  
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
    android:src="@drawable/stop"
     android:id="@+id/stop"
      android:layout_below="@id/timeline"
     android:layout_toRightOf="@id/playPause">
     
     </ImageButton>
     
     
      <ImageButton 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
    android:src="@drawable/reset"
     android:id="@+id/reset"
      android:layout_below="@id/timeline"
     android:layout_toRightOf="@id/stop">
     
     </ImageButton>
     
     
     <ImageButton 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
    android:src="@drawable/fullscreen"
     android:id="@+id/fullscreen"
      android:layout_below="@id/timeline"
     android:layout_toRightOf="@id/reset">
     </ImageButton>
     
     
     
     
     <ImageButton 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
    android:src="@drawable/slide"
     android:id="@+id/VideoSlide"
      android:layout_below="@id/timeline"
     android:layout_toRightOf="@id/fullscreen">
     
     </ImageButton>        
     
     
     
    <SeekBar 
    android:layout_width="140px" 
    android:layout_toRightOf="@id/VideoSlide" 
     android:layout_below="@id/timeline"
    android:id="@+id/SeekBarVol" 
    android:layout_height="wrap_content"
    android:paddingTop="10px"
    android:max="100"
    android:progress="0">
    </SeekBar>
     
    <TextView android:text="00:00" 
    android:layout_toRightOf="@+id/SeekBarVol" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/time" 
    android:layout_below="@id/timeline">
    </TextView>
    </RelativeLayout>
    </LinearLayout>

  8. #8
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2008
    Messages
    179
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2008
    Messages : 179
    Points : 100
    Points
    100
    Par défaut
    ton erreur se situe ici

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     <ImageButton
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:id="@+id/playPause"
    android:layout_below="@id/timeline"
    android:layout_toRightOf="@+idtime_current/"
     
    >
    plus precisement ici

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    android:layout_toRightOf="@+idtime_current/"
    remplace par ceci

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    android:layout_toRightOf="@+id/time_current

    ca devrait aller mieux
    simple erreur de syntaxe ^^

  9. #9
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut
    yesssssssssssssssssss merci merciiiiiiii ulquiorra j'étais vraiment coincée!!
    apparamment je dois changer de lunette!!!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur dans HibernateUtil.java
    Par serigne dans le forum Hibernate
    Réponses: 12
    Dernier message: 22/12/2012, 18h50
  2. erreur dans le code java
    Par aroua dans le forum Général Java
    Réponses: 4
    Dernier message: 10/04/2008, 09h26
  3. [EXCEPTION_ACCESS_VIOLATION] erreur dans java hotspot
    Par biozaxx dans le forum AWT/Swing
    Réponses: 6
    Dernier message: 12/11/2007, 11h23
  4. erreur dans mon code "java.lang.NullPointerException"
    Par wiss20000 dans le forum Langage
    Réponses: 12
    Dernier message: 19/04/2007, 09h08
  5. erreur dans programme java sur des vecteurs 3D
    Par HighSchool2005 dans le forum Langage
    Réponses: 18
    Dernier message: 15/02/2007, 16h38

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo