2
私は別のデバイス上で正常に実行されたアンドロイドdevice.itに私のプロジェクトを実行しようとしていますが、それは、このエラーを示す私のデバイスで動作していない:アンドロイドスタジオ
Error:Note: /home/ashik/Desktop/project/app/src/main/java/com/example/ashik/project/Patient_list.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
私Patient_List.javaなどをこの:
package com.example.ashik.project;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.ListViewCompat;
import android.widget.ListView;
import com.firebase.client.ChildEventListener;
import com.firebase.client.DataSnapshot;
import com.firebase.client.Firebase;
import com.firebase.client.FirebaseError;
import com.firebase.client.ValueEventListener;
import com.firebase.client.core.operation.ListenComplete;
import java.util.ArrayList;
import java.util.Map;
public class Patient_list extends AppCompatActivity {
ArrayList<Patient> patients;
ListView listView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_patient_list);
patients=new ArrayList<Patient>();
listView=(ListView)findViewById(R.id.list);
Firebase firebase=new Firebase("https://cancertable.firebaseio.com/").child("cancer");
firebase.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
Map<String,Object> newpost=(Map<String,Object>)dataSnapshot.getValue();
String nm= String.valueOf(newpost.get("name"));
String age= String.valueOf(newpost.get("age"));
String city= String.valueOf(newpost.get("city"));
String occ= String.valueOf(newpost.get("occupation"));
String cond=String.valueOf(newpost.get("condition"));
Patient patient=new Patient();
patient.setName(nm);
patient.setAge(age);
patient.setCity(city);
patient.setCondition(cond);
patient.setOccupation(occ);
patients.add(patient);
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});
firebase.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
setlist();
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});
}
public void setlist()
{
Arrayadapter arrayadapter=new Arrayadapter(Patient_list.this,patients);
listView.setAdapter(arrayadapter);
}
}
私 ビルドのGradle(プロジェクト):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
とビルドのGradle(アプリ):
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.ashik.project"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
compile "com.squareup.picasso:picasso:2.4.0"
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.firebaseui:firebase-ui:0.3.1'
compile 'com.github.dakatso:livebutton:1.0.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-ads:9.0.2'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.google.android.gms:play-services-gcm:9.0.2'
compile 'org.jsoup:jsoup:1.10.1'
compile 'com.facebook.stetho:stetho-okhttp:1.4.1'
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
}
apply plugin: 'com.google.gms.google-services'
はそれが昨日とfirebaseからの正確な出力を示す正常に実行されましたが、今、私のDEWAV MAXIMUS(MAX990)(アンドロイド4.2.1 API 17)に
に私は(https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=DexIndexOverflowException)[エラーメッセージをグーグル]示唆しています。 –
可能性のある重複:[奇妙な:トップレベル例外が予期しない:タスクapp:dexDebugの実行に失敗しました](http://stackoverflow.com/questions/28286156/weird-unexpected-top-level-exception-execution-failed-for-タスク - appdexdebug) –