【问题标题】:Fatal Exception applicationId is null Parse致命异常 applicationId 为 null 解析
【发布时间】:2015-12-10 04:54:47
【问题描述】:

这是我在 SO 中的第二个问题,我有一个关于 Fatal Main 错误的问题。在我问之前,我在 SO 中发现了一些其他问题,但我发现的是关于 Facebook 应用程序 这是我的错误

java.lang.RuntimeException: applicationId is null. You must call Parse.initialize(context, applicationId, clientKey) before using the Parse library.

但是,我有一个声明它的类

package com.example.michael.eksperimen6chatting;

import android.app.Application;

import com.parse.Parse;

/**
 * Created by Michael on 03/12/2015.
 */
public class ChattApp extends Application
{
    @Override
    public void onCreate()
    {
        super.onCreate();

        Parse.initialize(this, "urkcFwvUmgSYvuOFTInJmkA3iWv0ArV3XT128TNb", "WvBC0cnGXHkVhTBbkFwLyxGDRgqR6qC8ft7DIleT");
    }
}

这是我的清单

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

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>



    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >

        <activity android:name=".MainActivity" >

        </activity>
        <activity android:name=".UserList"></activity>
        <activity android:name=".Login">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity android:name=".Chat">

        </activity>

    </application>



</manifest>

我在这里遗漏了什么,有人可以帮助我吗?谢谢

【问题讨论】:

    标签: android parse-platform fatal-error


    【解决方案1】:

    AndroidManifest.xml&lt;application&gt; 标记中指定ChattApp 应用程序类名称。

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:name="com.example.michael.eksperimen6chatting.ChattApp">
      ....
    </application>
    

    【讨论】:

      【解决方案2】:
      import com.parse.Parse;
          import android.app.Application;
      
          public class ChattApp extends Application {
            @Override
            public void onCreate() {
              super.onCreate();
      
              Parse.enableLocalDatastore(this);
              Parse.initialize(this, PARSE_APPLICATION_ID, PARSE_CLIENT_KEY);
            }
          }
      

      AndroidManifest.xml

      <application
              android:name="com.example.michael.eksperimen6chatting.ChattApp"
      .
      .
      .
      </application>
      

      【讨论】:

      • 谢谢你的帮助,伙计。但对不起,你的建议很好,但不适合我。感谢蒂比
      猜你喜欢
      • 1970-01-01
      • 2021-01-04
      • 2012-10-09
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      • 2015-10-31
      相关资源
      最近更新 更多