由于我安装了 react-native-community/geolocation
我的应用程序在启动时一直停止,我什至在模拟器和控制台中都没有看到任何错误。如何调试这个?我所做的只是运行 npm install @react-native-community/geolocation --save
并将 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
添加到 AndroidManifest.xml。
我试图重新启动 VS Code 和整个 PC。我删除了 node_modules 并再次运行 npm install
。构建成功。
我将更改恢复到安装前的状态,但应用程序仍然停止。同样的情况也发生在模拟器和物理设备上。
编辑 1:我从磁盘中删除了 repo 并再次为我的项目运行 git clone
并让我运行我的项目,但仍然没有地理位置。我也尝试安装 Agontuk/react-native-geolocation-service
但它会导致同样的问题并且恢复更改并不能解决这个问题。
在我运行 npm install Agontuk/react-native-geolocation-service
和 npx react-native run-android
之后,我在控制台中看到了这一点,并且应用程序开始在运行时停止:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1139 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Task :react-native-community_async-storage:compileDebugJavaWithJavac
> Task :react-native-gesture-handler:compileDebugJavaWithJavac
> Task :react-native-geolocation-service:compileDebugJavaWithJavac
> Task :react-native-reanimated:compileDebugJavaWithJavac
> Task :react-native-screens:compileDebugJavaWithJavac
> Task :app:compileDebugJavaWithJavac
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libfolly_json.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libnative-filters.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibglog_init.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libhermes-inspector.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibflipper.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
> Task :app:stripDebugDebugSymbols
Compatible side by side NDK version was not found.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibyoga.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibevent-2.1.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libimagepipeline.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibevent_core-2.1.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libimagepipeline.so' due to missing strip tool for ABI 'X86'.
Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libhermes-executor-release.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libevent_core-2.1.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibfolly_json.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibjsc.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibglog_init.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibjsinspector.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibnative-filters.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibfb.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibjscexecutor.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libflipper.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libfb.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libjscexecutor.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libevent_extra-2.1.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libhermes-executor-release.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibnative-filters.so' due to missing strip tool for ABI
'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibhermes-executor-release.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibimagepipeline.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libglog_init.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibevent_extra-2.1.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibjsc.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libfb.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libflipper.so' due to missing strip tool for ABI 'X86_64'.
Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libhermes-executor-debug.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libnative-filters.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibhermes-executor-debug.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibevent-2.1.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libhermes-executor-debug.so' due to missing strip tool for
ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libnative-imagetranscoder.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibfolly_json.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibreactnativeblob.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libfolly_json.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libyoga.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libglog_init.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libreactnativeblob.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libnative-imagetranscoder.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibfb.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libreactnativeblob.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibhermes-executor-debug.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibyoga.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libjsinspector.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libreactnativejni.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibjscexecutor.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibnative-imagetranscoder.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibreactnativejni.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libyoga.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libjsc.so' due to missing strip tool for ABI 'X86'. Packaging
it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibhermes-executor-release.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libjsc.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libhermes-inspector.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibfolly_futures.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libfolly_futures.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libevent-2.1.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibjsijniprofiler.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibevent_extra-2.1.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibfolly_futures.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libevent_extra-2.1.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibflipper.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibhermes-inspector.so' due to missing strip tool for
ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibjsinspector.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibnative-imagetranscoder.so' due to missing strip tool
for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libfolly_futures.so' due to missing strip tool for ABI 'X86'.
Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86_64libevent-2.1.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibevent_core-2.1.so' due to missing strip tool for ABI
'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libjscexecutor.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libjsinspector.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibreactnativejni.so' due to missing strip tool for ABI
'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libreactnativejni.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibhermes-inspector.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarmeabi-v7alibreactnativeblob.so' due to missing strip tool for ABI 'ARMEABI_V7A'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibx86libevent_core-2.1.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
Unable to strip library 'C:pathToAppandroidappbuildintermediatesmerged_native_libsdebugoutlibarm64-v8alibimagepipeline.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
> Task :app:installDebug
03:52:58 V/ddms: execute: running am get-config
03:52:58 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
03:52:58 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Pixel_3a_API_28(AVD) - 9' for app:debug
03:52:58 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
03:52:58 D/Device: Uploading file onto device 'emulator-5554'
03:52:58 D/ddms: Reading file permision of C:pathToAppandroidappbuildoutputsapkdebugapp-debug.apk as: rwx------
03:52:58 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
03:52:59 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
03:52:59 V/ddms: execute: returning
03:52:59 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
03:52:59 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
03:52:59 V/ddms: execute: returning
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 31s
187 actionable tasks: 51 executed, 136 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.appname/.MainActivity }