NOVELTY - A grafted or cross-linked ion conducting polymer (P1) comprising at least one amic acid or maleimide moiety in the backbone of the polymer, is new.    USE - In solid polymer electrolyte or gel electrolyte useful in molded membranes and batteries (claimed) such as lithium ion batteries and in solar cells and electrochromic devices.    ADVANTAGE - The solid electrolytes comprising the ion conducting polymer have unique molecular architecture and/or ion transport mechanisms that provides good ion conductivity at room temperature with no solvent. The use of the polymer provides a simple synthesis and easy process for the preparation of membranes with good conductivity and mechanical properties and clear rubbery insoluble membranes with high oxyalkylene ether content are obtained which are potentially inexpensive to manufacture. The method is versatile and membranes with different mechanical and electrical properties can be made by changing the composition and proportion of the amine/polyanhydride crosslink system. The solid polymer electrolyte membranes without solvent or plasticizer gives high conductivity at room temperature (greater than 10-6 S/cm). Polymer electrolyte gel membranes provide high room temperature conductivity comparable to that of liquid electrolytes. The covalently cross-linked solid electrolyte and gel electrolyte membranes also have excellent mechanical properties and solvent resistance.    DETAILED DESCRIPTION - A grafted or cross-linked ion conducting polymer (P1) comprising at least one amic acid or maleimide moiety of formula (I) or (II), in the backbone of the polymer, is new.    G1=H, 1-12C alkyl, metal cation or amino cation;    A, A'and A''=1-24C alkylene;    x, y and z=0-125;    E1=H, 1-12C alkyl or 1-12C alkyl carbonyl;    R'= H or 1-12C alkyl;    R''=H, 1-12C alkyl, 1-12C alkyl carbonyl, 6-10C aryl (optionally substituted by at least one 1-12C alkyl, 7-12C aralkyl (optionally substituted by at least one 1-12C alkyl) or a group of formula -CH2-CH(R')-N(E')2);and    E'=H, 1-12C alkyl or 1-12C alkyl carbonyl;or    E'+E'=a maleimide group.    Provided that when one E'is H, 1-12C alkyl or 1-12C alkyl carbonyl, the other is a carbonyl linking group which forms a crosslink to same polymer backbone or to the backbone of another polymer chain which comprises in the backbone of the polymer chain at least one amic acid or maleimide moiety (I) or (II) or the two E'groups together form a maleimide group which is fused to the same polymer backbone or to the backbone of another polymer chain which comprises in the backbone of the polymer chain at least one (I) or (II) and thus forming a crosslink. INDEPENDENT CLAIMS are included for the following:    (1) preparing the polymer (P1);    (2) a solid polymer electrolyte or gel electrolyte comprising the ion conductive polymer (P1); and    (3) a battery having a cathode, an anode and the solid polymer electrolyte or gel electrolyte.