导出应用程序时出现令人震惊的错误

时间:2014-12-17 08:16:28

标签: android sdk

我的Android应用程序存在很大问题 该应用程序在AVD仿真器上正常工作但是 当我尝试将其导出为SDK包时会出现许多非逻辑错误 我认为原因是应用程序“AndroidManifest.xml”中的一些东西

这是我的“AndroidManifest.xml”代码

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

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <permission android:name="com.example.googlecloudmessaging.permission.C2D_MESSAGE"
                android:protectionLevel="signature" ></permission>

    <uses-permission android:name="com.example.googlecloudmessaging.permission.C2D_MESSAGE" />

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

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


    <receiver
        android:name=".GcmReceiver"
        android:permission="com.google.android.c2dm.permission.SEND"
        >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <category android:name="com.example.googlecloudmessaging"/>
        </intent-filter>
    </receiver>

    <service android:name=".GcmMessageHandler"></service>

    <meta-data android:name="com.google.android.gms.version"
               android:value="@integer/google_play_services_version"/>
    </application>

</manifest>

这是非逻辑错误

 "app_name" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic), "be" (Belarusian), "bg" (Bulgarian), "bn-rBD" (Bengali: Bangladesh), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "en-rGB" (English: United Kingdom), "en-rIN" (English: India), "es" (Spanish), "es-rUS" (Spanish: United States), "et-rEE" (Estonian: Estonia), "eu-rES" (Basque: Spain), "fa" (Persian), "fi" (Finnish), "fr" (French), "fr-rCA" (French: Canada), "gl-rES" (Galician: Spain), "hi" (Hindi), "hr" (Croatian), "hu" (Hungarian), "hy-rAM" (Armenian: Armenia), "in" (Indonesian), "is-rIS" (Icelandic: Iceland), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ka-rGE" (Georgian: Georgia), "kk-rKZ" (Kazakh: Kazakhstan), "km-rKH" (Khmer: Cambodia), "kn-rIN" (Kannada: India), "ko" (Korean), "ky-rKG" (Kyrgyz: Kyrgyzstan), "lo-rLA" (Lao: Lao People's Democratic Republic), "lt" (Lithuanian), "lv" (Latvian), "mk-rMK" (Macedonian: Macedonia, the former Yugoslav Republic of), "ml-rIN" (Malayalam: India), "mn-rMN" (Mongolian: Mongolia), "mr-rIN" (Marathi: India), "ms-rMY" (Malay: Malaysia), "my-rMM" (Burmese: Myanmar), "nb" (Norwegian Bokmål), "ne-rNP" (Nepali: Nepal), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "pt-rBR" (Portuguese: Brazil), "pt-rPT" (Portuguese: Portugal), "ro" (Romanian), "ru" (Russian), "si-rLK" (Sinhala: Sri Lanka), "sk" (Slovak), "sl" (Slovene), "sr" (Serbian), "sv" (Swedish), "sw" (Swahili), "ta-rIN" (Tamil: India), "te-rIN" (Telugu: India), "th" (Thai), "tl" (Tagalog), "tr" (Turkish), "uk" (Ukrainian), "ur-rPK" (Urdu: Pakistan), "uz-rUZ" (Uzbek: Uzbekistan), "vi" (Vietnamese), "zh-rCN" (Chinese: China), "zh-rHK" (Chinese: Hong Kong), "zh-rTW" (Chinese: Taiwan, Province of China), "zu" (Zulu)

Issue: Checks for incomplete translations where not all strings are translated
Id: MissingTranslation

If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages.

If the string should not be translated, you can add the attribute translatable="false" on the <string> element, or you can define all your non-translatable strings in a resource file called donottranslate.xml. Or, you can ignore the issue with a tools:ignore="MissingTranslation" attribute.

By default this detector allows regions of a language to just provide a subset of the strings and fall back to the standard language strings. You can require all regions to provide a full translation by setting the environment variable ANDROID_LINT_COMPLETE_REGIONS.

You can tell lint (and other tools) which language is the default language in your res/values/ folder by specifying tools:locale="languageCode" for the root <resources> element in your resource file. (The tools prefix refers to the namespace declaration http://schemas.android.com/tools.)

[]

请任何人都可以帮助我

3 个答案:

答案 0 :(得分:5)

你可以在eclipse中简单地禁用翻译警告

  

偏好设置 - &gt; Android - &gt; Lint错误检查

现在在类别正确性下:消息查找MissingTranslations并将其严重性从致命更改为警告或忽略类型。应用并且您可能看不到这些错误消息(如果选择严重性警告,则仅显示为警告)

祝你好运!

答案 1 :(得分:1)

在strings.xml文件中添加:

<string name="app_name" translatable="false">[your_app_name]</string>

答案 2 :(得分:0)

如何禁用翻译错误消息

如果要取消错误消息,请转到

在Mac OS X上,

Eclipse - &gt;偏好 - &gt; Android - &gt; Lint错误检查

解决Eclipse Android Lint Translation错误消息

enter image description here