2

Olá, gostaria de saber o que estou fazendo de errado, pois executo o app e ele sempre da um erro, dando um stop.

ListView listview;
List<ParseObject> ob;
ProgressDialog mProgressDialog;
ListViewAdapter adapter;
private List<WorldPopulation> worldpopulationlist = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
    ...
    ...
new RemoteDataTask().execute();
}

// RemoteDataTask AsyncTask
private class RemoteDataTask extends AsyncTask<Void, Void, Void> {
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        // Create a progressdialog
        mProgressDialog = new ProgressDialog(Ofertas.this);
        // Set progressdialog title
        mProgressDialog.setTitle("Carregando Ofertas");
        // Set progressdialog message
        mProgressDialog.setMessage("Aguarde...");
        mProgressDialog.setIndeterminate(false);
        // Show progressdialog
        mProgressDialog.show();
    }

    @Override
    protected Void doInBackground(Void... params) {
        // Create the array

        worldpopulationlist = new ArrayList<WorldPopulation>();
        try {

            // Locate the class table named "Country" in Parse.com
            ParseQuery<ParseObject> query = new ParseQuery<ParseObject>(
                    "Country");
            // Locate the column named "ranknum" in Parse.com and order list
            // by ascending
            query.orderByAscending("ranknum");
            ob = query.find();
            for (ParseObject country : ob) {
                // Locate images in flag column
                ParseFile image = (ParseFile) country.get("flag");


                WorldPopulation map = new WorldPopulation();
                map.setRank((String) country.get("rank"));
                map.setCountry((String) country.get("country"));
                map.setPopulation((String) country.get("population"));
                map.setFlag(image.getUrl());
                worldpopulationlist.add(map);
            }
        } catch (ParseException e) {
            Log.e("Error", e.getMessage());
            e.printStackTrace();
        }
        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(Ofertas.this,
                worldpopulationlist);
        // Binds the Adapter to the ListView
        listview.setAdapter(adapter);
        // Close the progressdialog
        mProgressDialog.dismiss();
    }

04-21 14:13:37.542 1997-2033/com.example.ronysueliton.patospizzas E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1 Process: com.example.ronysueliton.patospizzas, PID: 1997 java.lang.RuntimeException: An error occured while executing doInBackground() Caused by: java.lang.ClassNotFoundException: Didn't find class "bolts.Task" on path: DexPathList[[zip file "/data/app/com.example.ronysueliton.patospizzas-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] 04-21 14:13:40.692 1997-1997/com.example.ronysueliton.patospizzas E/WindowManager﹕ android.view.WindowLeaked: Activity com.example.ronysueliton.patospizzas.Ofertas has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{36780a24 V.E..... R.....ID 0,0-228,123} that was originally added here

ERRO APÓS APLICATIVO EXECUTADO:

04-21 14:13:28.689 1997-1997/com.example.ronysueliton.patospizzas E/libprocessgroup﹕ failed to make and chown /acct/uid_10063: Read-only file system 04-21 14:13:28.690 1997-1997/com.example.ronysueliton.patospizzas W/Zygote﹕ createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT? 04-21 14:13:28.691 1997-1997/com.example.ronysueliton.patospizzas I/art﹕ Not late-enabling -Xcheck:jni (already on) 04-21 14:13:29.459 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background sticky concurrent mark sweep GC freed 1732(105KB) AllocSpace objects, 0(0B) LOS objects, 19% free, 501KB/623KB, paused 53.836ms total 224.661ms 04-21 14:13:30.092 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background partial concurrent mark sweep GC freed 806(92KB) AllocSpace objects, 0(0B) LOS objects, 48% free, 547KB/1059KB, paused 67.873ms total 587.269ms 04-21 14:13:30.401 1997-1997/com.example.ronysueliton.patospizzas D/gralloc_goldfish﹕ Emulator without GPU emulation detected. 04-21 14:13:32.936 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background sticky concurrent mark sweep GC freed 80(8KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 1013KB/1059KB, paused 55.504ms total 207.889ms 04-21 14:13:32.955 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ WaitForGcToComplete blocked for 12.850ms for cause Background 04-21 14:13:33.177 1997-2009/com.example.ronysueliton.patospizzas W/art﹕ Suspending all threads took: 31.058ms 04-21 14:13:33.267 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background partial concurrent mark sweep GC freed 354(57KB) AllocSpace objects, 0(0B) LOS objects, 31% free, 1107KB/1619KB, paused 36.957ms total 252.492ms 04-21 14:13:33.571 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 54 frames! The application may be doing too much work on its main thread. 04-21 14:13:33.601 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ WaitForGcToComplete blocked for 17.812ms for cause Background 04-21 14:13:33.809 1997-2009/com.example.ronysueliton.patospizzas W/art﹕ Suspending all threads took: 43.646ms 04-21 14:13:33.932 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 364 frames! The application may be doing too much work on its main thread. 04-21 14:13:34.046 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.access$000(com.parse.ParseQuery, com.parse.ParseUser, boolean) took 493.573ms 04-21 14:13:34.136 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background sticky concurrent mark sweep GC freed 2084(127KB) AllocSpace objects, 0(0B) LOS objects, 5% free, 1533KB/1619KB, paused 54.116ms total 495.521ms 04-21 14:13:34.544 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.access$1900(com.parse.ParseQuery, com.parse.ParseUser) took 451.406ms 04-21 14:13:34.642 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background sticky concurrent mark sweep GC freed 1771(149KB) AllocSpace objects, 0(0B) LOS objects, 11% free, 1430KB/1619KB, paused 38.067ms total 165.267ms 04-21 14:13:34.712 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:34.748 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ WaitForGcToComplete blocked for 31.910ms for cause Background 04-21 14:13:34.925 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background sticky concurrent mark sweep GC freed 438(40KB) AllocSpace objects, 0(0B) LOS objects, 9% free, 1463KB/1619KB, paused 37.214ms total 173.018ms 04-21 14:13:34.952 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:34.953 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.countFromLocalDatastoreAsync(com.parse.ParseUser) took 270.375ms 04-21 14:13:34.981 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:34.981 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:35.182 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.countFromNetworkAsync(com.parse.ParseUser, boolean) took 202.508ms 04-21 14:13:35.291 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background sticky concurrent mark sweep GC freed 309(25KB) AllocSpace objects, 0(0B) LOS objects, 8% free, 1477KB/1619KB, paused 51.270ms total 272.787ms 04-21 14:13:35.329 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.countWithCachePolicyAsync(com.parse.ParseQuery$CachePolicy, com.parse.ParseUser) took 146.497ms 04-21 14:13:35.541 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of void com.parse.ParseQuery.doInBackground(com.parse.ParseQuery$CallableWithCachePolicy, com.parse.ParseCallback2) took 209.166ms 04-21 14:13:35.542 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:35.543 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.022 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 2068 frames! The application may be doing too much work on its main thread. 04-21 14:13:36.065 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.doWithRunningCheck(java.util.concurrent.Callable) took 524.220ms 04-21 14:13:36.145 1997-2009/com.example.ronysueliton.patospizzas W/art﹕ Suspending all threads took: 73.184ms 04-21 14:13:36.160 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.161 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.162 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.208 1997-2009/com.example.ronysueliton.patospizzas I/art﹕ Background partial concurrent mark sweep GC freed 1102(96KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 1563KB/2MB, paused 78.681ms total 690.493ms 04-21 14:13:36.288 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.289 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.findFromNetworkAsync(com.parse.ParseUser, boolean) took 127.058ms 04-21 14:13:36.290 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.290 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.291 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.292 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.462 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery.getFromLocalDatastoreAsync(java.lang.String, com.parse.ParseUser) took 169.808ms 04-21 14:13:36.519 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 475 frames! The application may be doing too much work on its main thread. 04-21 14:13:36.632 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 111 frames! The application may be doing too much work on its main thread. 04-21 14:13:36.776 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 129 frames! The application may be doing too much work on its main thread. 04-21 14:13:36.847 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 71 frames! The application may be doing too much work on its main thread. 04-21 14:13:36.871 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of com.parse.ParseQuery com.parse.ParseQuery.getQuery(java.lang.Class) took 407.817ms 04-21 14:13:36.908 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 45 frames! The application may be doing too much work on its main thread. 04-21 14:13:36.950 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:36.950 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:37.005 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 83 frames! The application may be doing too much work on its main thread. 04-21 14:13:37.048 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 33 frames! The application may be doing too much work on its main thread. 04-21 14:13:37.128 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 74 frames! The application may be doing too much work on its main thread. 04-21 14:13:37.211 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 72 frames! The application may be doing too much work on its main thread. 04-21 14:13:37.242 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:37.402 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 175 frames! The application may be doing too much work on its main thread. 04-21 14:13:37.410 1997-2033/com.example.ronysueliton.patospizzas I/art﹕ Rejecting re-init on previously-failed class java.lang.Class 04-21 14:13:37.411 1997-2033/com.example.ronysueliton.patospizzas W/art﹕ Verification of bolts.Task com.parse.ParseQuery$15.call() took 168.938ms 04-21 14:13:37.515 1997-1997/com.example.ronysueliton.patospizzas I/Choreographer﹕ Skipped 91 frames! The application may be doing too much work on its main thread. --------- beginning of crash 04-21 14:13:37.542 1997-2033/com.example.ronysueliton.patospizzas E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1 Process: com.example.ronysueliton.patospizzas, PID: 1997 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:300) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at 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) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lbolts/Task; at com.parse.ParseQuery.checkIfRunning(ParseQuery.java:336) at com.parse.ParseQuery.doWithRunningCheck(ParseQuery.java:933) at com.parse.ParseQuery.findInBackground(ParseQuery.java:997) at com.parse.ParseQuery.find(ParseQuery.java:588) at com.example.ronysueliton.patospizzas.Ofertas$RemoteDataTask.doInBackground(Ofertas.java:101) at com.example.ronysueliton.patospizzas.Ofertas$RemoteDataTask.doInBackground(Ofertas.java:73) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237)             at 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)             at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.ClassNotFoundException: Didn't find class "bolts.Task" on path: DexPathList[[zip file "/data/app/com.example.ronysueliton.patospizzas-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

0

2 Respostas 2

1

Pelo erro Didn't find class "bolts.Task" está dizendo que a classe não existe (Não encontrou a classe "bolts.Task"), é provavel que o pacote referente a classe não foi adicionado ao aplicativo, para isso basta adicionar o pacote bolts-android

Há um link chamado "Artifacts: Maven Central" abaixo de cada Release, nele você encontra a versão jar.

Se você estiver usando o Parse.com, você pode seguir este link: https://parse.com/apps/quickstart#parse_data/mobile/android/native/existing

Instalando o SDK

  • Baixe e extraia o SDK: https://parse.com/downloads/android/Parse/latest
  • Tenha a certeza de estar usando Gingerbread (android-9) ou superior.
  • Adicione o SDK ao seu aplicativo pelo Android Studio:

    Arraste o Parse-*.jar que você baixou para seu aplicativo na pasta "libs" e adicione ao seu build.gradle isto:

    dependencies {
        compile 'com.parse.bolts:bolts-android:1.+'
        compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    }
    

Para o problema failed to make and chown /acct/uid_10063: Read-only file system

Este erro ocorre provavelmente por que a seu android virtual está em modo de leitura, ou não tem um cartão de memoria virtualizado (SDCard), para resolver faça isto:

  • Vá até a poasta .android que fica as maquinas virtuais e procure o arquivo config.ini, por exemplo ~/.android/avd/adv1.avd/config.ini ou no Windows C:\Users\cr\.android\avd\adv1.avd\config.ini

  • Abra o arquivo com um editor de texto como notepad++ ou SublimeText

  • Mude está linha hw.sdCard=no para hw.sdCard=yes

  • Salve o arquivo e reiniciei o AndroidStudio ou Eclipse

  • Abra novamente e tente rodar o seu projeto

1
  • Por favor evitem longas discussões nos comentários; a conversa de vocês foi movida para o chat
    – Maniero
    Commented 24/02/2017 às 18:50
1

Obrigado Guilherme Nascimento pelas dicas, sou novo aqui e queria apenas mostrar como tinha achado a solução. Pois bem, descobri que era necessário adicionar o nome da Class ParseApplication dentro do Android Manifest.

<application
    android:name="ParseApplication"
    ....
2
  • Meu limite de votos excedeu hoje, mas assim que voltar será +1, obrigado por colaborar amigo :)
    – Syzoth
    Commented 23/04/2015 às 17:24
  • Eu que agradeço cara. Obrigado pelas dicas, muito show. Commented 23/04/2015 às 21:18

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .