We examine the possibility that the strong CP problem is solved by string-theoretic axions in the strong-coupling limit of the E8XE8' heterotic string theory (M theory). We first discuss some generic features of gauge kinetic functions in compactified M theory, and examine in detail the axion potential induced by the explicit breakings other than the QCD anomaly of the nonlinear U(1)(PQ) symmetries of string-theoretic axions. It is argued based on supersymmetry and discrete gauge symmetries that if the compactification radius is large enough, there can be a U(1)(PQ) symmetry whose breaking other than the QCD anomaly, whatever its microscopic origin is, is suppressed enough for the axion mechanism to work. Phenomenological viability of such a large radius crucially depends upon the quantized coefficients in gauge kinetic functions. We note that the large radius required for the axion mechanism is viable only in a limited class of models. For instance, for compactifications on a smooth Calabi-Yau manifold with a vanishing E-8' field strength, it is viable only when the quantized flux of the antisymmetric tensor field in M theory has a minimal nonzero value. It is also stressed that this large compactification radius allows the QCD axion in M theory to be cosmologically viable in the presence of a late time entropy production. [S0556-2821(97)06722-2].