我将Android Studio更新为最新版本,将Graddle更新为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类验证失败因为:Verifier拒绝了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) at 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) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587) 在java.lang.Thread.run(Thread.java:818) 引起:java.lang.VerifyError:由于错误的方法,Verifier拒绝了类com.parse.ParseQuery void com.parse.ParseQuery.checkIfRunning(boolean)('com.parse.ParseQuery'的声明出现在/ data / app / com中.dogelier.dogelier-2 / base.apk:classes30.dex) at 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) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at 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'
}
答案 0 :(得分:0)
我发现错误,如果有人将来拥有它。 Parse sdk,ParseUI和Facebook如果他们不指向相同的版本就会发生冲突,所以请确保它们都兼容。