我对这个问题进行了研究,但没有答案有帮助。 我是Android的新手,所以请先了解更多来源和信息。 我已将我们的公司应用程序从Eclipse迁移到Android Studio但仍然致命:
AndroidRuntime: FATAL EXCEPTION: main
Process: com.streamunlimited.stream700, PID: 6297
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.streamunlimited.stream700-2/base.apk"],nativeLibraryDirectories=[/data/app/com.streamunlimited.stream700-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libgnustl_shared.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.streamunlimited.stream700.DeviceOverviewActivity.<clinit>(DeviceOverviewActivity.java:86)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:5526)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
这是build.gradle文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'com.android.application'
dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
}
android {
compileSdkVersion 16
buildToolsVersion "23.0.3"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
Application.mk:
APP_OPTIM := debug # release
APP_PLATFORM := android-8
APP_STL := gnustl_static
APP_CPPFLAGS += -frtti
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -DANDROID
Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# additional include directories
LOCAL_C_INCLUDES += /opt/sca-android-debug/include \
../../../lib/RemoteBrowser/ \
../../../lib/NetAPI/ \
../../../lib/NetAPI/core \
../../../lib/NetAPI/client \
../../../lib/NetAPI/interface \
../../../lib/NetAPI/server \
../../../lib/Stream800API/ \
../../../lib/Stream800API/src \
../../../lib/Stream800API/lib/picojson \
../../../lib/Stream800API/src/library \
# compiler flags
#LOCAL_CFLAGS += -DPOCO_ANDROID -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY
LOCAL_CPPFLAGS += -g -O0
# linker flags
LOCAL_LDLIBS += -L/opt/sca-android-debug/lib -llog -lPocoNetd -lPocoDatad -lPocoUtild -lPocoXMLd -lPocoFoundationd
# we will create this library
LOCAL_MODULE := RemoteApi
# files to compile
LOCAL_SRC_FILES := RemoteApi.cpp
REMOTE_BROWSER := \
../../../../lib/RemoteBrowser/RemoteBrowser.cpp \
../../../../lib/RemoteBrowser/NetAPIRemoteBrowser.cpp \
../../../../lib/RemoteBrowser/RemoteBrowser_wrap.cxx \
NETAPI_CLIENT := \
../../../../lib/NetAPI/client/NetAPI_Client.cpp \
../../../../lib/NetAPI/client/NetAPI_Event_Handlers.cpp \
../../../../lib/NetAPI/client/NetAPI_TCP_Client.cpp
NETAPI_CORE := \
../../../../lib/NetAPI/core/NetAPI_Commands.cpp \
../../../../lib/NetAPI/core/NetAPI_Connection.cpp \
../../../../lib/NetAPI/core/NetAPI_Core.cpp \
../../../../lib/NetAPI/core/NetAPI_Data.cpp \
../../../../lib/NetAPI/core/NetAPI_Events.cpp \
../../../../lib/NetAPI/core/NetAPI_Init.cpp \
../../../../lib/NetAPI/core/NetAPI_Module.cpp \
../../../../lib/NetAPI/core/NetAPI_Module_Basic.cpp \
../../../../lib/NetAPI/core/NetAPI_Module_Core.cpp \
../../../../lib/NetAPI/core/NetAPI_Module_Debug.cpp \
../../../../lib/NetAPI/core/NetAPI_Protocol_XML.cpp \
../../../../lib/NetAPI/core/NetAPI_TCP_Transport.cpp
NETAPI_INTERFACE := \
../../../../lib/NetAPI/interface/NetAPI_Controller_Interface.cpp \
../../../../lib/NetAPI/interface/NetAPI_UI_Interface.cpp \
NETAPI_SERVER := \
../../../../lib/NetAPI/server/NetAPI_Server.cpp \
../../../../lib/NetAPI/server/NetAPI_TCP_Server.cpp \
../../../../lib/NetAPI/server/NetAPI_Test_Server.cpp \
NETAPI_PREFIX := \
../../../../lib/NetAPI/Prefix.cpp
STREAM800API_LIB := \
../../../../lib/Stream800API/src/library/Commands.cpp \
../../../../lib/Stream800API/src/library/Controller.cpp \
../../../../lib/Stream800API/src/library/EventHandler.cpp \
../../../../lib/Stream800API/src/library/EventPoller.cpp \
../../../../lib/Stream800API/src/library/Helpers.cpp \
../../../../lib/Stream800API/src/library/HTTPTransport.cpp \
../../../../lib/Stream800API/src/library/StreamAPI.cpp \
LOCAL_SRC_FILES += $(REMOTE_BROWSER)
LOCAL_SRC_FILES += $(NETAPI_CLIENT)
LOCAL_SRC_FILES += $(NETAPI_CORE)
LOCAL_SRC_FILES += $(NETAPI_INTERFACE)
LOCAL_SRC_FILES += $(NETAPI_PREFIX)
LOCAL_SRC_FILES += $(NETAPI_SERVER)
LOCAL_SRC_FILES += $(STREAM800API_LIB)
# NETAPI_FILES := $(wildcard $(LOCAL_PATH)../../../../lib/NetAPI/*.cpp)
# NETAPI_FILES := $(MY_FILES:$(LOCAL_PATH)/%=%)
# LOCAL_SRC_FILES += $(NETAPI_FILES)
LOCAL_WHOLE_STATIC_LIBRARIES := libgnustl_shared
include $(BUILD_SHARED_LIBRARY)