如何解决Android上的国际化错误?

时间:2017-01-18 00:58:57

标签: android android-studio internationalization android-manifest

我正在进行应用程序的国际化。

我收到以下错误消息:

Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] Unknown failure (Failure) Error while Installing APK

控制台上的例外:

01-17 22:47:48.079 1792-1948/? W/PackageManager: Failed parse during installPackageLI
                                             android.content.pm.PackageParser$PackageParserException: /data/app/vmdl1927641617.tmp/base.apk (at Binary XML file line #53): <provider> does not include authorities attribute
                                                 at android.content.pm.PackageParser.parseBaseApk(PackageParser.java:902)
                                                 at android.content.pm.PackageParser.parseClusterPackage(PackageParser.java:800)
                                                 at android.content.pm.PackageParser.parsePackage(PackageParser.java:764)
                                                 at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:12646)
                                                 at com.android.server.pm.PackageManagerService.-wrap26(PackageManagerService.java)
                                                 at com.android.server.pm.PackageManagerService$9.run(PackageManagerService.java:10581)
                                                 at android.os.Handler.handleCallback(Handler.java:746)
                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                 at android.os.Looper.loop(Looper.java:148)
                                                 at android.os.HandlerThread.run(HandlerThread.java:61)
                                                 at com.android.server.ServiceThread.run(ServiceThread.java:46)

目录结构:

enter image description here

enter image description here

可能是什么错误?

有人可以帮助我吗?

谢谢!

我正在尝试将Android课程中的应用程序国际化为葡萄牙语。

这是清单文件。

<?xml version="1.0" encoding="utf-8"?>

<!-- This permission is necessary in order for Sunshine to perform network access. -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Permissions required by the sync adapter -->
<uses-permission
    android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission
    android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission
    android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:theme="@style/ForecastTheme"
        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=".DetailActivity"
        android:label="@string/title_activity_detail"
        android:parentActivityName=".MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.example.android.sunshine.app.MainActivity" />
    </activity>
    <activity
        android:name=".SettingsActivity"
        android:label="@string/title_activity_settings"
        android:parentActivityName=".MainActivity"
        android:theme="@style/SettingsTheme">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.example.android.sunshine.app.MainActivity" />
    </activity>
    <provider
        android:authorities="@string/content_authority"
        android:name=".data.WeatherProvider"
        android:exported="false"
        android:syncable="true" />

    <!-- SyncAdapter's dummy authentication service -->
    <service android:name=".sync.SunshineAuthenticatorService">
        <intent-filter>
            <action android:name="android.accounts.AccountAuthenticator" />
        </intent-filter>
        <meta-data
            android:name="android.accounts.AccountAuthenticator"
            android:resource="@xml/authenticator" />
    </service>

    <!-- The SyncAdapter service -->
    <service
        android:name=".sync.SunshineSyncService"
        android:exported="true"
        >
        <intent-filter>
            <action android:name="android.content.SyncAdapter" />
        </intent-filter>
        <meta-data
            android:name="android.content.SyncAdapter"
            android:resource="@xml/syncadapter" />
    </service>
</application>

这是构建文件: enter image description here

我从代码中删除了下面摘录的strings.xml文件。

<string name="sync_account_type">sunshine.example.com</string>
<string name="content_authority">com.example.android.sunshine.app</string>

有效。

0 个答案:

没有答案