I'm trying to run my react native application on Android, the app works perfectly on iOS, but when I compiler it on android, the app crashes and give me the message: unfortunately, the app has stopped working
我试着在Android上运行我的react native应用程序,这个应用程序在iOS上运行得很好,但是当我在Android上编译它时,这个应用程序崩溃了,并告诉我:不幸的是,这个应用程序已经停止工作了
my logcat:
我的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
1 个解决方案
#1
0
Include the following lines in your build.gradle file located inside the "app" directory. The error is caused because ART is not able to locate Class file for GoogleMapOptions.
在构建中包含以下行。位于“应用”目录中的渐变文件。这个错误是由于ART无法为GoogleMapOptions定位类文件而导致的。
dependencies {
...
compile 'com.google.android.gms:play-services-maps:+'
...
}
#1
0
Include the following lines in your build.gradle file located inside the "app" directory. The error is caused because ART is not able to locate Class file for GoogleMapOptions.
在构建中包含以下行。位于“应用”目录中的渐变文件。这个错误是由于ART无法为GoogleMapOptions定位类文件而导致的。
dependencies {
...
compile 'com.google.android.gms:play-services-maps:+'
...
}