2017-04-25 372 views
0

我試圖在Android上運行我的反應原生應用程序,該應用程序在iOS上完美工作,但是當我在android上編譯它時,應用程序崩潰,給我的留言:

unfortunately, the app has stopped working致命異常:AsyncTask#3 java.lang.RuntimeException:執行doInBackground()時發生錯誤

我的logcat:

04-25 10:34:40.514 7810-7866/com.ferretotalapp E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3 
                   Process: com.ferretotalapp, PID: 7810 
                   java.lang.RuntimeException: An error occurred while executing doInBackground() 
                    at android.os.AsyncTask$3.done(AsyncTask.java:309) 
                    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) 
                    at java.util.concurrent.FutureTask.setException(FutureTask.java:223) 
                    at java.util.concurrent.FutureTask.run(FutureTask.java:242) 
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
                    at java.lang.Thread.run(Thread.java:818) 
                    Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.maps.GoogleMapOptions 
                    at com.airbnb.android.react.maps.AirMapManager.<init>(AirMapManager.java:52) 
                    at com.airbnb.android.react.maps.MapsPackage.createViewManagers(MapsPackage.java:39) 
                    at com.facebook.react.XReactInstanceManagerImpl.createAllViewManagers(XReactInstanceManagerImpl.java:699) 
                    at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:206) 
                    at com.facebook.react.CoreModulesPackage.access$200(CoreModulesPackage.java:71) 
                    at com.facebook.react.CoreModulesPackage$8.get(CoreModulesPackage.java:145) 
                    at com.facebook.react.CoreModulesPackage$8.get(CoreModulesPackage.java:142) 
                    at com.facebook.react.LazyReactPackage.createNativeModules(LazyReactPackage.java:76) 
                    at com.facebook.react.XReactInstanceManagerImpl.processPackage(XReactInstanceManagerImpl.java:958) 
                    at com.facebook.react.XReactInstanceManagerImpl.createReactContext(XReactInstanceManagerImpl.java:863) 
                    at com.facebook.react.XReactInstanceManagerImpl.access$600(XReactInstanceManagerImpl.java:110) 
                    at com.facebook.react.XReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(XReactInstanceManagerImpl.java:214) 
                    at com.facebook.react.XReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(XReactInstanceManagerImpl.java:193) 
                    at android.os.AsyncTask$2.call(AsyncTask.java:295) 
                    at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  
                    at java.lang.Thread.run(Thread.java:818)  
04-25 10:34:40.536 7810-7835/com.ferretotalapp W/unknown:InspectorPackagerConnection: Couldn't connect to packager, will silently retry<br> <br> 
04-25 10:34:40.714 7810-7844/com.ferretotalapp E/Surface: getSlotFromBufferLocked: unknown buffer: 0xf3e145a0 
+2

錯誤實際上是一個深一點,'產生的原因:java.lang.NoClassDefFoundError:com.google.android.gms.maps.GoogleMapOptions' – nbokmans

回答

0

包括在你的build.gradle文件中以下行位於「應用程序」目錄中。該錯誤是由於ART無法找到GoogleMapOptions的Class文件而導致的。

dependencies { 
    ... 
    compile 'com.google.android.gms:play-services-maps:+' 
    ... 
} 
+0

@Marco波蒂略,請給予好評,如果你接受了答案。 –

+0

它的工作原理!謝謝@Akshayraj Kore –

相關問題