Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 解析SDK Android,我的应用程序在GenyMotion中崩溃,但在真正的手机中工作_Java_Android_Android Studio_Parse Platform - Fatal编程技术网

Java 解析SDK Android,我的应用程序在GenyMotion中崩溃,但在真正的手机中工作

Java 解析SDK Android,我的应用程序在GenyMotion中崩溃,但在真正的手机中工作,java,android,android-studio,parse-platform,Java,Android,Android Studio,Parse Platform,我正在使用Parse作为我的应用程序的后端服务,并遵循测试解析的快速入门指南,查看Parse SDK是否正确安装 Gradle没问题,编译也没问题,但当我试图在模拟器中运行我的项目时,应用程序崩溃了。(我用GenyMotion来模拟),但当我用手机时,它就工作了 GenyMoon虚拟机规范 我的电脑有6 GB内存 LogCat MainActivity.java 应用程序Gradle AndroidManifest.xml **Nexus 4** Android 5.0.0 - Api 2

我正在使用Parse作为我的应用程序的后端服务,并遵循测试解析的快速入门指南,查看Parse SDK是否正确安装

Gradle没问题,编译也没问题,但当我试图在模拟器中运行我的项目时,应用程序崩溃了。(我用GenyMotion来模拟),但当我用手机时,它就工作了

GenyMoon虚拟机规范

我的电脑有6 GB内存

LogCat

MainActivity.java

应用程序Gradle

AndroidManifest.xml


**Nexus 4**
Android 5.0.0 -  Api 21
2 Procesors
2048 MB of RAM 
12-12 22:40:50.745 2150-2150/? I/art: Late-enabling -Xcheck:jni
12-12 22:40:51.059 2150-2150/com.example.danyj.parsetoandroid I/MultiDex: VM with version 2.1.0 has multidex support
12-12 22:40:51.060 2150-2150/com.example.danyj.parsetoandroid I/MultiDex: install
12-12 22:40:51.060 2150-2150/com.example.danyj.parsetoandroid I/MultiDex: VM has multidex support, MultiDex support library is disabled.
12-12 22:40:51.307 2150-2189/com.example.danyj.parsetoandroid D/OpenGLRenderer: Render dirty regions requested: true
12-12 22:40:51.327 2150-2150/com.example.danyj.parsetoandroid D/Atlas: Validating map...
12-12 22:40:51.410 2150-2189/com.example.danyj.parsetoandroid D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
12-12 22:40:51.411 2150-2189/com.example.danyj.parsetoandroid D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
12-12 22:40:51.429 2150-2189/com.example.danyj.parsetoandroid D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
12-12 22:40:51.490 2150-2189/com.example.danyj.parsetoandroid I/OpenGLRenderer: Initialized EGL, version 1.4
12-12 22:40:51.563 2150-2189/com.example.danyj.parsetoandroid D/OpenGLRenderer: Enabling debug mode 0
12-12 22:40:51.594 2150-2189/com.example.danyj.parsetoandroid W/EGL_emulation: eglSurfaceAttrib not implemented
12-12 22:40:51.594 2150-2189/com.example.danyj.parsetoandroid W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xef708ec0, error=EGL_SUCCESS
12-12 22:40:51.791 2150-2186/com.example.danyj.parsetoandroid A/libc: Fatal signal 4 (SIGILL), code 2, fault addr 0xf6ef046e in tid 2186 (ECUTOR-thread-1)
package com.example.danyj.parsetoandroid;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.parse.Parse;
import com.parse.ParseObject;

public class MainActivity extends AppCompatActivity {

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

        //Parse.enableLocalDatastore(this);

        try {
            Parse.initialize(this);
        } catch (Exception e){
            e.printStackTrace();
        }

        ParseObject testObject = new ParseObject("TestObject");
        testObject.put("foo", "bar");
        testObject.saveInBackground();
    }
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.danyj.parsetoandroid"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

        // Enabling multidex support.
        multiDexEnabled true //I enable this for not get an Exception when the app is compiling
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile project(':Parse-1.11.0') //I was imported the Parse library
    compile 'com.android.support:multidex:1.0.0'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.danyj.parsetoandroid">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application
        android:allowBackup="true"
        android:name="android.support.multidex.MultiDexApplication"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <meta-data
            android:name="com.parse.APPLICATION_ID"
            android:value="APPLICATION_ID" />
        <meta-data
            android:name="com.parse.CLIENT_KEY"
            android:value="CLIENT_KEY" />

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

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

</manifest>