parse-community / ParseUI-Android

ParseUI contains user interface libraries for building apps with the Parse Android SDK.
Other
592 stars 324 forks source link

java.lang.IllegalArgumentException: You must create this type of ParseObject using ParseObject.create() or the proper subclass. #142

Open KarimRedaHassan opened 8 years ago

KarimRedaHassan commented 8 years ago

I have followed the steps on https://github.com/ParsePlatform/ParseUI-Android to use the ParseLoginUI library in my project.

Here is exactly what I have done in steps:

  1. I added the following code to my app build.gardle dependencies { compile 'com.parse.bolts:bolts-android:1.+' compile 'com.parse:parse-android:1.+' }
  2. Add the following code in my Application.onCreate to initialize the Parse library Parse.initialize(this,YOUR_APPLICATION_ID, YOUR_CLIENT_KEY);
  3. add permissions to app manifest file
  4. Add the following code in app build.gardle compile 'com.parse:parseui-login-android:0.0.1' compile 'com.parse:parseui-widget-android:0.0.1'
  5. Add the following to the app manifest file within the section. <activity android:name="com.parse.ui.ParseLoginActivity" android:label="@string/app_name" android:launchMode="singleTop">

    <meta-data android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_ENABLED" android:value="true"/> <meta-data android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_EMAIL_AS_USERNAME" android:value="true"/>

  6. Add the following code to my MainActivity in the onCreate() before setContentView() -i don't know if the position of the code matters in this case or not - ParseLoginBuilder builder = new ParseLoginBuilder(MainActivity.this); startActivityForResult(builder.build(), 0);
  7. Run the app

The app is compiled and run with no errors but when I write name and password and re-password and email then Press Create account, the app crashes and the following error appears in the logCat

07-12 16:36:01.730 2468-2468/? D/AndroidRuntime: Shutting down VM 07-12 16:36:01.730 2468-2468/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.gigamole.navigationtabbar, PID: 2468 java.lang.IllegalArgumentException: You must create this type of ParseObject using ParseObject.create() or the proper subclass. at com.parse.ParseObject.(ParseObject.java:365) at com.parse.ParseObject.(ParseObject.java:334) at com.parse.ParseUser.(ParseUser.java:162) at com.parse.ui.ParseSignupFragment.onClick(ParseSignupFragment.java:178) at android.view.View.performClick(View.java:5198) at android.view.View$PerformClick.run(View.java:21147) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 07-12 16:36:01.730 1361-1915/? W/ActivityManager: Force finishing activity com.gigamole.navigationtabbar/com.parse.ui.ParseLoginActivity

I really need this issue to be solved so that I could use the ParseLoginUi library in my project

I think this issue is similar to this one Import project vs dependencies #125 But I don't find the right solution in this issue.

sariabuzahra commented 7 years ago

Try to use compile 'com.parse:parseui-login-android:0.0.2'