2017-11-05 1 views
0

이것은 바보 같은 질문이지만 ParseUser를 사용하여 테스트 사용자를 추가하는 테스트를 시도하고 있습니다. 어떤 이유로 서버에 추가되지 않습니다. 어떤 도움을 주셔서 감사합니다. 미안하지만 이것은 명백한 것처럼 보이지만 나는 방금 안드로이드 프로그래밍을 시작했습니다.안드로이드에서 parseUser 설정 문제

활동

public class SignupActivity extends AppCompatActivity { 


    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_signup); 

     final ParseUser currentUser = new ParseUser(); 


     currentUser.setUsername("Test"); 
     currentUser.setPassword("xxx"); 
     currentUser.setEmail("[email protected]"); 
     currentUser.signUpInBackground(new SignUpCallback() { 
      @Override 
      public void done(ParseException e) { 
       if (e == null){ 
        Log.i("User added", "successful"); 
       } 
      } 
     }); 

}} 

응용 프로그램 클래스

public class MainApplication extends Application { 

    @Override 
    public void onCreate(){ 
     super.onCreate(); 

     Parse.enableLocalDatastore(this); 

     Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()) 
       .applicationId("{I have actual app ID here}") 
       .clientKey("{I have client key here}") 
       .server("{It is here}") 
       .build() 
    ); 

     ParseObject parseObject = new ParseObject("FloridaLaw"); 


     ParseACL defaultACL = new ParseACL(); 
     defaultACL.setPublicReadAccess(true); 
     defaultACL.setPublicWriteAccess(true); 
     ParseACL.setDefaultACL(defaultACL, true); 



    } 
} 

11-04 19:56:44.678 22669-22669/? I/zygote: Not late-enabling -Xcheck:jni (already on) 
11-04 19:56:44.718 22669-22669/? W/zygote: Unexpected CPU variant for X86 using defaults: x86 
11-04 19:56:45.206 22669-22669/com.ronaldpitt.floridalaw I/InstantRun: starting instant run server: is main process 
11-04 19:56:45.520 22669-22676/com.ronaldpitt.floridalaw I/zygote: Waiting for a blocking GC ObjectsAllocated 
11-04 19:56:45.672 22669-22680/com.ronaldpitt.floridalaw I/zygote: Background concurrent copying GC freed 7395(2MB) AllocSpace objects, 0(0B) LOS objects, 59% free, 1051KB/2MB, paused 3.900ms total 182.247ms 
11-04 19:56:45.677 22669-22676/com.ronaldpitt.floridalaw I/zygote: WaitForGcToComplete blocked for 156.076ms for cause ObjectsAllocated 
11-04 19:56:46.047 22669-22721/com.ronaldpitt.floridalaw I/OpenGLRenderer: Initialized EGL, version 1.4 
11-04 19:56:46.049 22669-22721/com.ronaldpitt.floridalaw W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 

답변

0

당신이 AndroidManifest.xml에 Application 클래스 MainApplication.java을 추가 한 PrintTrace?

<application 
    android:name=".MainApplication" 
    ...> 
    ... 
</application> 

작동하지 않는 경우 대신 Application 클래스의 AndroidManifest.xml 직접 그 일을 시도

<application ...> 
    <meta-data 
    android:name="com.parse.SERVER_URL" 
    android:value="@string/parse_server_url" /> 
    <meta-data 
    android:name="com.parse.APPLICATION_ID" 
    android:value="@string/parse_app_id" /> 
    <meta-data 
    android:name="com.parse.CLIENT_KEY" 
    android:value="@string/parse_client_key" 
    ... 
</application> 
관련 문제