我正在使用 expo 34 托管工作流,对于一些额外的功能,我需要弹出我的 expo 应用程序。当我弹出 expo 应用程序时,除了react-native-maps
一切正常。
我已经按照react-native-maps进行链接的每一个步骤。当我yarn android
成功运行构建完成时(在 android studio 中也没有显示任何错误)但是我的应用程序在打开时崩溃了。如果我评论说本机代码(react-native-maps config)应用程序工作正常。
这是我的代码。
安卓/settings.gradle
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
includeUnimodulesProjects()
android/app/build.gradle
dependencies {
implementation project(':react-native-screens')
implementation project(':react-native-reanimated')
implementation project(':react-native-gesture-handler')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'
addUnimodulesDependencies()
}
android/app/src/main/AndroidManifest.xml
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="my_api_key"/>
MainApplication.java
import com.airbnb.android.react.maps.MapsPackage;
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReanimatedPackage(),
new RNGestureHandlerPackage(),
new RNScreensPackage(),
new ModuleRegistryAdapter(mModuleRegistryProvider),
new MapsPackage()
);
}
日志警告
2019-10-01 13:23:33.638 18391-18391/? E/:accountservic: Not starting debugger since process cannot load the jdwp agent.
2019-10-01 13:23:33.661 18352-18352/? E/ctivate.servic: Invalid ID 0x00000000.
2019-10-01 13:23:33.680 18352-18352/? E/ctivate.servic: Invalid ID 0x00000000.
2019-10-01 13:23:33.742 18391-18391/? E/:accountservic: Invalid ID 0x00000000.
2019-10-01 13:23:33.767 18391-18391/? E/:accountservic: Invalid ID 0x00000000.
2019-10-01 13:23:33.784 18391-18391/? E/:accountservic: Invalid ID 0x00000000.
2019-10-01 13:23:33.808 18391-18391/? E/:accountservic: Invalid ID 0x00000000.
2019-10-01 13:23:33.906 18447-18447/? E/facebook.katan: Not starting debugger since process cannot load the jdwp agent.
2019-10-01 13:23:33.937 18276-18276/com.mapview E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mapview, PID: 18276
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mapview/com.mapview.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:457)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:145)
at com.facebook.react.ReactActivityDelegate.loadApp(ReactActivityDelegate.java:89)
at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:75)
at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:52)
at android.app.Activity.performCreate(Activity.java:7224)
at android.app.Activity.performCreate(Activity.java:7213)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
2019-10-01 13:23:33.941 569-569/? E/SELinux: avc: denied { find } for service=miui.mqsas.MQSService pid=18276 uid=10245 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:mqs_service:s0 tclass=service_manager permissive=0
2019-10-01 13:23:33.942 18276-18276/com.mapview E/MQSEventManagerDelegate: failed to get MQSService.
2019-10-01 13:23:34.003 1705-1717/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.mi.android.globallauncher/com.miui.home.launcher.Launcher/2070005
2019-10-01 13:23:34.110 701-13206/? E/QSEECOMAPI: Error::Cannot de-alloc memory. priv handle is NULL!!.
2019-10-01 13:23:34.317 18447-18447/? E/ACRA: Initializing ANR detector for process: com.facebook.katana
2019-10-01 13:23:34.328 18447-18447/? E/FacebookApplication: Unable to install asan reader
2019-10-01 13:23:34.382 18447-18447/? E/dalvik-internals: attempting to hook OatFileManager::HasCollisions
2019-10-01 13:23:34.382 18447-18447/? E/dalvik-internals: attempting to hook OatFileAssistant::IsUpToDate
2019-10-01 13:23:34.383 18447-18447/? E/dalvik-internals: attempting to hook OatFileAssistant::IsUpToDate
2019-10-01 13:23:34.383 18447-18447/? E/dalvik-internals: could not hook _ZN3art16OatFileAssistant17OatFileIsUpToDateEv
2019-10-01 13:23:34.383 18447-18447/? E/dalvik-internals: attempting to hook OatFileAssistant::IsUpToDate
2019-10-01 13:23:34.384 18447-18447/? E/dalvik-internals: could not hook _ZN3art16OatFileAssistant18OdexFileIsUpToDateEv
2019-10-01 13:23:34.384 18447-18447/? E/dalvik-internals: attempting to hook OatFileAssistant::IsUpToDate
2019-10-01 13:23:34.384 18447-18447/? E/dalvik-internals: could not hook _ZN3art16OatFileAssistant22GivenOatFileIsUpToDateERKNS_7OatFileE
2019-10-01 13:23:34.522 18537-18537/? E/dboxed_process: Not starting debugger since process cannot load the jdwp agent.
2019-10-01 13:23:34.625 18447-18447/? E/dalvik-internals: skipping IsUpToDate check for incoming dex file
2019-10-01 13:23:35.099 18447-18591/? E/fb4a.FbTrafficStats: Unable to parse data usage from system file
X.2LF: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats (Permission denied)
at X.16c.A00(:235)
at X.16X.A04(:32)
at X.16Y.run(:10)
at X.0c2.run(:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at X.0cA.run(:3)
at X.0cC.run(:12)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats (Permission denied)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:231)
at java.io.FileInputStream.<init>(FileInputStream.java:165)
at X.16c.A00(:16)
at X.16X.A04(:32)
at X.16Y.run(:10)
at X.0c2.run(:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at X.0cA.run(:3)
at X.0cC.run(:12)
at java.lang.Thread.run(Thread.java:764)
2019-10-01 13:23:35.100 18447-18591/? E/fb4a.FbTrafficStats: Unable to parse data usage from system file
X.2LF: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats (Permission denied)
at X.16c.A00(:235)
at X.16X.A04(:55)
at X.16Y.run(:10)
at X.0c2.run(:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at X.0cA.run(:3)
at X.0cC.run(:12)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.io.FileNotFoundException: /proc/net/xt_qtaguid/stats (Permission denied)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:231)
at java.io.FileInputStream.<init>(FileInputStream.java:165)
at X.16c.A00(:16)
at X.16X.A04(:55)
at X.16Y.run(:10)
at X.0c2.run(:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at X.0cA.run(:3)
at X.0cC.run(:12)
at java.lang.Thread.run(Thread.java:764)
2019-10-01 13:23:35.270 1916-1916/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2019-10-01 13:23:35.270 1916-1916/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2019-10-01 13:23:35.271 1916-1916/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2019-10-01 13:23:35.283 18447-18563/? E/CompactDiskManagerImpl.cpp:697: Failed to remove new folder structure directories: No such file or directory
2019-10-01 13:23:35.949 18447-18532/? E/fb4a.PassiveBleCollector: Couldn't start passive BLE scanning
X.9Nc: Ble scan error: USER_DISABLED
at X.9O1.A00(:29)
at X.9O1.Bbo(:4)
at X.4ix.A00(:4)
at X.9Nf.run(:439)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:207)
at android.os.HandlerThread.run(HandlerThread.java:65)
at X.0bn.run(:0)
2019-10-01 13:23:36.135 18646-18646/? E/m.facebook.orc: Not starting debugger since process cannot load the jdwp agent.
2019-10-01 13:23:36.160 18660-18660/? E/book.appmanage: Not starting debugger since process cannot load the jdwp agent.
2019-10-01 13:23:36.194 18646-18646/? E/m.facebook.orc: Dex checksum does not match for dex: /system/framework/com.google.android.maps.jar.Expected: 3079070930, actual: 1845989642
2019-10-01 13:23:36.248 18660-18660/? E/ACRA: Initializing ANR detector for process: com.facebook.appmanager
2019-10-01 13:23:36.268 18660-18660/? E/SQLiteLog: (14) cannot open file at line 36667 of [c255889bd9]
2019-10-01 13:23:36.268 18660-18660/? E/SQLiteLog: (14) os_unix.c:36667: (2) open(/data/user/0/com.facebook.appmanager/databases/androidx.work.workdb) -
2019-10-01 13:23:36.269 18660-18660/? E/SQLiteDatabase: Failed to open database '/data/user/0/com.facebook.appmanager/databases/androidx.work.workdb'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:211)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:195)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:503)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:204)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:196)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:880)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:865)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:766)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
at com.facebook.oxygen.common.androidx.workmanager.initializer.b.a(WorkManagerDatabase.java:20)
at com.facebook.oxygen.appmanager.app.c.b(AppManagerApplicationImpl.java:19)
at com.facebook.oxygen.common.f.b.d.onCreate(OxpDelegatingApplication.java:68)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1155)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5948)
at android.app.ActivityThread.access$1200(ActivityThread.java:200)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
2019-10-01 13:23:36.382 18660-18697/? E/ActivityThread: Failed to find provider info for com.facebook.appmanager.nekodirect
2019-10-01 13:23:36.459 18646-18689/? E/ACRA: Initializing ANR detector for process: com.facebook.orca
我已经尝试过 Expo 35 bareApp,然后也遇到了同样的问题。
任何人都可以帮助解决这个问题。自2天以来就卡住了。