我只是简单地阅读了关于在Parse上存储数据的教程,并收到了:
“在以前失败的类java.lang.Class上拒绝re。
我做了什么:
- compile fileTree(dir: 'libs', include: 'bolts-android-\*.jar')
- compile fileTree(dir: 'libs', include: 'Parse-\*.jar')
- Parse.enableLocalDatastore(this);
- Parse.initialize(this, \_\_\_\_\_\_ , \_\_\_\_\_\_\_);
在以前失败的类java.lang.Class com.parse.OfflineStore$32上拒绝re
发布于 2015-05-09 13:03:59
您应该创建一个单独的类来扩展Application,并在那里执行Parse初始化和启用数据库内容。应该是,
public class ParseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
ParseCrashReporting.enable(this);
Parse.enableLocalDatastore(this);
Parse.initialize(this, "xxx", "xxx");
}
} 在AndroidManifest.xml中,将ParseApplication类添加到应用程序中
<application
android:name="com.example.parsetry.ParseApplication" // you should replace this based on your package
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>https://stackoverflow.com/questions/30139307
复制相似问题