其他分享
首页 > 其他分享> > android – Dropbox Sync API – 不满意的链接错误

android – Dropbox Sync API – 不满意的链接错误

作者:互联网

我正在尝试在现有的Android应用程序中实现DropboxSync API.
我已经下载了DropboxSync API并复制了我的Application的lib文件夹中的所有库.
我还将Native Library位置指向libDropboxSync.so所在的libs文件夹.

的Manifest.xml

....
        <!-- Dropbox Activities -->
    <activity android:name="com.dropbox.sync.android.DbxAuthActivity" />
    <activity
        android:name="com.dropbox.client2.android.AuthActivity"
        android:launchMode="singleTask" >
        <intent-filter>
            <data android:scheme="db-intentionally-hidden-app-key" />

            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <service
        android:name="com.dropbox.sync.android.DbxSyncService"
        android:enabled="true"
        android:exported="false"
        android:label="Dropbox Sync" />

Main_Activity.java

public class Activity_Main extends Activity implements OnClickListener,
OnItemClickListener, OnTouchListener {
....
....
....
private DbxAccountManager mDbxAcctMgr;

onCreate(....)
{
//Application giving FATAL EXCEPTION on the line below.
mDbxAcctMgr = DbxAccountManager.getInstance((Activity)Activity_Main.this, DROPBOX_APP_KEY, DROPBOX_APP_SECRET); 
....
}
....
}

Logcat日志

12-06 10:10:25.362: E/AndroidRuntime(8110): FATAL EXCEPTION: main
12-06 10:10:25.362: E/AndroidRuntime(8110): Process: com.***.***, PID: 8110
12-06 10:10:25.362: E/AndroidRuntime(8110): java.lang.UnsatisfiedLinkError: Couldn't load DropboxSync from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.***.***-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.***.***-1, /vendor/lib, /system/lib]]]: findLibrary returned null
12-06 10:10:25.362: E/AndroidRuntime(8110):     at java.lang.Runtime.loadLibrary(Runtime.java:358)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at java.lang.System.loadLibrary(System.java:526)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.dropbox.sync.android.NativeHttp.<clinit>(NativeHttp.java:447)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.dropbox.sync.android.NativeLib.<init>(NativeLib.java:33)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.dropbox.sync.android.NativeLib.<clinit>(NativeLib.java:11)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.dropbox.sync.android.CoreAccountManager.initNativeLib(CoreAccountManager.java:155)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.dropbox.sync.android.CoreAccountManager.<init>(CoreAccountManager.java:126)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:149)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:115)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.***.***.activities.Activity_Main.onCreate(Activity_Main.java:459)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.app.Activity.performCreate(Activity.java:5243)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.app.ActivityThread.access$700(ActivityThread.java:135)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.os.Handler.dispatchMessage(Handler.java:102)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.os.Looper.loop(Looper.java:137)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at android.app.ActivityThread.main(ActivityThread.java:4998)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at java.lang.reflect.Method.invokeNative(Native Method)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at java.lang.reflect.Method.invoke(Method.java:515)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
12-06 10:10:25.362: E/AndroidRuntime(8110):     at dalvik.system.NativeStart.main(Native Method)
12-06 10:10:25.532: W/ActivityThread(8110): ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());

我已经尝试过这个解决方案:Error in dropboxSync: findlibrary returned null但它不适用于我.所以请不要将此问题标记为重复.

非常感谢任何帮助,谢谢.

解决方法:

libs目录下的armeabi-v7a文件夹中缺少libDropboxSync.so.
我将libDropboxSync.so从armeabi-v7文件夹复制到libs目录下的armeabi-v7a文件夹,并且库已成功加载.
由于我使用Google-Nexus-7第二代进行调试,因此armeabi-v7a文件夹中的DropboxSync库是必须的.

标签:dropbox-api,android
来源: https://codeday.me/bug/20190927/1824392.html