【发布时间】:2018-03-06 15:24:09
【问题描述】:
我将 Android Studio 更新到最新版本,将 Gradle 更新到 3.3 版本。 现在运行应用程序时一切正常,除了 Parse.com 查询中的这个错误:
日志: 09-25 10:33:53.846 6313-6640/com.xxxxxx.xxxxxxxxE/art: /data/app/com.dogelier.dogelier-2/base.apk:classes30.dex 中的 com.parse.ParseQuery 类验证失败因为:验证程序拒绝类 com.parse.ParseQuery 由于方法错误 void com.parse.ParseQuery.checkIfRunning(boolean) 09-25 10:33:53.846 6313-6640/com.dogelier.dogelier E/AndroidRuntime: 致命异常: AsyncTask #5 进程:com.xxxxx.xxxxx,PID:6313 java.lang.RuntimeException:执行 doInBackground() 时发生错误 在 android.os.AsyncTask$3.done(AsyncTask.java:300) 在 java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) 在 java.util.concurrent.FutureTask.setException(FutureTask.java:222) 在 java.util.concurrent.FutureTask.run(FutureTask.java:242) 在 android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 在 java.lang.Thread.run(Thread.java:818) 原因:java.lang.VerifyError: Verifier denied class com.parse.ParseQuery due to bad method void com.parse.ParseQuery.checkIfRunning(boolean)('com.parse.ParseQuery' 的声明出现在 /data/app/com .dogelier.dogelier-2/base.apk:classes30.dex) 在 com.dogelier.dogelier.Navegacion$RemoteDataTask.doInBackground(Navegacion.java:486) 在 com.dogelier.dogelier.Navegacion$RemoteDataTask.doInBackground(Navegacion.java:462) 在 android.os.AsyncTask$2.call(AsyncTask.java:288) 在 java.util.concurrent.FutureTask.run(FutureTask.java:237) 在 android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 在 java.lang.Thread.run(Thread.java:818)
Error LINE
private class RemoteDataTask extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
progress = new GifLoadingView();
progress.setImageResource(R.drawable.dogelier3);
progress.setDimming(false);
progress.show(getFragmentManager(), "");
}
@Override
protected Void doInBackground(Void... params) {
// Create the array
dogelieropulationlist = new ArrayList<DogelierPopulation>();
try {
// ERROR LINE HERE IN PARSEQUERY
ParseQuery<ParseObject> query = new ParseQuery<ParseObject>("Doghoteliers");
// Locate the column named "ranknum" in Parse.com and order list
// by ascending
//query.orderByAscending("");
query.whereEqualTo("activado", true);
query.setLimit(limit);
ob = query.find();
for (final ParseObject dogelier : ob) {
// Locate images in flag column
final DogelierPopulation map = new DogelierPopulation();
ParseFile image = (ParseFile) dogelier.get("foto");
image.getData();
Bitmap bmp = BitmapFactory
.decodeByteArray(
image.getData(), 0, image.getData().length);
map.setFoto(bmp);
map.setDireccion((String) dogelier.get("ciudad"));
map.setNombre((String) dogelier.get("Nombre"));
map.setTitulo((String) dogelier.get("titulo"));
map.setDescripcion((String) dogelier.get("presentacion"));
map.setPrecio((String) dogelier.get("precio"));
map.setEstrellas(dogelier.getInt("Estrellas"));
dogelieropulationlist.add(0,map);
}
} catch (ParseException e) {
Log.e("Error1", e.getMessage());
e.printStackTrace();
errorFragment = new ErrorFragment();
manager = getSupportFragmentManager();
manager.beginTransaction().replace(R.id.content_navegacion,
errorFragment).commit();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
// Locate the listview in listview_main.xml
listview = (ListView) findViewById(R.id.listview);
// Pass the results into ListViewAdapter.java
adapter = new ListViewAdapter(Navegacion.this,
dogelieropulationlist);
// Binds the Adapter to the ListView
listview.setAdapter(adapter);
CloseProgress(progress);
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
swipeRefreshLayout.post(new Runnable() {
@Override
public void run() {
swipeRefreshLayout.setRefreshing(true);
new LoadMoreDataTask().execute();
}
}
);
}
});
}
GRADDLE
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'Xxxxxx'
keyPassword 'xxxxxxxx'
storeFile file('C:/KeyStores/xxxxxx.jks')
storePassword 'xxxxxxxx'
}
}
compileSdkVersion 26
buildToolsVersion '25.0.1'
defaultConfig {
applicationId "com.xxxxxx.xxxxxxx"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
}
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
} }
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/httpclient-android-4.3.5.1.jar')
compile files('libs/apache-commons-codec-1.4.jar')
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.parse:parse-android:1.15.2'
compile 'pl.bclogic:pulsator4droid:1.0.3'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.parse:parsefacebookutils-v4-android:1.10.3@aar'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.parse:parseui-login-android:0.0.2'
compile 'com.parse:parseui-widget-android:0.0.2'
compile 'com.parse:parsetwitterutils-android:1.10.3'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'fr.tvbarthel.blurdialogfragment:lib:2.2.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.4'
compile 'com.roomorama:caldroid:3.0.1'
compile 'com.seatgeek:placesautocomplete:0.2-SNAPSHOT'
compile 'com.github.andremion:louvre:1.2.0'
compile 'com.github.sharish:CreditCardView:v1.0.4'
compile 'com.wdullaer:materialdatetimepicker:3.3.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'hanks.xyz:smallbang-library:0.1.2'
compile 'com.akhgupta:android-easylocation:1.0.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.stripe:stripe-android:4.1.5'
compile 'com.parse:parse-livequery-android:1.0.4'
compile 'com.github.githubwing:DragPhotoView:1.0.1'
compile 'me.shaohui.advancedluban:library:1.3.5'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.stepstone.apprating:app-rating:1.2.0'
compile 'com.sandrios.android:sandriosCamera:1.0.8'
compile 'com.android.support:percent:26.0.1'
compile 'com.google.android.gms:play-services-places:11.0.4'
compile 'com.android.support:multidex:1.0.0'
}
【问题讨论】:
-
您可能想了解parse is gone
-
我知道它已经消失了,但是我将这个库用于 Parse Server,特别是 Sashido。
-
在这种情况下我无法为您提供太多指导,但由于同样的原因
because: Verifier rejected class com.parse.ParseQuery due to bad method void com.parse.ParseQuery.checkIfRunning(boolean)可能由于某些配置问题而发生错误 -
谢谢无论如何,希望有人帮助,这个错误让我发疯......:)
-
请阅读 sahido,它是一个基于 parse.com 的服务器,我有几个应用程序。与服务器的配置无关,因为它与其他应用程序一起工作正常。
标签: android android-studio parse-platform android-asynctask verifyerror