Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在使用android app demo遇到問題 #11

Open
piglier opened this issue Jan 28, 2019 · 14 comments
Open

在使用android app demo遇到問題 #11

piglier opened this issue Jan 28, 2019 · 14 comments

Comments

@piglier
Copy link

piglier commented Jan 28, 2019

您好:我已依照以下網址操作
https://github.com/GO-LiFE/GoFIT_SDK_Android/wiki/Demo-App-(SDK-的安裝與-compile)
APP是可以啟動了,用來 initialize SDK,開啟 app 後須先執行此功能會發生error閃退錯誤狀況如下圖
2019-01-27 1 37 26
錯誤訊息如下:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.goyourlife.gofit_demo-jHue2eCjM08K_Fau2jVoiA==/base.apk"],nativeLibraryDirectories=[/data/app/com.goyourlife.gofit_demo-jHue2eCjM08K_Fau2jVoiA==/lib/x86, /system/lib]]] couldn't find "libsdk-lib.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
再煩請協助,感謝!

@rik296
Copy link

rik296 commented Jan 28, 2019

Hi,請問一下您用的 Android studio 版本是多少?電腦的系統與 OS 為何?可以的話將 app 的 build.gradle 附給我們看,我們需要多一點線索來找問題,感謝🙏

@piglier
Copy link
Author

piglier commented Jan 28, 2019 via email

@rik296
Copy link

rik296 commented Jan 29, 2019

Hi,您附上的文件好像沒有正確的顯示出來,可以麻煩再附上一次嗎?
還有,請提供一下您的 android studio (編寫 android 程式的 IDE) 版本號給我們,如下圖:
2019-01-29 10 19 14

@piglier
Copy link
Author

piglier commented Jan 29, 2019 via email

@rik296
Copy link

rik296 commented Jan 29, 2019

Hi,附件的部分,要請您直接到 GitHub 的 issue list 這邊直接張貼喔,不要用 email 直接回覆,這樣在 GitHub 這邊會無法顯示,您可以點擊 email 上的 view it on GitHub 這個連結直接進到 GitHub 的討論串,謝謝!

@piglier
Copy link
Author

piglier commented Feb 1, 2019

image

請問還有什麼需要提供的?
有改善的方法嗎?

@cciinnddyy
Copy link

您好:
我碰到了類似的error

按下 sdk init 閃退

錯誤訊息如下
initerror

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.goyourlife.gofit_demo-1/base.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.goyourlife.gofit_demo-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.goyourlife.gofit_demo-1/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libsdk-lib.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:972)

關於 Android Studio

Android Studio 3.3
Build #AI-182.5107.16.33.5199772, built on December 25, 2018
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

build.gradle (Project)

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle (Module:app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.goyourlife.gofit_demo"
        minSdkVersion 18
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a'
            //'x86_64'
            universalApk true
        }
    }
}

allprojects {
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation (name:'GoFIT_SDK-release', ext:'aar')
}

@rik296
Copy link

rik296 commented Feb 11, 2019

Hi, @cciinnddyy
感謝您提供的資訊,看起來是 splits apk 時發生了問題,建議您移除 splits{} 看看,以下是我可以正常運行的 app build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.goyourlife.gofit_demo"
        minSdkVersion 18
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

allprojects {
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation (name:'GoFIT_SDK-release', ext:'aar')
}

@piglier 若您的 build.gradle 也有 splits 的設置,也可試著移除看看

@cciinnddyy
Copy link

@rik296
如果把 splits{} 移除

installation of APK 會 失敗
erroapks

將build.gradle改為您的代碼也無法運行

@rik296
Copy link

rik296 commented Feb 11, 2019

Hi, 請問您是使用模擬器運行 app 嗎?
若可以的話,請使用 android 手機運行 app,因為我們目前的 native library 僅支援 armv7 架構,沒有支援 x86 架構

@piglier
Copy link
Author

piglier commented Feb 13, 2019

已在平板上完成安裝,SDK init/reinit完成後
執行1.Scan Device後一直顯示錯誤
doScanDevice():onFailure():errorCode=11,
errorMsg = Device BLE is not enable
無法執行掃描裝置的動作

@rik296
Copy link

rik296 commented Feb 14, 2019

Hi, @piglier
Device BLE is not enable 表示裝置的藍牙開關沒有開啟,請您先檢查一下您的平板藍牙是否有打開

@piglier
Copy link
Author

piglier commented Feb 14, 2019

藍牙開了,Scan Device下方顯示Device not found
我的手錶為CARE-X HR
還是手錶要切模式嗎?還有什麼要注意?

@rik296
Copy link

rik296 commented Feb 14, 2019

Hi,需要確認 Care-X HR 沒有被其他手機或 app (像是 GoFIT app) 連住,可先看手環上的藍牙符號是否為 X,執行 scan device 可從 logcat 上看到是否有裝置回傳,有時可能因為手環距離較遠導致訊號較弱而顯示 Device not found,建議可多試幾次看看😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants