Bug 156623 - - Android Viewer can't open any office files and crashed
Summary: - Android Viewer can't open any office files and crashed
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Android Viewer (show other bugs)
Version:
(earliest affected)
7.4.7.2 release
Hardware: ARM Android
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-04 20:01 UTC by eric li
Modified: 2023-08-14 07:13 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eric li 2023-08-04 20:01:46 UTC
Description:
2023-08-05 02:06:29.333  9220-9450  LibreOfficeKit          org.example.libreoffice              I  LibreOfficeKit: libreofficekit_initialize finished
2023-08-05 02:06:29.335  9220-9220  ActivityThread          org.example.libreoffice              D  add activity client record, r= ActivityRecord{2eddda1 token=android.os.BinderProxy@5baa850 {org.example.libreoffice/org.libreoffice.LibreOfficeMainActivity}} token= android.os.BinderProxy@5baa850
2023-08-05 02:06:29.337  9220-9220  LibreOfficeMainActivity org.example.libreoffice              I  onStart..
2023-08-05 02:06:29.340  9220-9220  LibreOfficeMainActivity org.example.libreoffice              I  onResume..
2023-08-05 02:06:29.341  9220-9220  DecorView[]             org.example.libreoffice              I  set decor visibility 4
2023-08-05 02:06:29.346  9220-9453  stderr                  org.example.libreoffice              I  Bootstrapping exception 'xcd: unresolved dependencies in file:///assets/share/registry'
2023-08-05 02:06:29.348  9220-9453  stderr                  org.example.libreoffice              I  terminating with uncaught exception of type com::sun::star::uno::RuntimeException
2023-08-05 02:06:29.348  9220-9453  stderr                  org.example.libreoffice              I  /buildbot/src/android/ndk-r25-release/toolchain/llvm-project/libcxx/../../../toolchain/llvm-project/libcxxabi/src/abort_message.cpp:72: abort_message: assertion "terminating with uncaught exception of type com::sun::star::uno::RuntimeException" failed
2023-08-05 02:06:29.348  9220-9450  libc                    org.example.libreoffice              A  /buildbot/src/android/ndk-r25-release/toolchain/llvm-project/libcxx/../../../toolchain/llvm-project/libcxxabi/src/abort_message.cpp:72: abort_message: assertion "terminating with uncaught exception of type com::sun::star::uno::RuntimeException" failed
2023-08-05 02:06:29.349  9220-9450  libc                    org.example.libreoffice              A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9450 (Thread-3), pid 9220 (ple.libreoffice)
2023-08-05 02:06:29.359  9220-9220  ViewRootIm...nActivity] org.example.libreoffice              I  controlInsetsForCompatibility not hide statusbar
2023-08-05 02:06:29.364  9220-9220  InputEventReceiver      org.example.libreoffice              D  dispatchInputInterval 1000000

Steps to Reproduce:
1.when using the android app to open any file ,it will crashed and logcat as in the description
2.
3.

Actual Results:
everything is follow the wiki how to build android app and successed ..but only open any file ,it will crash...same result with Bug 99605 

Expected Results:
crasehd


Reproducible: Always


User Profile Reset: No

Additional Info:
none
Comment 1 Michael Weghorn 2023-08-04 20:40:48 UTC
Since you've set the "Version" field to 7.4.7.2: Is that the git tag/tarball from which you're building?

What happens when you use the version from F-Droid instead?
https://f-droid.org/en/packages/org.documentfoundation.libreoffice/

Does it also crash when you build with current git master or the libreoffice-7-6 branch?
Comment 2 Michael Weghorn 2023-08-04 20:42:16 UTC
My local Android build with git master as of commit eef0c5d4d45ba35acfb6d8f7551fe565ca4badaa builds and runs fine on an x86_64 AVD in a quick test.
Comment 3 eric li 2023-08-06 15:19:21 UTC
(In reply to Michael Weghorn from comment #1)
> Since you've set the "Version" field to 7.4.7.2: Is that the git tag/tarball
> from which you're building?
> 
> What happens when you use the version from F-Droid instead?
> https://f-droid.org/en/packages/org.documentfoundation.libreoffice/
> 
> Does it also crash when you build with current git master or the
> libreoffice-7-6 branch?

I just used git and pull download from github as following the instructions of how to build android libreoffice from the official website...it is around 2 months ago ,,and I don't know how to check the version exactly from source project..
Comment 4 eric li 2023-08-06 15:22:08 UTC
(In reply to Michael Weghorn from comment #1)
> Since you've set the "Version" field to 7.4.7.2: Is that the git tag/tarball
> from which you're building?
> 
> What happens when you use the version from F-Droid instead?
> https://f-droid.org/en/packages/org.documentfoundation.libreoffice/
> 
> Does it also crash when you build with current git master or the
> libreoffice-7-6 branch?

the build.gradle file in source is belowed:
apply plugin: 'com.android.application'
// buildhost settings - paths and the like
apply from: 'liboSettings.gradle'

allprojects {
    repositories {
        mavenCentral()
        maven {
            url "https://ipv6.repo1.maven.org/maven2"
        }
        google()
    }
}
//build-time dependencies - android plugin for gradle
buildscript {
    repositories {
        mavenCentral()
        maven {
            url "https://ipv6.repo1.maven.org/maven2"
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.2'
    }
}

// compile-time dependencies
dependencies {
    implementation fileTree(dir: "${liboInstdir}/${liboUREJavaFolder}", include: [
            "java_uno.jar",
            "libreoffice.jar",
            "unoloader.jar"
    ])
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation "androidx.multidex:multidex:2.0.1"
}

android {
    namespace 'org.libreoffice'
    compileSdkVersion 33
    // uses non-conventional source layout, so need to reconfigure accordingly
    // ToDo move to conventional layout, so stuff can be stripped down.

    sourceSets {
        main.manifest.srcFile 'AndroidManifest.xml'
        main.assets.srcDirs = ['assets']
        main.res.srcDirs = ['res', 'res_generated']
        main.java.srcDirs = ['../Bootstrap/src', 'src/java']
        main.jniLibs.srcDirs = ["${liboJniLibsdir}"]
       // main.jniLibs.srcDirs = ['/home/eric/libreoffice/android/jniLibs/armeabi-v7a/']
        // the configuration data that might be stripped or not
        fullUI.assets.srcDirs 'assets_fullUI'
        strippedUI.assets.srcDirs 'assets_strippedUI'
        strippedUIEditing.assets.srcDirs 'assets_strippedUI'
    }
    defaultConfig {
        // minSdkVersion is set in liboSettings.gradle
        targetSdkVersion 33
        // multidex needed when > 65,536 methods referenced with minSdKVersion < 21
        // s. https://developer.android.com/studio/build/multidex
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        ndk {
            abiFilters "armeabi-v7a"
        }
        externalNativeBuild {
            cmake {
                arguments "-DANDROID_STL=none"
                cppFlags ""
            }
        }
    }
    buildTypes {
        debug {
            // make android studio happy...
            jniDebuggable true
            // would work just fine with external, but setting emulator up is a little more work
            manifestPlaceholders = [installLocation: "auto"]
        }
        release {
            manifestPlaceholders = [installLocation: "preferExternal"]
        }
    }

    flavorDimensions "default"
    productFlavors {
        strippedUI {
            dimension "default"
            buildConfigField 'boolean', 'ALLOW_EDITING', 'false'
        }
        strippedUIEditing {
            dimension "default"
            buildConfigField 'boolean', 'ALLOW_EDITING', 'true'
            versionNameSuffix "-editing"
        }
        fullUI.dimension "default"
    }
    lint {
        // don't error-out on missing translations
        warning 'MissingTranslation'
    }
}

/* remark inherited from makefile:
Then "assets". Let the directory structure under assets mimic
that under solver for now.

Please note that I have no idea what all of this is really necessary and for
much of this stuff being copied, no idea whether it makes any sense at all.
Much of this is copy-pasted from android/qa/sc/Makefile (where a couple of
unit tests for sc are built, and those do seem to mostly work) and
android/qa/desktop/Makefile (mmeeks's desktop demo, also works to some
extent)
 */

// Assets that are unpacked at run-time into the app's data directory. These
// are files read by non-LO code, fontconfig and freetype for now, that doesn't
// understand "/assets" paths.
task copyUnpackAssets(type: Copy) {
    description "copies assets that need to be extracted on the device"
    into 'assets/unpack'
    into('program') {
        from("${liboInstdir}/${liboEtcFolder}/types") {
            includes = [
                    "offapi.rdb",
                    "oovbaapi.rdb"
            ]
        }
        from("${liboInstdir}/${liboUreMiscFolder}") {
            includes = ["types.rdb"]
            rename 'types.rdb', 'udkapi.rdb'
        }
    }
    into('user/fonts') {
        from "${liboInstdir}/share/fonts/truetype"
        // Note: restrict list of fonts due to size considerations - no technical reason anymore
        // ToDo: fonts would be good candidate for using Expansion Files instead
        includes = [
                "Liberation*.ttf",
                "Caladea-*.ttf",
                "Carlito-*.ttf",
                "Gen*.ttf",
                "opens___.ttf"
        ]
    }
    into('etc/fonts') {
        from "./"
        includes = ['fonts.conf']
        filter {
            String line ->
                line.replaceAll(
                        '@@APPLICATION_ID@@', new String("${android.defaultConfig.applicationId}")
                )
        }
    }
}

task copyAssets(type: Copy) {
    description "copies assets that can be accessed within the installed apk"
    into 'assets'

    // include icons, Impress styles and required .ui files
    into ('share') {
        into ('config') {
            from ("${liboInstdir}/share/config")
            includes = ['images_**.zip',
                        '**/simpress/**.xml',
                        '**/annotation.ui',
                        '**/hfmenubutton.ui',
                        '**/inforeadonlydialog.ui',
                        '**/pbmenubutton.ui',
                        '**/scrollbars.ui',
                        '**/tabbuttons.ui',
                        '**/tabviewbar.ui'
                        ]
        }
    }

    into('program') {
        from "${liboInstdir}/program"
        includes = ['services.rdb', 'services/services.rdb']

        into('resource') {
            from "${liboInstdir}/${liboSharedResFolder}"
            includes = ['*en-US.res']
        }
    }
    into('share') {
        from("${liboInstdir}/share") {
            // Filter data is needed by e.g. the drawingML preset shape import.
            includes = ['registry/**', 'filter/**']
            // those two get processed by mobile-config.py
            excludes = ['registry/main.xcd', 'registry/res/registry_en-US.xcd']
        }
        // separate data files for Chinese and Japanese
        from("${liboWorkdir}/CustomTarget/i18npool/breakiterator/") {
            include '*.data'
        }
    }
}

task copyAppResources(type: Copy) {
    description "copies documents to make them available as app resources"
    into 'res_generated/raw'
    from("${liboInstdir}") {
        includes = ["LICENSE", "NOTICE"]
        rename "LICENSE", "license.txt"
        rename "NOTICE", "notice.txt"
    }
    from("${liboExampleDocument}") {
        rename ".*", "example.odt"
    }
}

task createFullConfig(type: Copy) {
    // grab dir to clear whole hierarchy on clean target
    outputs.dir "assets_fullUI"
    into 'assets_fullUI/share/config/soffice.cfg'
    from "${liboInstdir}/share/config/soffice.cfg"
}

task createStrippedConfig {
    def preserveDir = file("assets_strippedUI/share/config/soffice.cfg/empty")
    outputs.dir "assets_strippedUI"
    outputs.dir "assets_strippedUI/share/registry/res"
    outputs.file preserveDir

    doLast {
        file('assets_strippedUI/share/registry/res').mkdirs()
        file("assets_strippedUI/share/config/soffice.cfg").mkdirs()
        // just empty file
        preserveDir.text = ""
    }
}


task createStrippedConfigMain(type: Exec) {
    dependsOn 'createStrippedConfig'
    inputs.files "${liboInstdir}/share/registry/main.xcd", "${liboSrcRoot}/android/mobile-config.py"
    outputs.file "assets_strippedUI/share/registry/main.xcd"
    executable "${liboSrcRoot}/android/mobile-config.py"
    args = ["${liboInstdir}/share/registry/main.xcd", "assets_strippedUI/share/registry/main.xcd"]
}

task createStrippedConfigRegistry(type: Exec) {
    dependsOn 'createStrippedConfig'
    inputs.files "${liboInstdir}/share/registry/res/registry_en-US.xcd", "${liboSrcRoot}/android/mobile-config.py"
    outputs.file "assets_strippedUI/share/registry/res/registry_en-US.xcd"
    executable "${liboSrcRoot}/android/mobile-config.py"
    args = ["${liboInstdir}/share/registry/res/registry_en-US.xcd", "assets_strippedUI/share/registry/res/registry_en-US.xcd"]
    doFirst {
        file('assets_strippedUI/share/registry/res').mkdirs()
    }
}

task createRCfiles {
    inputs.file "liboSettings.gradle"
    dependsOn copyUnpackAssets, copyAssets
    def sofficerc     = file('assets/unpack/program/sofficerc')
    def fundamentalrc = file('assets/program/fundamentalrc')
    def bootstraprc   = file('assets/program/bootstraprc')
    def unorc         = file('assets/program/unorc')
    def versionrc     = file('assets/program/versionrc')

    outputs.files sofficerc, fundamentalrc, unorc, bootstraprc, versionrc

    doLast {
        sofficerc.text = '''\
            [Bootstrap]
            Logo=1
            NativeProgress=1
            URE_BOOTSTRAP=file:///assets/program/fundamentalrc
            HOME=$APP_DATA_DIR/cache
            OSL_SOCKET_PATH=$APP_DATA_DIR/cache
            '''.stripIndent()

        fundamentalrc.text =  '''\
            [Bootstrap]
            LO_LIB_DIR=file://$APP_DATA_DIR/lib/
            BRAND_BASE_DIR=file:///assets
            BRAND_SHARE_SUBDIR=share
            CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry res:${BRAND_BASE_DIR}/share/registry
            URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
            '''.stripIndent()

        bootstraprc.text =  '''\
            [Bootstrap]
            InstallMode=<installmode>
            ProductKey=LibreOffice '''+ "${liboVersionMajor}.${liboVersionMinor}" + '''
            UserInstallation=file://$APP_DATA_DIR
            '''.stripIndent()

        unorc.text = '''\
            [Bootstrap]
            URE_INTERNAL_LIB_DIR=file://$APP_DATA_DIR/lib/
            UNO_TYPES=file://$APP_DATA_DIR/program/udkapi.rdb file://$APP_DATA_DIR/program/offapi.rdb file://$APP_DATA_DIR/program/oovbaapi.rdb
            UNO_SERVICES=file:///assets/program/services.rdb file:///assets/program/services/services.rdb
            '''.stripIndent()

        versionrc.text = '''\
            [Version]
            AllLanguages=en-US
            buildid=''' + "${liboGitFullCommit}" + '''
            ReferenceOOoMajorMinor=4.1
            '''.stripIndent()
    }
}

// creating the UI stuff is cheap, don't bother only applying it for the flavor...
preBuild.dependsOn 'createRCfiles',
        'createStrippedConfigMain',
        'createStrippedConfigRegistry',
        'createFullConfig',
        'copyAppResources'

clean.dependsOn 'cleanCopyAssets',
        'cleanCreateStrippedConfig',
        'cleanCreateFullConfig'
Comment 5 eric li 2023-08-06 15:22:51 UTC
below is the libosettings.gradle

apply plugin: 'com.android.application'
// buildhost settings - paths and the like
apply from: 'liboSettings.gradle'

allprojects {
    repositories {
        mavenCentral()
        maven {
            url "https://ipv6.repo1.maven.org/maven2"
        }
        google()
    }
}
//build-time dependencies - android plugin for gradle
buildscript {
    repositories {
        mavenCentral()
        maven {
            url "https://ipv6.repo1.maven.org/maven2"
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.2'
    }
}

// compile-time dependencies
dependencies {
    implementation fileTree(dir: "${liboInstdir}/${liboUREJavaFolder}", include: [
            "java_uno.jar",
            "libreoffice.jar",
            "unoloader.jar"
    ])
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation "androidx.multidex:multidex:2.0.1"
}

android {
    namespace 'org.libreoffice'
    compileSdkVersion 33
    // uses non-conventional source layout, so need to reconfigure accordingly
    // ToDo move to conventional layout, so stuff can be stripped down.

    sourceSets {
        main.manifest.srcFile 'AndroidManifest.xml'
        main.assets.srcDirs = ['assets']
        main.res.srcDirs = ['res', 'res_generated']
        main.java.srcDirs = ['../Bootstrap/src', 'src/java']
        main.jniLibs.srcDirs = ["${liboJniLibsdir}"]
       // main.jniLibs.srcDirs = ['/home/eric/libreoffice/android/jniLibs/armeabi-v7a/']
        // the configuration data that might be stripped or not
        fullUI.assets.srcDirs 'assets_fullUI'
        strippedUI.assets.srcDirs 'assets_strippedUI'
        strippedUIEditing.assets.srcDirs 'assets_strippedUI'
    }
    defaultConfig {
        // minSdkVersion is set in liboSettings.gradle
        targetSdkVersion 33
        // multidex needed when > 65,536 methods referenced with minSdKVersion < 21
        // s. https://developer.android.com/studio/build/multidex
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        ndk {
            abiFilters "armeabi-v7a"
        }
        externalNativeBuild {
            cmake {
                arguments "-DANDROID_STL=none"
                cppFlags ""
            }
        }
    }
    buildTypes {
        debug {
            // make android studio happy...
            jniDebuggable true
            // would work just fine with external, but setting emulator up is a little more work
            manifestPlaceholders = [installLocation: "auto"]
        }
        release {
            manifestPlaceholders = [installLocation: "preferExternal"]
        }
    }

    flavorDimensions "default"
    productFlavors {
        strippedUI {
            dimension "default"
            buildConfigField 'boolean', 'ALLOW_EDITING', 'false'
        }
        strippedUIEditing {
            dimension "default"
            buildConfigField 'boolean', 'ALLOW_EDITING', 'true'
            versionNameSuffix "-editing"
        }
        fullUI.dimension "default"
    }
    lint {
        // don't error-out on missing translations
        warning 'MissingTranslation'
    }
}

/* remark inherited from makefile:
Then "assets". Let the directory structure under assets mimic
that under solver for now.

Please note that I have no idea what all of this is really necessary and for
much of this stuff being copied, no idea whether it makes any sense at all.
Much of this is copy-pasted from android/qa/sc/Makefile (where a couple of
unit tests for sc are built, and those do seem to mostly work) and
android/qa/desktop/Makefile (mmeeks's desktop demo, also works to some
extent)
 */

// Assets that are unpacked at run-time into the app's data directory. These
// are files read by non-LO code, fontconfig and freetype for now, that doesn't
// understand "/assets" paths.
task copyUnpackAssets(type: Copy) {
    description "copies assets that need to be extracted on the device"
    into 'assets/unpack'
    into('program') {
        from("${liboInstdir}/${liboEtcFolder}/types") {
            includes = [
                    "offapi.rdb",
                    "oovbaapi.rdb"
            ]
        }
        from("${liboInstdir}/${liboUreMiscFolder}") {
            includes = ["types.rdb"]
            rename 'types.rdb', 'udkapi.rdb'
        }
    }
    into('user/fonts') {
        from "${liboInstdir}/share/fonts/truetype"
        // Note: restrict list of fonts due to size considerations - no technical reason anymore
        // ToDo: fonts would be good candidate for using Expansion Files instead
        includes = [
                "Liberation*.ttf",
                "Caladea-*.ttf",
                "Carlito-*.ttf",
                "Gen*.ttf",
                "opens___.ttf"
        ]
    }
    into('etc/fonts') {
        from "./"
        includes = ['fonts.conf']
        filter {
            String line ->
                line.replaceAll(
                        '@@APPLICATION_ID@@', new String("${android.defaultConfig.applicationId}")
                )
        }
    }
}

task copyAssets(type: Copy) {
    description "copies assets that can be accessed within the installed apk"
    into 'assets'

    // include icons, Impress styles and required .ui files
    into ('share') {
        into ('config') {
            from ("${liboInstdir}/share/config")
            includes = ['images_**.zip',
                        '**/simpress/**.xml',
                        '**/annotation.ui',
                        '**/hfmenubutton.ui',
                        '**/inforeadonlydialog.ui',
                        '**/pbmenubutton.ui',
                        '**/scrollbars.ui',
                        '**/tabbuttons.ui',
                        '**/tabviewbar.ui'
                        ]
        }
    }

    into('program') {
        from "${liboInstdir}/program"
        includes = ['services.rdb', 'services/services.rdb']

        into('resource') {
            from "${liboInstdir}/${liboSharedResFolder}"
            includes = ['*en-US.res']
        }
    }
    into('share') {
        from("${liboInstdir}/share") {
            // Filter data is needed by e.g. the drawingML preset shape import.
            includes = ['registry/**', 'filter/**']
            // those two get processed by mobile-config.py
            excludes = ['registry/main.xcd', 'registry/res/registry_en-US.xcd']
        }
        // separate data files for Chinese and Japanese
        from("${liboWorkdir}/CustomTarget/i18npool/breakiterator/") {
            include '*.data'
        }
    }
}

task copyAppResources(type: Copy) {
    description "copies documents to make them available as app resources"
    into 'res_generated/raw'
    from("${liboInstdir}") {
        includes = ["LICENSE", "NOTICE"]
        rename "LICENSE", "license.txt"
        rename "NOTICE", "notice.txt"
    }
    from("${liboExampleDocument}") {
        rename ".*", "example.odt"
    }
}

task createFullConfig(type: Copy) {
    // grab dir to clear whole hierarchy on clean target
    outputs.dir "assets_fullUI"
    into 'assets_fullUI/share/config/soffice.cfg'
    from "${liboInstdir}/share/config/soffice.cfg"
}

task createStrippedConfig {
    def preserveDir = file("assets_strippedUI/share/config/soffice.cfg/empty")
    outputs.dir "assets_strippedUI"
    outputs.dir "assets_strippedUI/share/registry/res"
    outputs.file preserveDir

    doLast {
        file('assets_strippedUI/share/registry/res').mkdirs()
        file("assets_strippedUI/share/config/soffice.cfg").mkdirs()
        // just empty file
        preserveDir.text = ""
    }
}


task createStrippedConfigMain(type: Exec) {
    dependsOn 'createStrippedConfig'
    inputs.files "${liboInstdir}/share/registry/main.xcd", "${liboSrcRoot}/android/mobile-config.py"
    outputs.file "assets_strippedUI/share/registry/main.xcd"
    executable "${liboSrcRoot}/android/mobile-config.py"
    args = ["${liboInstdir}/share/registry/main.xcd", "assets_strippedUI/share/registry/main.xcd"]
}

task createStrippedConfigRegistry(type: Exec) {
    dependsOn 'createStrippedConfig'
    inputs.files "${liboInstdir}/share/registry/res/registry_en-US.xcd", "${liboSrcRoot}/android/mobile-config.py"
    outputs.file "assets_strippedUI/share/registry/res/registry_en-US.xcd"
    executable "${liboSrcRoot}/android/mobile-config.py"
    args = ["${liboInstdir}/share/registry/res/registry_en-US.xcd", "assets_strippedUI/share/registry/res/registry_en-US.xcd"]
    doFirst {
        file('assets_strippedUI/share/registry/res').mkdirs()
    }
}

task createRCfiles {
    inputs.file "liboSettings.gradle"
    dependsOn copyUnpackAssets, copyAssets
    def sofficerc     = file('assets/unpack/program/sofficerc')
    def fundamentalrc = file('assets/program/fundamentalrc')
    def bootstraprc   = file('assets/program/bootstraprc')
    def unorc         = file('assets/program/unorc')
    def versionrc     = file('assets/program/versionrc')

    outputs.files sofficerc, fundamentalrc, unorc, bootstraprc, versionrc

    doLast {
        sofficerc.text = '''\
            [Bootstrap]
            Logo=1
            NativeProgress=1
            URE_BOOTSTRAP=file:///assets/program/fundamentalrc
            HOME=$APP_DATA_DIR/cache
            OSL_SOCKET_PATH=$APP_DATA_DIR/cache
            '''.stripIndent()

        fundamentalrc.text =  '''\
            [Bootstrap]
            LO_LIB_DIR=file://$APP_DATA_DIR/lib/
            BRAND_BASE_DIR=file:///assets
            BRAND_SHARE_SUBDIR=share
            CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry res:${BRAND_BASE_DIR}/share/registry
            URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
            '''.stripIndent()

        bootstraprc.text =  '''\
            [Bootstrap]
            InstallMode=<installmode>
            ProductKey=LibreOffice '''+ "${liboVersionMajor}.${liboVersionMinor}" + '''
            UserInstallation=file://$APP_DATA_DIR
            '''.stripIndent()

        unorc.text = '''\
            [Bootstrap]
            URE_INTERNAL_LIB_DIR=file://$APP_DATA_DIR/lib/
            UNO_TYPES=file://$APP_DATA_DIR/program/udkapi.rdb file://$APP_DATA_DIR/program/offapi.rdb file://$APP_DATA_DIR/program/oovbaapi.rdb
            UNO_SERVICES=file:///assets/program/services.rdb file:///assets/program/services/services.rdb
            '''.stripIndent()

        versionrc.text = '''\
            [Version]
            AllLanguages=en-US
            buildid=''' + "${liboGitFullCommit}" + '''
            ReferenceOOoMajorMinor=4.1
            '''.stripIndent()
    }
}

// creating the UI stuff is cheap, don't bother only applying it for the flavor...
preBuild.dependsOn 'createRCfiles',
        'createStrippedConfigMain',
        'createStrippedConfigRegistry',
        'createFullConfig',
        'copyAppResources'

clean.dependsOn 'cleanCopyAssets',
        'cleanCreateStrippedConfig',
        'cleanCreateFullConfig'
Comment 6 eric li 2023-08-06 16:00:39 UTC
(In reply to Michael Weghorn from comment #1)
> Since you've set the "Version" field to 7.4.7.2: Is that the git tag/tarball
> from which you're building?
> 
> What happens when you use the version from F-Droid instead?
> https://f-droid.org/en/packages/org.documentfoundation.libreoffice/
> 
> Does it also crash when you build with current git master or the
> libreoffice-7-6 branch?

I will try this later ,,
I am build it following the below source ,any wrong with it ?
https://wiki.documentfoundation.org/Development/BuildingForAndroid
Comment 7 Michael Weghorn 2023-08-06 18:57:45 UTC
(In reply to eric li from comment #3)
> I just used git and pull download from github as following the instructions
> of how to build android libreoffice from the official website...it is around
> 2 months ago ,,and I don't know how to check the version exactly from source
> project..

I'd suggest to update to the latest development version from that, with a `git pull`. Then you can see the current commit (= "version" of the development branch) with a `git log -n1` for example.

(In reply to eric li from comment #6)
> I will try this later ,,
> I am build it following the below source ,any wrong with it ?
> https://wiki.documentfoundation.org/Development/BuildingForAndroid

That instruction is fine.
Comment 8 Michael Weghorn 2023-08-06 18:58:47 UTC
(In reply to Michael Weghorn from comment #7)
> (In reply to eric li from comment #6)
> > I will try this later ,,
> > I am build it following the below source ,any wrong with it ?
> > https://wiki.documentfoundation.org/Development/BuildingForAndroid
> 
> That instruction is fine.

But it would still be interesting to know whether the issue also occurs with the F-Droid version, to see whether this is a general problem occuring on your device, or maybe somehow related to your local build.
Comment 9 eric li 2023-08-07 03:12:53 UTC
(In reply to Michael Weghorn from comment #8)
> (In reply to Michael Weghorn from comment #7)
> > (In reply to eric li from comment #6)
> > > I will try this later ,,
> > > I am build it following the below source ,any wrong with it ?
> > > https://wiki.documentfoundation.org/Development/BuildingForAndroid
> > 
> > That instruction is fine.
> 
> But it would still be interesting to know whether the issue also occurs with
> the F-Droid version, to see whether this is a general problem occuring on
> your device, or maybe somehow related to your local build.

the F-Droid version working well, it is not the phone/android issue...my version ,I tried many different phones ,still doens't work ..I think it could be the below issues:

1) I actually installed android studio on root ,when I realized root can't work when building libreoffice on android..so I just simply change own/group something...maybe this cause the issue...I may consider user a normal user and reinstall everything later and see what happen
Comment 10 QA Administrators 2023-08-07 03:19:25 UTC Comment hidden (obsolete)
Comment 11 Michael Weghorn 2023-08-07 06:02:57 UTC
(In reply to eric li from comment #9)
> the F-Droid version working well, it is not the phone/android issue...my
> version ,I tried many different phones ,still doens't work ..I think it
> could be the below issues:

Good to know that version works, thanks for testing.
If reinstalling everything and a `git pull` don't resolve the situation, I'd suggest to do also do a `make distclean` and then a fully fresh build. And also: Uninstall the app from the device and reinstall, so any previous data that might be causing issues are cleared.
Comment 12 eric li 2023-08-07 09:28:29 UTC
(In reply to Michael Weghorn from comment #11)
> (In reply to eric li from comment #9)
> > the F-Droid version working well, it is not the phone/android issue...my
> > version ,I tried many different phones ,still doens't work ..I think it
> > could be the below issues:
> 
> Good to know that version works, thanks for testing.
> If reinstalling everything and a `git pull` don't resolve the situation, I'd
> suggest to do also do a `make distclean` and then a fully fresh build. And
> also: Uninstall the app from the device and reinstall, so any previous data
> that might be causing issues are cleared.

so ,,pls let me know if I only use git pull,,we are behind chinese GFW,,using git pull is very painful..however I will download current version ,,it is https://github.com/Libreoffice/core...is that OK for you to know which current commit/version ?
Comment 13 Michael Weghorn 2023-08-07 21:19:36 UTC
(In reply to eric li from comment #12)
> so ,,pls let me know if I only use git pull,,we are behind chinese
> GFW,,using git pull is very painful..however I will download current version
> ,,it is https://github.com/Libreoffice/core...is that OK for you to know
> which current commit/version ?

As long as you make sure, you have the status of current git master, that should be fine, whatever way you retrieve that.
Comment 14 eric li 2023-08-08 08:37:06 UTC
now I created a new account and installed a new android studio with a new source code which downloaded from github:libreoffice/core yesterday ..
    we still cross some issue:
1) miss version error...I don't which version we downloaded.it is the github master ..so we simple to fill 7.6.0.2 into source.cer to make installation continue
2)I forgot it ,let me add it later

3) now we stuck at below erros ,,pls help to solve it (I added and change some directory in libosettings.gradle,still not work):


2023-08-08 16:15:14.516 18939-18939 AppCompatViewInflater   org.example.libreoffice              I  app:theme is now deprecated. Please move to using android:theme instead.
2023-08-08 16:15:14.522 18939-18939 HwResourcesImpl         org.example.libreoffice              E  handleAddIconBackground resId = 0 return: android.graphics.drawable.ColorDrawable@488775c
2023-08-08 16:15:14.527 18939-18939 HwResourcesImpl         org.example.libreoffice              E  handleAddIconBackground resId = 0 return: android.graphics.drawable.ColorDrawable@39e8b51
2023-08-08 16:15:14.564 18939-18939 AndroidRuntime          org.example.libreoffice              D  Shutting down VM
2023-08-08 16:15:14.564 18939-18939 AndroidRuntime          org.example.libreoffice              E  FATAL EXCEPTION: main
                                                                                                    Process: org.example.libreoffice, PID: 18939
                                                                                                    java.lang.UnsatisfiedLinkError: dlopen failed: library "libnspr4.so" not found


I can see libnspr4.so under the right directory ...so I just changed libosettings.gradle(add /armeabi-v7a at tail of liboJniLibsdir) ,,but still dosnt work..pls help to solve it
// created by Makefile.shared - your changes will be overridden
ext {
    liboSrcRoot         = '/home/shanreal/libreoffice/core-master'
    liboJniLibsdir      = '/home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a'
    liboWorkdir         = '/home/shanreal/libreoffice/core-master/workdir'
    liboInstdir         = '/home/shanreal/libreoffice/core-master/instdir'
    liboEtcFolder       = 'program'
    liboUreMiscFolder   = 'program'
    liboSharedResFolder = 'program/resource'
    liboUREJavaFolder   = 'program/classes'
    liboShareJavaFolder = 'program/classes'
    liboExampleDocument = '/home/shanreal/libreoffice/core-master/android/default-document/example.odt'
    liboVersionMajor    = '24'
    liboVersionMinor    = '2'
    liboGitFullCommit   = ''
}
android {
    ndkPath '/home/shanreal/Android/Sdk/ndk/25.2.9519653'
}
android.defaultConfig {
    applicationId 'org.example.libreoffice'
    archivesBaseName = 'LibreOfficeViewer'
    minSdkVersion 23
Comment 15 eric li 2023-08-08 08:40:08 UTC
(In reply to eric li from comment #14)
> now I created a new account and installed a new android studio with a new
> source code which downloaded from github:libreoffice/core yesterday ..
>     we still cross some issue:
> 1) miss version error...I don't which version we downloaded.it is the github
> master ..so we simple to fill 7.6.0.2 into source.cer to make installation
> continue
> 2)I forgot it ,let me add it later
> 
> 3) now we stuck at below erros ,,pls help to solve it (I added and change
> some directory in libosettings.gradle,still not work):
> 
> 
> 2023-08-08 16:15:14.516 18939-18939 AppCompatViewInflater  
> org.example.libreoffice              I  app:theme is now deprecated. Please
> move to using android:theme instead.
> 2023-08-08 16:15:14.522 18939-18939 HwResourcesImpl        
> org.example.libreoffice              E  handleAddIconBackground resId = 0
> return: android.graphics.drawable.ColorDrawable@488775c
> 2023-08-08 16:15:14.527 18939-18939 HwResourcesImpl        
> org.example.libreoffice              E  handleAddIconBackground resId = 0
> return: android.graphics.drawable.ColorDrawable@39e8b51
> 2023-08-08 16:15:14.564 18939-18939 AndroidRuntime         
> org.example.libreoffice              D  Shutting down VM
> 2023-08-08 16:15:14.564 18939-18939 AndroidRuntime         
> org.example.libreoffice              E  FATAL EXCEPTION: main
>                                                                             
> Process: org.example.libreoffice, PID: 18939
>                                                                             
> java.lang.UnsatisfiedLinkError: dlopen failed: library "libnspr4.so" not
> found
> 
> 
> I can see libnspr4.so under the right directory ...so I just changed
> libosettings.gradle(add /armeabi-v7a at tail of liboJniLibsdir) ,,but still
> dosnt work..pls help to solve it
> // created by Makefile.shared - your changes will be overridden
> ext {
>     liboSrcRoot         = '/home/shanreal/libreoffice/core-master'
>     liboJniLibsdir      =
> '/home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a'
>     liboWorkdir         = '/home/shanreal/libreoffice/core-master/workdir'
>     liboInstdir         = '/home/shanreal/libreoffice/core-master/instdir'
>     liboEtcFolder       = 'program'
>     liboUreMiscFolder   = 'program'
>     liboSharedResFolder = 'program/resource'
>     liboUREJavaFolder   = 'program/classes'
>     liboShareJavaFolder = 'program/classes'
>     liboExampleDocument =
> '/home/shanreal/libreoffice/core-master/android/default-document/example.odt'
>     liboVersionMajor    = '24'
>     liboVersionMinor    = '2'
>     liboGitFullCommit   = ''
> }
> android {
>     ndkPath '/home/shanreal/Android/Sdk/ndk/25.2.9519653'
> }
> android.defaultConfig {
>     applicationId 'org.example.libreoffice'
>     archivesBaseName = 'LibreOfficeViewer'
>     minSdkVersion 23

NO 2)issue is actully ,,missing the ALLOW_EDITING...don't why ,the build.gradle variety not sent into the source code..so we put the buid_config.ALLOWEDINTG as false directly to make the installation passed
Comment 16 eric li 2023-08-08 09:02:16 UTC
another issue we got 
Cause: out extracted from path /home/eric/libreoffice/android/source/build/intermediates/merged_jni_libs/fullUIDebug/out/libc++_shared.so is not an ABI
Comment 17 eric li 2023-08-08 10:14:01 UTC
2023-08-08 18:00:39.996 12476-12476 Hwaps                   org.example.libreoffice              I  APS: EventAnalyzed: initAPS: version is 11.0.0.4
2023-08-08 18:00:39.996 12476-12476 Hwaps                   org.example.libreoffice              D  Fpsrequest create,type:EXACTLY_IDENTIFY
2023-08-08 18:00:39.997 12476-12476 Hwaps                   org.example.libreoffice              D  Fpsrequest create,type:EXACTLY_IDENTIFY
2023-08-08 18:00:39.997 12476-12476 Hwaps                   org.example.libreoffice              D  Fpsrequest create,type:OPENGL_SETTING
2023-08-08 18:00:39.997 12476-12476 Hwaps                   org.example.libreoffice              D  FpsController create
2023-08-08 18:00:39.998 12476-12476 Hwaps                   org.example.libreoffice              D  APS: EventAnalyzed: reInitFpsPara :mBaseFps = 120; mMaxFps = 120
2023-08-08 18:00:40.071 12476-12476 Hwaps                   org.example.libreoffice              D  APS: EventAnalyzed: registerCallbackInApsManagerService, mPkgName:org.example.libreoffice; result = false
2023-08-08 18:00:40.074 12476-12476 HwApsManager            org.example.libreoffice              W  HwApsManagerService, registerCallback, start !
2023-08-08 18:00:40.081 12476-12476 AudioManager            org.example.libreoffice              V  querySoundEffectsEnabled...
2023-08-08 18:00:40.097 12476-12476 FileUtilities           org.example.libreoffice              D  extn : SJ0101智慧能源综合服务平台标准化 设计_概要设计报告V2.0[1]{}.doc -> 0
2023-08-08 18:00:40.100 12476-12476 FactoryLoader           org.example.libreoffice              I  loadFactory() ClassNotFoundException !
2023-08-08 18:00:40.103  1945-3511  HwActivityStarterEx     system_server                        E  This activity is not in whitelist! packageName= org.example.libreoffice
2023-08-08 18:00:40.106 12476-12614 ClientTran...ionHandler org.example.libreoffice              I  send EXECUTE_TRANSACTION
2023-08-08 18:00:40.107 12476-12614 ClientTran...ionHandler org.example.libreoffice              I  send EXECUTE_TRANSACTION
2023-08-08 18:00:40.124 12476-12476 HwViewRootImpl          org.example.libreoffice              I  removeInvalidNode all the node in jank list is out of time
2023-08-08 18:00:40.131 12476-12491 ClientTran...ionHandler org.example.libreoffice              I  send EXECUTE_TRANSACTION
2023-08-08 18:00:40.131 12476-12614 ClientTran...ionHandler org.example.libreoffice              I  send EXECUTE_TRANSACTION
2023-08-08 18:00:40.152 12476-12476 ActivityThread          org.example.libreoffice              V  callActivityOnCreate
2023-08-08 18:00:40.152 12476-12476 LibreOfficeMainActivity org.example.libreoffice              W  onCreate..
2023-08-08 18:00:40.159 12476-12476 DecorView[]             org.example.libreoffice              I   old windowMode:0 new windoMode:1
2023-08-08 18:00:40.174 12476-12476 AppCompatViewInflater   org.example.libreoffice              I  app:theme is now deprecated. Please move to using android:theme instead.
2023-08-08 18:00:40.208 12476-12476 AppCompatViewInflater   org.example.libreoffice              I  app:theme is now deprecated. Please move to using android:theme instead.
2023-08-08 18:00:40.300 12476-12476 AppCompatViewInflater   org.example.libreoffice              I  app:theme is now deprecated. Please move to using android:theme instead.
2023-08-08 18:00:40.310 12476-12476 AppCompatViewInflater   org.example.libreoffice              I  app:theme is now deprecated. Please move to using android:theme instead.
2023-08-08 18:00:40.316 12476-12476 HwResourcesImpl         org.example.libreoffice              E  handleAddIconBackground resId = 0 return: android.graphics.drawable.ColorDrawable@391b219
2023-08-08 18:00:40.321 12476-12476 HwResourcesImpl         org.example.libreoffice              E  handleAddIconBackground resId = 0 return: android.graphics.drawable.ColorDrawable@b64069a
2023-08-08 18:00:40.357 12476-12476 AndroidRuntime          org.example.libreoffice              D  Shutting down VM
2023-08-08 18:00:40.358 12476-12476 AndroidRuntime          org.example.libreoffice              E  FATAL EXCEPTION: main
                                                                                                    Process: org.example.libreoffice, PID: 12476
                                                                                                    java.lang.UnsatisfiedLinkError: dlopen failed: library "libnspr4.so" not found
                                                                                                    	at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
                                                                                                    	at java.lang.Runtime.loadLibrary0(Runtime.java:998)
                                                                                                    	at java.lang.System.loadLibrary(System.java:1657)
Comment 18 Michael Weghorn 2023-08-08 10:33:26 UTC
(In reply to eric li from comment #17)
                                                                 
> Process: org.example.libreoffice, PID: 12476
>                                                                             
> java.lang.UnsatisfiedLinkError: dlopen failed: library "libnspr4.so" not
> found

What does your autogen.input look like oOr what arguments to you pass to `./autogen.sh` manually) and what is the device that the app is running on?

I've seen similar error messages when running the app on a device of a different architecture than the app was built for (e.g. running on an x86_64 AVD when the app was built for x86).
Comment 19 eric li 2023-08-09 01:52:57 UTC
(In reply to Michael Weghorn from comment #18)
> (In reply to eric li from comment #17)
>                                                                  
> > Process: org.example.libreoffice, PID: 12476
> >                                                                             
> > java.lang.UnsatisfiedLinkError: dlopen failed: library "libnspr4.so" not
> > found
> 
> What does your autogen.input look like oOr what arguments to you pass to
> `./autogen.sh` manually) and what is the device that the app is running on?
> 
> I've seen similar error messages when running the app on a device of a
> different architecture than the app was built for (e.g. running on an x86_64
> AVD when the app was built for x86).



the phone I used mostly is Honor 60/Android 12/Qualcomm snapdragon 778G

the autogen.input is below:

shanreal@eric-Inspiron-7559:/home/eric/libreoffice$ more autogen.input
--with-distro=LibreOfficeAndroid
--with-android-sdk=/home/eric/Android/Sdk
--with-android-ndk=/home/eric/Android/Sdk/ndk/25.2.9519653
--with-jdk-home=/usr/lib/jvm/java-17-openjdk-amd64
Comment 20 eric li 2023-08-09 02:02:12 UTC
below is the libosetting.gradle,,you see the directory is wrong:
// created by Makefile.shared - your changes will be overridden
ext {
    liboSrcRoot         = '/home/shanreal/libreoffice/core-master'
    liboJniLibsdir      = '/home/shanreal/libreoffice/core-master/android/jniLibs'
    liboWorkdir         = '/home/shanreal/libreoffice/core-master/workdir'
    liboInstdir         = '/home/shanreal/libreoffice/core-master/instdir'
    liboEtcFolder       = 'program'
    liboUreMiscFolder   = 'program'
    liboSharedResFolder = 'program/resource'
    liboUREJavaFolder   = 'program/classes'
    liboShareJavaFolder = 'program/classes'
    liboExampleDocument = '/home/shanreal/libreoffice/core-master/android/default-document/example.odt'
    liboVersionMajor    = '24'
    liboVersionMinor    = '2'
    liboGitFullCommit   = ''
}
android {
    ndkPath '/home/shanreal/Android/Sdk/ndk/25.2.9519653'
}
android.defaultConfig {
    applicationId 'org.example.libreoffice'
    archivesBaseName = 'LibreOfficeViewer'
    minSdkVersion = 19
    versionCode project.hasProperty('cmdVersionCode') ? cmdVersionCode.toInteger() : 1
    versionName '24.2.0.0.alpha0+//shanreal'
}


I modified the liboJniLibsdir      = '/home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a'
Comment 21 eric li 2023-08-09 02:36:12 UTC
(In reply to eric li from comment #19)
> (In reply to Michael Weghorn from comment #18)
> > (In reply to eric li from comment #17)
> >                                                                  
> > > Process: org.example.libreoffice, PID: 12476
> > >                                                                             
> > > java.lang.UnsatisfiedLinkError: dlopen failed: library "libnspr4.so" not
> > > found
> > 
> > What does your autogen.input look like oOr what arguments to you pass to
> > `./autogen.sh` manually) and what is the device that the app is running on?
> > 
> > I've seen similar error messages when running the app on a device of a
> > different architecture than the app was built for (e.g. running on an x86_64
> > AVD when the app was built for x86).
> 
> 
> 
> the phone I used mostly is Honor 60/Android 12/Qualcomm snapdragon 778G
> 
> the autogen.input is below:
> 
> shanreal@eric-Inspiron-7559:/home/eric/libreoffice$ more autogen.input
> --with-distro=LibreOfficeAndroid
> --with-android-sdk=/home/eric/Android/Sdk
> --with-android-ndk=/home/eric/Android/Sdk/ndk/25.2.9519653
> --with-jdk-home=/usr/lib/jvm/java-17-openjdk-amd64

and I actully tried many different phone with android studio ,,the results are same,,like oppo reno8 pro5G/android 13/  etc
Comment 22 eric li 2023-08-09 02:40:17 UTC
and I found every phone and every first time to install it by android studio
there are some error message below ,,but second time installtion always disappear

--------- beginning of crash
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A  Process name is org.example.libreoffice, not key_process
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A  Cmdline: org.example.libreoffice
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A  pid: 3400, tid: 15629, name: Thread-3  >>> org.example.libreoffice <<<
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A        #02 pc 07059f83  /data/app/~~Xu529EASU2X5uTjW_EAVKw==/org.example.libreoffice-8RSFLQ1eiEysGXcniuxLjg==/lib/arm/liblo-native-code.so (BuildId: be1dd2076c6e0c7957e47bebade93e27b4527802)
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A        #03 pc 0705a107  /data/app/~~Xu529EASU2X5uTjW_EAVKw==/org.example.libreoffice-8RSFLQ1eiEysGXcniuxLjg==/lib/arm/liblo-native-code.so (BuildId: be1dd2076c6e0c7957e47bebade93e27b4527802)
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A        #04 pc 0705a015  /data/app/~~Xu529EASU2X5uTjW_EAVKw==/org.example.libreoffice-8RSFLQ1eiEysGXcniuxLjg==/lib/arm/liblo-native-code.so (BuildId: be1dd2076c6e0c7957e47bebade93e27b4527802)
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A        #05 pc 07059b89  /data/app/~~Xu529EASU2X5uTjW_EAVKw==/org.example.libreoffice-8RSFLQ1eiEysGXcniuxLjg==/lib/arm/liblo-native-code.so (BuildId: be1dd2076c6e0c7957e47bebade93e27b4527802)
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A        #06 pc 03e3672d  /data/app/~~Xu529EASU2X5uTjW_EAVKw==/org.example.libreoffice-8RSFLQ1eiEysGXcniuxLjg==/lib/arm/liblo-native-code.so (BuildId: be1dd2076c6e0c7957e47bebade93e27b4527802)
2023-08-07 11:17:12.793 15639-15639 DEBUG                   pid-15639                            A        #07 pc 03e369e7  /data/app/~~Xu529EASU2X5uTjW_EAVKw==/org.example.libreoffice-8RSFLQ1eiEysGXcniuxLjg==/lib/arm/liblo-native-code.so (BuildId: be1dd2076c6e0c7957e47bebade93e27b4527802)
--------- beginning of system
2023-08-09 10:37:33.159  2701-3205  PackageInstallerSession system_server                        E  com.android.packageinstaller drops manifest attribute android:installLocation in base.apk for org.example.libreoffice
2023-08-09 10:37:33.403  2701-3071  PackageMan...ilsExtImpl system_server                        E  Fix up user restrict data of pkg: org.example.libreoffice
2023-08-09 10:37:33.465  2701-3071  ArtManagerService       system_server                        E  Failed to prepare profile for org.example.libreoffice:/data/app/~~6nr69JgFgjPPC9aVDi8NMA==/org.example.libreoffice-pCxmG8Z2c76_jli9vfA3SQ==/base.apk
2023-08-09 10:37:33.470  2701-3071  ArtManagerService       system_server                        E  Failed to prepare profile for org.example.libreoffice:/data/app/~~6nr69JgFgjPPC9aVDi8NMA==/org.example.libreoffice-pCxmG8Z2c76_jli9vfA3SQ==/base.apk
2023-08-09 10:37:34.811  2701-2926  OplusThermalStats       system_server                        E  Error getting package info: org.example.libreoffice
2023-08-09 10:37:35.008 29140-29140 Quality                 org.example.libreoffice              I  Odex status:io-error-no-oat filter:run-from-apk reason:unknown location:/data/app/~~6nr69JgFgjPPC9aVDi8NMA==/org.example.libreoffice-pCxmG8Z2c76_jli9vfA3SQ==/base.apk cost:157
2023-08-09 10:37:35.083 29140-29140 ConfigurationController org.example.libreoffice              I  handleConfigurationChanged: true, config: {1.0 ??mcc??mnc [zh_CN] ldltr sw360dp w360dp h748dp 480dpi nrml long hdr widecg port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 107 - 1080, 2352) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} as.2 s.24279 fontWeightAdjustment=0mThemeChanged= 0, mThemeChangedFlags= 0, mFlipFont= 0, mAccessibleChanged= -1, mUxIconConfig= 3468921665126662176, mMaterialColor= 0, mUserId= 0, mFontUserId= 0, mFontVariationSettings= 226, mFoldingAngle = -1.0, mIconPackName= , mDarkModeBackgroundMaxL= 0.0, mDarkModeDialogBgMaxL= 27.0, mDarkModeForegroundMinL= 100.0, mOplusConfigType= 1, mOplusChangedConfigs= 0, OpSans= 0, mBurmeseFontFlag= 2, mFlag= 0} 
                                                                                                    , curconfig: {1.0 ??mcc??mnc [zh_CN] ldltr sw360dp w360dp h748dp 480dpi nrml long hdr widecg port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 107 - 1080, 2352) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} as.2 s.24279 fontWeightAdjustment=0mThemeChanged= 0, mThemeChangedFlags= 0, mFlipFont= 0, mAccessibleChanged= -1, mUxIconConfig= 3468921665126662176, mMaterialColor= 0, mUserId= 0, mFontUserId= 0, mFontVariationSettings= 226, mFoldingAngle = -1.0, mIconPackName= , mDarkModeBackgroundMaxL= 0.0, mDarkModeDialogBgMaxL= 27.0, mDarkModeForegroundMinL= 100.0, mOplusConfigType= 1, mOplusChangedConfigs= 0, OpSans= 0, mBurmeseFontFlag= 2, mFlag= 0} 
                                                                                                    android.app.ActivityThread.handleLaunchActivity:4003 android.app.servertransaction.LaunchActivityItem.execute:111 android.app.servertransaction.TransactionExecutor.executeCallbacks:135 android.app.servertransaction.TransactionExecutor.execute:95 android.app.ActivityThread$H.handleMessage:2474 android.os.Handler.dispatchMessage:106 android.os.Looper.loopOnce:240 android.os.Looper.loop:351 android.app.ActivityThread.main:8416 java.lang.reflect.Method.invoke:-2 
2023-08-09 10:37:35.236 29140-29140 OplusCusto...ionManager org.example.libreoffice              E  sInstance is null, start a new sInstance
2023-08-09 10:37:35.331 29140-29140 Quality                 org.example.libreoffice              I  InflateViewInfo:137255104,androidx.constraintlayout.widget.ConstraintLayout
2023-08-09 10:37:35.480 29140-29140 OplusInputMethodUtil    org.example.libreoffice              D  init sDebug to false, init sDebugIme to false, init sAlwaysOn to false
2023-08-09 10:37:35.480 29140-29140 OplusInputMethodUtil    org.example.libreoffice              D  updateDebugToClass InputMethodManager.DEBUG = false
2023-08-09 10:37:35.480 29140-29140 OplusInputMethodUtil    org.example.libreoffice              D  updateDebugToClass ImeFocusController.DEBUG = false
2023-08-09 10:37:35.480 29140-29140 OplusInputMethodUtil    org.example.libreoffice              D  updateDebugToClass BaseInputConnection.DEBUG = false
2023-08-09 10:37:35.480 29140-29140 OplusInputMethodUtil    org.example.libreoffice              D  updateDebugToClass ImeFocusController.sDebugIme = false
2023-08-09 10:37:35.698 29140-20718 Quality                 org.example.libreoffice              I  ActivityThread: setSurface delay 79 org.example.libreoffice 29140
2023-08-09 10:37:36.136  2701-2926  OplusThermalStats       system_server                        E  Error getting package info: org.example.libreoffice
2023-08-09 10:37:36.183 29140-29140 Quality                 org.example.libreoffice              I  Skipped: false 2 cost 41.575623 refreshRate 16636219 bit true processName org.example.libreoffice
2023-08-09 10:37:36.213 29140-29140 Quality                 org.example.libreoffice              I  Skipped: false 1 cost 21.584244 refreshRate 16635092 bit true processName org.example.libreoffice
--------- beginning of main
2023-08-09 10:37:37.249 29140-29140 OplusScrollToTopManager org.example.libreoffice              D  org.example.libreoffice/org.libreoffice.ui.LibreOfficeUIActivity,This DecorView@7ad5f3b[LibreOfficeUIActivity] change focus to true
2023-08-09 10:37:37.292 20067-20961 SQLiteDatabase          com.oplus.games                      E  Error inserting timeout=10000 switch_on_time=1691548657255 pkg_icon=[B@82255ce pkg_name=org.example.libreoffice pkg_type=-999 game_category_id=-999
                                                                                                    android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: app_list.pkg_name (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)
                                                                                                    	at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
                                                                                                    	at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:967)
                                                                                                    	at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
                                                                                                    	at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:89)
                                                                                                    	at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1868)
                                                                                                    	at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1737)
                                                                                                    	at com.oplus.games.provider.AppListProvider.insert(AppListProvider.java:23)
                                                                                                    	at android.content.ContentProvider.insert(ContentProvider.java:1748)
                                                                                                    	at android.content.ContentProvider$Transport.insert(ContentProvider.java:343)
                                                                                                    	at android.content.ContentResolver.insert(ContentResolver.java:2225)
                                                                                                    	at android.content.ContentResolver.insert(ContentResolver.java:2181)
                                                                                                    	at n9.a.p(AddPkgToDBStrategy.java:538)
                                                                                                    	at n9.a.r(AddPkgToDBStrategy.java:1)
                                                                                                    	at n9.a.m(AddPkgToDBStrategy.java:1)
                                                                                                    	at n9.a$b.a(AddPkgToDBStrategy.java:18)
                                                                                                    	at n9.a$b.doInBackground(AddPkgToDBStrategy.java:3)
                                                                                                    	at android.os.AsyncTask$3.call(AsyncTask.java:394)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2023-08-09 10:37:37.888 29140-29140 VRI[LibreO...IActivity] org.example.libreoffice              D  handleWindowFocusChanged mWindowFocusChanged false mUpcomingWindowFocus true mAdded true
2023-08-09 10:37:37.896 29140-29140 AutofillManager         org.example.libreoffice              V  requestHideFillUi(null): anchor = null
Comment 23 QA Administrators 2023-08-09 03:14:06 UTC Comment hidden (obsolete)
Comment 24 Michael Weghorn 2023-08-09 07:42:22 UTC
(In reply to eric li from comment #20)
> below is the libosetting.gradle,,you see the directory is wrong:
> // created by Makefile.shared - your changes will be overridden
> ext {
>     liboSrcRoot         = '/home/shanreal/libreoffice/core-master'
>     liboJniLibsdir      =
> '/home/shanreal/libreoffice/core-master/android/jniLibs' 
> (...)
> 
> I modified the liboJniLibsdir      =
> '/home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a'

That shouldn't be necessary. Mine looks like this and works fine:

    liboJniLibsdir      = '/home/michi/development/git/libreoffice-WORKTREE-android/android/jniLibs'

Can you check whether the libraries are included in the APK that is being built?

This is what it looks like for me (with an x86_64 build):

$ mkdir extracted
$ unzip ./android/source/build/outputs/apk/strippedUI/debug/LibreOfficeViewer-strippedUI-debug.apk -d extracted/
$ find extracted -name '*.so'
extracted/lib/x86_64/libnssutil3.so
extracted/lib/x86_64/libsqlite3.so
extracted/lib/x86_64/libnspr4.so
extracted/lib/x86_64/libplds4.so
extracted/lib/x86_64/libnssdbm3.so
extracted/lib/x86_64/libfreebl3.so
extracted/lib/x86_64/libsmime3.so
extracted/lib/x86_64/libsoftokn3.so
extracted/lib/x86_64/libplc4.so
extracted/lib/x86_64/libnssckbi.so
extracted/lib/x86_64/libc++_shared.so
extracted/lib/x86_64/libssl3.so
extracted/lib/x86_64/libnss3.so
extracted/lib/x86_64/liblo-native-code.so
Comment 25 eric li 2023-08-09 08:57:41 UTC
(In reply to Michael Weghorn from comment #24)
> (In reply to eric li from comment #20)
> > below is the libosetting.gradle,,you see the directory is wrong:
> > // created by Makefile.shared - your changes will be overridden
> > ext {
> >     liboSrcRoot         = '/home/shanreal/libreoffice/core-master'
> >     liboJniLibsdir      =
> > '/home/shanreal/libreoffice/core-master/android/jniLibs' 
> > (...)
> > 
> > I modified the liboJniLibsdir      =
> > '/home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a'
> 
> That shouldn't be necessary. Mine looks like this and works fine:
> 
>     liboJniLibsdir      =
> '/home/michi/development/git/libreoffice-WORKTREE-android/android/jniLibs'
> 
> Can you check whether the libraries are included in the APK that is being
> built?
> 
> This is what it looks like for me (with an x86_64 build):
> 
> $ mkdir extracted
> $ unzip
> ./android/source/build/outputs/apk/strippedUI/debug/LibreOfficeViewer-
> strippedUI-debug.apk -d extracted/
> $ find extracted -name '*.so'
> extracted/lib/x86_64/libnssutil3.so
> extracted/lib/x86_64/libsqlite3.so
> extracted/lib/x86_64/libnspr4.so
> extracted/lib/x86_64/libplds4.so
> extracted/lib/x86_64/libnssdbm3.so
> extracted/lib/x86_64/libfreebl3.so
> extracted/lib/x86_64/libsmime3.so
> extracted/lib/x86_64/libsoftokn3.so
> extracted/lib/x86_64/libplc4.so
> extracted/lib/x86_64/libnssckbi.so
> extracted/lib/x86_64/libc++_shared.so
> extracted/lib/x86_64/libssl3.so
> extracted/lib/x86_64/libnss3.so
> extracted/lib/x86_64/liblo-native-code.so

I am acutely use android studio after make the project..as I need develop something base on it.yes every .so are in the directory /home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a

shanreal@eric-Inspiron-7559:~/libreoffice/core-master/android/jniLibs/armeabi-v7a$ ll
total 127520
drwxrwxr-x 2 shanreal shanreal      4096 8月   8 18:32 ./
drwxrwxr-x 3 shanreal shanreal      4096 8月   8 18:32 ../
-rwxrwxr-x 1 shanreal shanreal   4173304 8月   8 18:32 libc++_shared.so*
-rwxrwxr-x 1 shanreal shanreal    735520 8月   8 18:32 libfreebl3.so*
-rwxrwxr-x 1 shanreal shanreal 122443524 8月   8 18:32 liblo-native-code.so*
-rwxrwxr-x 1 shanreal shanreal    215884 8月   8 18:32 libnspr4.so*
-rwxrwxr-x 1 shanreal shanreal    961472 8月   8 18:32 libnss3.so*
-rwxrwxr-x 1 shanreal shanreal    381612 8月   8 18:32 libnssckbi.so*
-rwxrwxr-x 1 shanreal shanreal    106596 8月   8 18:32 libnssdbm3.so*
-rwxrwxr-x 1 shanreal shanreal    153256 8月   8 18:32 libnssutil3.so*
-rwxrwxr-x 1 shanreal shanreal     13040 8月   8 18:32 libplc4.so*
-rwxrwxr-x 1 shanreal shanreal      8268 8月   8 18:32 libplds4.so*
-rwxrwxr-x 1 shanreal shanreal    126188 8月   8 18:32 libsmime3.so*
-rwxrwxr-x 1 shanreal shanreal    231412 8月   8 18:32 libsoftokn3.so*
-rwxrwxr-x 1 shanreal shanreal    540688 8月   8 18:32 libsqlite3.so*
-rwxrwxr-x 1 shanreal shanreal    436416 8月   8 18:32 libssl3.so*
shanreal@eric-Inspiron-7559:~/libreoffice/core-master/android/jniLibs/armeabi-v7a$
Comment 26 Michael Weghorn 2023-08-09 09:06:36 UTC
(In reply to eric li from comment #25)
> I am acutely use android studio after make the project..as I need develop
> something base on it.yes every .so are in the directory
> /home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a
> 
> shanreal@eric-Inspiron-7559:~/libreoffice/core-master/android/jniLibs/
> armeabi-v7a$ ll
> total 127520
> drwxrwxr-x 2 shanreal shanreal      4096 8月   8 18:32 ./
> drwxrwxr-x 3 shanreal shanreal      4096 8月   8 18:32 ../
> -rwxrwxr-x 1 shanreal shanreal   4173304 8月   8 18:32 libc++_shared.so*

This looks like the build directory. And are they also in the **APK**, i.e. do you see them when extracting the APK file as described in my previous comment?
Comment 27 eric li 2023-08-09 09:22:56 UTC
(In reply to Michael Weghorn from comment #26)
> (In reply to eric li from comment #25)
> > I am acutely use android studio after make the project..as I need develop
> > something base on it.yes every .so are in the directory
> > /home/shanreal/libreoffice/core-master/android/jniLibs/armeabi-v7a
> > 
> > shanreal@eric-Inspiron-7559:~/libreoffice/core-master/android/jniLibs/
> > armeabi-v7a$ ll
> > total 127520
> > drwxrwxr-x 2 shanreal shanreal      4096 8月   8 18:32 ./
> > drwxrwxr-x 3 shanreal shanreal      4096 8月   8 18:32 ../
> > -rwxrwxr-x 1 shanreal shanreal   4173304 8月   8 18:32 libc++_shared.so*
> 
> This looks like the build directory. And are they also in the **APK**, i.e.
> do you see them when extracting the APK file as described in my previous
> comment?

below is results:

shanreal@eric-Inspiron-7559:~/libreoffice$ find . -name '*.so'
./core-master/android/obj/local/armeabi-v7a/liblo-native-code.so
./core-master/android/jniLibs/armeabi-v7a/libsmime3.so
./core-master/android/jniLibs/armeabi-v7a/libfreebl3.so
./core-master/android/jniLibs/armeabi-v7a/libplds4.so
./core-master/android/jniLibs/armeabi-v7a/liblo-native-code.so
./core-master/android/jniLibs/armeabi-v7a/libnspr4.so
./core-master/android/jniLibs/armeabi-v7a/libnssutil3.so
./core-master/android/jniLibs/armeabi-v7a/libnss3.so
./core-master/android/jniLibs/armeabi-v7a/libsqlite3.so
./core-master/android/jniLibs/armeabi-v7a/libsoftokn3.so
./core-master/android/jniLibs/armeabi-v7a/libc++_shared.so
./core-master/android/jniLibs/armeabi-v7a/libnssdbm3.so
./core-master/android/jniLibs/armeabi-v7a/libssl3.so
./core-master/android/jniLibs/armeabi-v7a/libplc4.so
./core-master/android/jniLibs/armeabi-v7a/libnssckbi.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/nss/out/libnss3.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/softoken/legacydb/out/libnssdbm3.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/softoken/out/libsoftokn3.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/ckfw/builtins/out/libnssckbi.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/util/out/libnssutil3.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/sqlite/out/libsqlite3.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/ssl/out/libssl3.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/smime/out/libsmime3.so
./core-master/workdir/UnpackedTarball/nss/nss/lib/freebl/out/Android_SINGLE_SHLIB/libfreebl3.so
./core-master/workdir/UnpackedTarball/nss/nspr/out/pr/src/libnspr4.so
./core-master/workdir/UnpackedTarball/nss/nspr/out/lib/ds/libplds4.so
./core-master/workdir/UnpackedTarball/nss/nspr/out/lib/libc/src/libplc4.so
./core-master/workdir/UnpackedTarball/nss/dist/out/bin/libplds4.so
./core-master/workdir/UnpackedTarball/nss/dist/out/bin/libnspr4.so
./core-master/workdir/UnpackedTarball/nss/dist/out/bin/libplc4.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libsmime3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libfreebl3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libplds4.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libnspr4.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libnssutil3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libnss3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libsqlite3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libsoftokn3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libnssdbm3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libssl3.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libplc4.so
./core-master/workdir/UnpackedTarball/nss/dist/out/lib/libnssckbi.so
./core-master/instdir/program/libsmime3.so
./core-master/instdir/program/libfreebl3.so
./core-master/instdir/program/libplds4.so
./core-master/instdir/program/libnspr4.so
./core-master/instdir/program/libnssutil3.so
./core-master/instdir/program/libnss3.so
./core-master/instdir/program/libsqlite3.so
./core-master/instdir/program/libsoftokn3.so
./core-master/instdir/program/libnssdbm3.so
./core-master/instdir/program/libssl3.so
./core-master/instdir/program/libplc4.so
./core-master/instdir/program/libnssckbi.so
./core-master/workdir_for_build/Headers/Library/libuuresolverlo.so
./core-master/workdir_for_build/Headers/Library/libstocserviceslo.so
./core-master/workdir_for_build/Headers/Library/libjavaloaderlo.so
./core-master/workdir_for_build/Headers/Library/libinvocadaptlo.so
./core-master/workdir_for_build/Headers/Library/libi18nlangtag.so
./core-master/workdir_for_build/Headers/Library/libstorelo.so
./core-master/workdir_for_build/Headers/Library/libgcc3_uno.so
./core-master/workdir_for_build/Headers/Library/libbasegfxlo.so
./core-master/workdir_for_build/Headers/Library/libreflectionlo.so
./core-master/workdir_for_build/Headers/Library/libjavavmlo.so
./core-master/workdir_for_build/Headers/Library/libbootstraplo.so
./core-master/workdir_for_build/Headers/Library/libsal_textenclo.so
./core-master/workdir_for_build/Headers/Library/libsaxlo.so
./core-master/workdir_for_build/Headers/Library/libjvmfwklo.so
./core-master/workdir_for_build/Headers/Library/libbinaryurplo.so
./core-master/workdir_for_build/Headers/Library/libtllo.so
./core-master/workdir_for_build/Headers/Library/libxmlreaderlo.so
./core-master/workdir_for_build/Headers/Library/libunoidllo.so
./core-master/workdir_for_build/Headers/Library/libintrospectionlo.so
./core-master/workdir_for_build/Headers/Library/libreglo.so
./core-master/workdir_for_build/Headers/Library/libproxyfaclo.so
./core-master/workdir_for_build/Headers/Library/libinvocationlo.so
./core-master/workdir_for_build/Headers/Library/libiolo.so
./core-master/workdir_for_build/Headers/Library/libnamingservicelo.so
./core-master/workdir_for_build/Headers/Library/libjvmaccesslo.so
./core-master/workdir_for_build/Headers/Library/libcomphelper.so
./core-master/workdir_for_build/Headers/Library/libucbhelper.so
./core-master/workdir_for_build/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.so
./core-master/workdir_for_build/UnpackedTarball/icu/source/tools/ctestfw/libicutest.so
./core-master/workdir_for_build/UnpackedTarball/icu/source/lib/libicui18n.so
./core-master/workdir_for_build/UnpackedTarball/icu/source/lib/libicutu.so
./core-master/workdir_for_build/UnpackedTarball/icu/source/lib/libicuio.so
./core-master/workdir_for_build/UnpackedTarball/icu/source/lib/libicuuc.so
./core-master/workdir_for_build/UnpackedTarball/icu/source/lib/libicudata.so
./core-master/workdir_for_build/UnpackedTarball/icu/source/stubdata/libicudata.so
./core-master/instdir_for_build/sdk/lib/libuno_cppu.so
./core-master/instdir_for_build/sdk/lib/libuno_sal.so
./core-master/instdir_for_build/sdk/lib/libuno_salhelpergcc3.so
./core-master/instdir_for_build/sdk/lib/libuno_cppuhelpergcc3.so
./core-master/instdir_for_build/program/libuuresolverlo.so
./core-master/instdir_for_build/program/libstocserviceslo.so
./core-master/instdir_for_build/program/libjavaloaderlo.so
./core-master/instdir_for_build/program/libinvocadaptlo.so
./core-master/instdir_for_build/program/libi18nlangtag.so
./core-master/instdir_for_build/program/libstorelo.so
./core-master/instdir_for_build/program/libgcc3_uno.so
./core-master/instdir_for_build/program/libbasegfxlo.so
./core-master/instdir_for_build/program/libreflectionlo.so
./core-master/instdir_for_build/program/libjavavmlo.so
./core-master/instdir_for_build/program/libbootstraplo.so
./core-master/instdir_for_build/program/libsal_textenclo.so
./core-master/instdir_for_build/program/libsaxlo.so
./core-master/instdir_for_build/program/libjvmfwklo.so
./core-master/instdir_for_build/program/libbinaryurplo.so
./core-master/instdir_for_build/program/libtllo.so
./core-master/instdir_for_build/program/libxmlreaderlo.so
./core-master/instdir_for_build/program/libunoidllo.so
./core-master/instdir_for_build/program/libintrospectionlo.so
./core-master/instdir_for_build/program/libreglo.so
./core-master/instdir_for_build/program/libproxyfaclo.so
./core-master/instdir_for_build/program/libinvocationlo.so
./core-master/instdir_for_build/program/libiolo.so
./core-master/instdir_for_build/program/libnamingservicelo.so
./core-master/instdir_for_build/program/libjvmaccesslo.so
./core-master/instdir_for_build/program/libcomphelper.so
./core-master/instdir_for_build/program/libucbhelper.so
Comment 28 Michael Weghorn 2023-08-09 09:37:17 UTC
(In reply to eric li from comment #27)
> below is results:
> 
> shanreal@eric-Inspiron-7559:~/libreoffice$ find . -name '*.so'
> ...

Those are all .so files in the source dir. Can you please try again with exactly the commands I have given in comment 24:

$ mkdir extracted
$ unzip ./android/source/build/outputs/apk/strippedUI/debug/LibreOfficeViewer-strippedUI-debug.apk -d extracted/
$ find extracted -name '*.so'
Comment 29 eric li 2023-08-09 09:56:02 UTC
so As your explained :
 I found the android studio

   1) in "android"model ,then only can see an empty directory"jniLibs"..nothing below that in the project tree


      2) in "project"model,can't find out any "jniLibs"
Comment 30 eric li 2023-08-09 10:04:07 UTC
(In reply to Michael Weghorn from comment #28)
> (In reply to eric li from comment #27)
> > below is results:
> > 
> > shanreal@eric-Inspiron-7559:~/libreoffice$ find . -name '*.so'
> > ...
> 
> Those are all .so files in the source dir. Can you please try again with
> exactly the commands I have given in comment 24:
> 
> $ mkdir extracted
> $ unzip
> ./android/source/build/outputs/apk/strippedUI/debug/LibreOfficeViewer-
> strippedUI-debug.apk -d extracted/
> $ find extracted -name '*.so'

and yes,,,there is no any .so
Comment 31 Michael Weghorn 2023-08-09 10:10:03 UTC
(In reply to eric li from comment #30)
> and yes,,,there is no any .so

That explains the problem when trying to run the app and means something is wrong with your build setup. I'd suggest to start anew with a fresh checkout/download of the LibreOffice source code.

I'm not aware of anything explicitly requiring building from git, but if you still get the same problem after starting afresh, I'd suggest trying to find a way to do the same with a "proper" git repo. https://www.libreoffice.org/about-us/source-code/ describes several ways to get one. (If the `git pull` doesn't work at all, I'd suggest trying with the version that you get from the bundle at first, just to see whether that works).
Comment 32 eric li 2023-08-09 16:46:31 UTC
I just redo it for spending serveral hours

1)git clone git://gerrit.libreoffice.org/core libreoffice

2) and after make,,I opened android studio from android/source..the ALLOW_EDITING come with it,,and I modified it directly as false to make android studio continue

3)again ,,meet the issue missing 
Shutting down VM
2023-08-10 00:42:36.974 10370-10370 AndroidRuntime          org.example.libreoffice              E  FATAL EXCEPTION: main
                                                                                                    Process: org.example.libreoffice, PID: 10370
                                                                                                    java.lang.UnsatisfiedLinkError: dlopen failed: library "libnspr4.so" not found

what can I do now to find out the root course? pls help that
Comment 33 eric li 2023-08-09 17:11:40 UTC
I don't know why ..the jniLibs directory should be in the android/source directory ,,but it is on the upper directory(android/)..even I changed the path in build.gradle for it,,but it doesn't work ..
Comment 34 eric li 2023-08-10 00:36:46 UTC
Do you know a way or a branch which can gurantee build and run successfully?


I will use git pulll to try ,,you know everytime pull and build will take at least half day ,,,really painfull


thanks
Comment 35 QA Administrators 2023-08-10 03:05:54 UTC Comment hidden (obsolete)
Comment 36 Michael Weghorn 2023-08-10 05:45:31 UTC
(In reply to eric li from comment #34)
> Do you know a way or a branch which can gurantee build and run successfully?

The version in F-Droid is built from commit 5c1c768e128d.
But to me, the problem you're having so far doesn't look like a problem of the version you're building, but something in your local build setup.

(In reply to eric li from comment #33)
> I don't know why ..the jniLibs directory should be in the android/source
> directory ,,but it is on the upper directory(android/)..even I changed the
> path in build.gradle for it,,but it doesn't work ..

It shouldn't be necessary to change any paths manually. I'd suggest to first analyse why libraries are not in the APK file and just observe the output of the default build (i.e. what `make` produces, avoiding Android Studio for the moment).

What I'd suggest is this:

* undo all local modifications
* run `make android.clean`
* run `make`
* run the steps from comment 24 again and report the output here

(To have an even cleaner state to start with, a `make distclean` would be even better, but then the build will take longer, let's start with the above first.)
Comment 37 eric li 2023-08-10 07:02:55 UTC
thanks for reply.So I just follow your instructions 

1) make distclean :success
2) autogen.sh and make then:success (this time no need download ,so it is faster)
3) make install :sucess
4)extract the apk to a file and using find *.so:result is no any *.so





shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install
if test "$ENABLE_ANDROID_LOK" != "TRUE" ; then ./gradlew   installStrippedUIDebug ; fi

> Task :installStrippedUIDebug
Installing APK 'LibreOfficeViewer-strippedUI-debug.apk' on 'LSA-AN00 - 12' for ::strippedUI-debug
Installed on 1 device.

hanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted$ cd LibreOfficeViewer-strippedUI-debug/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ ls
AndroidManifest.xml                classes3.dex       META-INF
androidsupportmultidexversion.txt  classes.dex        res
assets                             DebugProbesKt.bin  resources.arsc
classes2.dex                       kotlin
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ find . -name *.so
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$
Comment 38 eric li 2023-08-10 07:06:54 UTC
is the GCC version correct?

trippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
Comment 39 eric li 2023-08-10 07:14:18 UTC
OK I will upgrade all the gcc and redo it again,,let me show the result later
Comment 40 eric li 2023-08-10 07:52:55 UTC
still can't find out any *.so in the apk


below is the console logs:

shanreal@eric-Inspiron-7559:~/NewLibreoffice$ more autogen.input
--with-distro=LibreOfficeAndroid
--with-android-sdk=/home/shanreal/Android/Sdk
--with-android-ndk=/home/shanreal/Android/Sdk/ndk/25.2.9519653
--with-jdk-home=/usr/lib/jvm/java-17-openjdk-amd64


removed org.openoffice.Office.UI/GenericCommands - saving 136
removed org.openoffice.Office.UI/Sidebar - saving 128
removed org.openoffice.Office.UI/StartModuleWindowState - saving 143
saved 3563 of 7299 bytes: 49%

> Task :compileStrippedUIDebugJavaWithJavac
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。

BUILD SUCCESSFUL in 44s
35 actionable tasks: 34 executed, 1 up-to-date
[CUS] android/loandroid3
[BIN] android
[MOD] android
[MOD] libreoffice
[BIN] top level modules: libreoffice
[ALL] top level modules: build-non-l10n-only build-l10n-only

shanreal@eric-Inspiron-7559:~/NewLibreoffice$ cd android/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android$ cd source
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install
if test "$ENABLE_ANDROID_LOK" != "TRUE" ; then ./gradlew   installStrippedUIDebug ; fi

> Task :installStrippedUIDebug
Installing APK 'LibreOfficeViewer-strippedUI-debug.apk' on 'LSA-AN00 - 12' for ::strippedUI-debug
Installed on 1 device.

BUILD SUCCESSFUL in 8s
36 actionable tasks: 1 executed, 35 up-to-date

Run it with "make run"

shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ 


shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ find . -name *.apk
./build/outputs/apk/strippedUI/debug/LibreOfficeViewer-strippedUI-debug.apk
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ cd /build/outputs/apk/strippedUI/debug/
bash: cd: /build/outputs/apk/strippedUI/debug/: No such file or directory
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ cd ./build/outputs/apk/strippedUI/debug/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ ls
LibreOfficeViewer-strippedUI-debug.apk  output-metadata.json
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ mkdir extracted
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ ls
extracted  LibreOfficeViewer-strippedUI-debug.apk  output-metadata.json
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ cd extracted/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted$ ls
LibreOfficeViewer-strippedUI-debug  LibreOfficeViewer-strippedUI-debug.apk
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted$ cd LibreOfficeViewer-strippedUI-debug/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ ls
AndroidManifest.xml                classes3.dex       META-INF
androidsupportmultidexversion.txt  classes.dex        res
assets                             DebugProbesKt.bin  resources.arsc
classes2.dex                       kotlin
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ find . -name *.so
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$
Comment 41 Michael Weghorn 2023-08-10 07:59:50 UTC
(In reply to eric li from comment #37)
> thanks for reply.So I just follow your instructions 
> 
> 1) make distclean :success
> 2) autogen.sh and make then:success (this time no need download ,so it is
> faster)
> 3) make install :sucess

Step 3 should be just running `make` from top-level source directory. Running `make install` isn't necessary to build the APK. What happens if you do that and look at the APK afterwards?

(In reply to eric li from comment #38)
> is the GCC version correct?

Locally installed GCC version should be irrelevant, since it uses clang from the Android SDK for building.
Comment 42 eric li 2023-08-10 08:11:06 UTC
still can't find out any *.so in the apk


below is the console logs:

shanreal@eric-Inspiron-7559:~/NewLibreoffice$ more autogen.input
--with-distro=LibreOfficeAndroid
--with-android-sdk=/home/shanreal/Android/Sdk
--with-android-ndk=/home/shanreal/Android/Sdk/ndk/25.2.9519653
--with-jdk-home=/usr/lib/jvm/java-17-openjdk-amd64


removed org.openoffice.Office.UI/GenericCommands - saving 136
removed org.openoffice.Office.UI/Sidebar - saving 128
removed org.openoffice.Office.UI/StartModuleWindowState - saving 143
saved 3563 of 7299 bytes: 49%

> Task :compileStrippedUIDebugJavaWithJavac
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。

BUILD SUCCESSFUL in 44s
35 actionable tasks: 34 executed, 1 up-to-date
[CUS] android/loandroid3
[BIN] android
[MOD] android
[MOD] libreoffice
[BIN] top level modules: libreoffice
[ALL] top level modules: build-non-l10n-only build-l10n-only

shanreal@eric-Inspiron-7559:~/NewLibreoffice$ cd android/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android$ cd source
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install
if test "$ENABLE_ANDROID_LOK" != "TRUE" ; then ./gradlew   installStrippedUIDebug ; fi

> Task :installStrippedUIDebug
Installing APK 'LibreOfficeViewer-strippedUI-debug.apk' on 'LSA-AN00 - 12' for ::strippedUI-debug
Installed on 1 device.

BUILD SUCCESSFUL in 8s
36 actionable tasks: 1 executed, 35 up-to-date

Run it with "make run"

shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ 


shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ find . -name *.apk
./build/outputs/apk/strippedUI/debug/LibreOfficeViewer-strippedUI-debug.apk
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ cd /build/outputs/apk/strippedUI/debug/
bash: cd: /build/outputs/apk/strippedUI/debug/: No such file or directory
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ cd ./build/outputs/apk/strippedUI/debug/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ ls
LibreOfficeViewer-strippedUI-debug.apk  output-metadata.json
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ mkdir extracted
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ ls
extracted  LibreOfficeViewer-strippedUI-debug.apk  output-metadata.json
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug$ cd extracted/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted$ ls
LibreOfficeViewer-strippedUI-debug  LibreOfficeViewer-strippedUI-debug.apk
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted$ cd LibreOfficeViewer-strippedUI-debug/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ ls
AndroidManifest.xml                classes3.dex       META-INF
androidsupportmultidexversion.txt  classes.dex        res
assets                             DebugProbesKt.bin  resources.arsc
classes2.dex                       kotlin
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ find . -name *.so
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source/build/outputs/apk/strippedUI/debug/extracted/LibreOfficeViewer-strippedUI-debug$ 



(In reply to Michael Weghorn from comment #41)
> (In reply to eric li from comment #37)
> > thanks for reply.So I just follow your instructions 
> > 
> > 1) make distclean :success
> > 2) autogen.sh and make then:success (this time no need download ,so it is
> > faster)
> > 3) make install :sucess
> 
> Step 3 should be just running `make` from top-level source directory.
> Running `make install` isn't necessary to build the APK. What happens if you
> do that and look at the APK afterwards?
> 

yes ,make is the top level of the source direcotry..I did 2 times.

> (In reply to eric li from comment #38)
> > is the GCC version correct?
> 
> Locally installed GCC version should be irrelevant, since it uses clang from
> the Android SDK for building.


so ,,what can we try now??set the version to F-Droid version?
Comment 43 Michael Weghorn 2023-08-10 08:25:55 UTC
(In reply to eric li from comment #42)
> still can't find out any *.so in the apk
> shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install

The `make install` part isn't needed to build the APK, let's leave that out for now, just to be sure, and repeat the previous steps.


> so ,,what can we try now??set the version to F-Droid version?

What's the output of these commands, all run from the top-level source directory?

$ git status`
$ git log -n1`
$ find android -name '*.so
Comment 44 eric li 2023-08-10 09:39:47 UTC
blew is the result ,ple help to check it:

removed org.openoffice.Office.UI/GenericCommands - saving 136
removed org.openoffice.Office.UI/Sidebar - saving 128
removed org.openoffice.Office.UI/StartModuleWindowState - saving 143
saved 3563 of 7299 bytes: 49%

> Task :compileStrippedUIDebugJavaWithJavac
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。

BUILD SUCCESSFUL in 59s
37 actionable tasks: 36 executed, 1 up-to-date
[CUS] android/loandroid3
[BIN] android
[MOD] android
[MOD] libreoffice
[BIN] top level modules: libreoffice
[ALL] top level modules: build-non-l10n-only build-l10n-only
shanreal@eric-Inspiron-7559:~/NewLibreoffice$ git status
Refresh index: 100% (145868/145868), done.
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   android/source/build.gradle
	modified:   android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
	modified:   android/source/src/java/org/libreoffice/SettingsActivity.java
	modified:   android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	instsetoo_native/foo/

no changes added to commit (use "git add" and/or "git commit -a")


shanreal@eric-Inspiron-7559:~/NewLibreoffice$ git log -nl
(result is empty)


shanreal@eric-Inspiron-7559:~/NewLibreoffice$ cd android
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android$ find . -name *.so
./obj/local/armeabi-v7a/liblo-native-code.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libsmime3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libfreebl3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libplds4.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/liblo-native-code.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libnspr4.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libnssutil3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libnss3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libsqlite3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libsoftokn3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libc++_shared.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libnssdbm3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libssl3.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libplc4.so
./source/build/intermediates/merged_jni_libs/strippedUIDebug/out/armeabi-v7a/libnssckbi.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libsmime3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libfreebl3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libplds4.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/liblo-native-code.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnspr4.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnssutil3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnss3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libsqlite3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libsoftokn3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libc++_shared.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnssdbm3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libssl3.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libplc4.so
./source/build/intermediates/stripped_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnssckbi.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libsmime3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libfreebl3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libplds4.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/liblo-native-code.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnspr4.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnssutil3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnss3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libsqlite3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libsoftokn3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libc++_shared.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnssdbm3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libssl3.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libplc4.so
./source/build/intermediates/merged_native_libs/strippedUIDebug/out/lib/armeabi-v7a/libnssckbi.so
./jniLibs/armeabi-v7a/libsmime3.so
./jniLibs/armeabi-v7a/libfreebl3.so
./jniLibs/armeabi-v7a/libplds4.so
./jniLibs/armeabi-v7a/liblo-native-code.so
./jniLibs/armeabi-v7a/libnspr4.so
./jniLibs/armeabi-v7a/libnssutil3.so
./jniLibs/armeabi-v7a/libnss3.so
./jniLibs/armeabi-v7a/libsqlite3.so
./jniLibs/armeabi-v7a/libsoftokn3.so
./jniLibs/armeabi-v7a/libc++_shared.so
./jniLibs/armeabi-v7a/libnssdbm3.so
./jniLibs/armeabi-v7a/libssl3.so
./jniLibs/armeabi-v7a/libplc4.so
./jniLibs/armeabi-v7a/libnssckbi.so
Comment 45 Michael Weghorn 2023-08-10 09:57:06 UTC
(In reply to eric li from comment #44)
> blew is the result ,ple help to check it:
> 
> (...)
> shanreal@eric-Inspiron-7559:~/NewLibreoffice$ git status
> Refresh index: 100% (145868/145868), done.
> On branch master
> Your branch is up to date with 'origin/master'.
> 
> Changes not staged for commit:
>   (use "git add <file>..." to update what will be committed)
>   (use "git restore <file>..." to discard changes in working directory)
> 	modified:   android/source/build.gradle
> 	modified:  
> android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
> 	modified:   android/source/src/java/org/libreoffice/SettingsActivity.java
> 	modified:  
> android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java

This suggests you skipped an essential step from what I suggested in comment 36: undoing all local modifications:

(In reply to Michael Weghorn from comment #36)
> What I'd suggest is this:
> 
> * undo all local modifications
> * run `make android.clean`
> * run `make`
> * run the steps from comment 24 again and report the output here
> 
> (To have an even cleaner state to start with, a `make distclean` would be
> even better, but then the build will take longer, let's start with the above
> first.)



 Please do that (e.g. `git checkout -- .`) and try again from the beginning.
The modifications to your build.gradle *might* be causing the problem.
Comment 46 eric li 2023-08-10 10:07:14 UTC
Hi michael ,,thanks for your help ,now it works on it well.

and I figure out what happen I guess...actully ,the command line work ,,and android studio doesn't work at all,,all the issue made by that I want to use android studio to build it


when I use fully commanline like make install ..

there is no issue,,when I used android studio ,,the ALLOW_EDITING issue and missing .so all will come out ..


is the android/source is the home direcotry in the android studio?

what happened then?


thanks a lot
Comment 47 Michael Weghorn 2023-08-10 10:16:13 UTC
(In reply to eric li from comment #46)
> Hi michael ,,thanks for your help ,now it works on it well.

Great, thanks for the update. Closing as WORKSFORME then.

> and I figure out what happen I guess...actully ,the command line work ,,and
> android studio doesn't work at all,,all the issue made by that I want to use
> android studio to build it
> 
> 
> when I use fully commanline like make install ..
> 
> there is no issue,,when I used android studio ,,the ALLOW_EDITING issue and
> missing .so all will come out ..
> 
> 
> is the android/source is the home direcotry in the android studio?
> 
> what happened then?

Might be that Android studio somewhat considers the architecture of the target device (IIUC, 64-bit ARM in your case) and then just skips the 32-bit ARM libraries and doesn't include them into the app it installs, even though 32-bit ARM apps run just fine on 64-bit ARM processors.

What you could try is do a 64-bit ARM build instead, i.e. use autogen switch `--with-distro=LibreOfficeAndroidAarch64` instead of `--with-distro=LibreOfficeAndroid`.
Comment 48 eric li 2023-08-10 10:23:27 UTC
thansk ,,I know google/android will only support 64bit,,but abi is support 64bit too..really don't know they are using such aggressive way to let people not use 32bit..will update it work or not later


regards
eric
Comment 49 eric li 2023-08-10 14:55:34 UTC
Hi,,michael

 it is looks like can't make the project success if we use 64bit as you metioned 

will fail at make stage ,,can't get what error ,just

shanreal@eric-Inspiron-7559:~/libreoffice$ ls *.mk
Library_merged.mk      RepositoryFixes.mk  RepositoryModule_build.mk
RepositoryExternal.mk  Repository.mk       RepositoryModule_host.mk
shanreal@eric-Inspiron-7559:~/libreoffice$ more autogen.input 
--with-distro=LibreOfficeAndroidAarch64
--with-android-sdk=/home/shanreal/Android/Sdk
--with-android-ndk=/home/shanreal/Android/Sdk/ndk/25.2.9519653
--with-jdk-home=/usr/lib/jvm/java-17-openjdk-amd64
shanreal@eric-Inspiron-7559:~/libreoffice$ 

and if I used make ,,,finally there 2 erorrs in the make stage and can't go on
Comment 50 Michael Weghorn 2023-08-10 15:04:18 UTC
(In reply to eric li from comment #49)
>  it is looks like can't make the project success if we use 64bit as you
> metioned 
> 
> will fail at make stage ,,can't get what error ,just

Please submit the whole output to pastebin or attach as a file here.

Did you do a `make distclean` after adapting the autogen.input and before building anew? If not, please do and try again.
Comment 51 QA Administrators 2023-08-11 03:06:14 UTC Comment hidden (obsolete)
Comment 52 eric li 2023-08-11 03:54:59 UTC
I actually copy the previous project directory to a new one ..and tried to change the android to 64bit as your suggested
but make fail with 2 errors,,I search all out logs and can't find out any detail error..
then I redo make distclean but another issue happen with make

shanreal@eric-Inspiron-7559:~/NewLibreoffice$ make distclean
make: *** No rule to make target 'distclean'.  Stop.


shanreal@eric-Inspiron-7559:~/NewLibreoffice$ make distclean
make: *** No rule to make target 'distclean'.  Stop.


now even in previsou directory which can work well still can't use make with the error above

shanreal@eric-Inspiron-7559:~/NewLibreoffice$ make distclean
make: *** No rule to make target 'distclean'.  Stop.
 
make install can't work again with errors below:
msicreator                 xmlsecurity
shanreal@eric-Inspiron-7559:~/NewLibreoffice$ cd android/
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android$ cd source
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install
make: /bin/lo-all-static-libs: Command not found
Makefile:3: ../../config_host.mk: No such file or directory
make: *** No rule to make target '../../config_host.mk'.  Stop.
shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$
Comment 53 Michael Weghorn 2023-08-11 05:38:26 UTC
(In reply to eric li from comment #52)
> now even in previsou directory which can work well still can't use make with
> the error above
> 
> shanreal@eric-Inspiron-7559:~/NewLibreoffice$ make distclean
> make: *** No rule to make target 'distclean'.  Stop.

That's fine if the directory is already clean.

>  
> make install can't work again with errors below:
> msicreator                 xmlsecurity
> shanreal@eric-Inspiron-7559:~/NewLibreoffice$ cd android/
> shanreal@eric-Inspiron-7559:~/NewLibreoffice/android$ cd source
> shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install
> make: /bin/lo-all-static-libs: Command not found
> Makefile:3: ../../config_host.mk: No such file or directory
> make: *** No rule to make target '../../config_host.mk'.  Stop.
> shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$

I'd suggest to do a `git clean -dxf` then in both directories to remove all files not maintained in git, then start afresh (put autogen.input in place, `./autogen.sh`, `make`).
Comment 54 eric li 2023-08-11 06:55:25 UTC
(In reply to Michael Weghorn from comment #53)
> (In reply to eric li from comment #52)
> > now even in previsou directory which can work well still can't use make with
> > the error above
> > 
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice$ make distclean
> > make: *** No rule to make target 'distclean'.  Stop.
> 
> That's fine if the directory is already clean.
> 
> >  
> > make install can't work again with errors below:
> > msicreator                 xmlsecurity
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice$ cd android/
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice/android$ cd source
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install
> > make: /bin/lo-all-static-libs: Command not found
> > Makefile:3: ../../config_host.mk: No such file or directory
> > make: *** No rule to make target '../../config_host.mk'.  Stop.
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$
> 
> I'd suggest to do a `git clean -dxf` then in both directories to remove all
> files not maintained in git, then start afresh (put autogen.input in place,
> `./autogen.sh`, `make`).

I can do that,,but I feel there are something wrong with "make" I will do it later,,
Comment 55 eric li 2023-08-11 12:58:57 UTC
(In reply to Michael Weghorn from comment #53)
> (In reply to eric li from comment #52)
> > now even in previsou directory which can work well still can't use make with
> > the error above
> > 
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice$ make distclean
> > make: *** No rule to make target 'distclean'.  Stop.
> 
> That's fine if the directory is already clean.
> 
> >  
> > make install can't work again with errors below:
> > msicreator                 xmlsecurity
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice$ cd android/
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice/android$ cd source
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$ make install
> > make: /bin/lo-all-static-libs: Command not found
> > Makefile:3: ../../config_host.mk: No such file or directory
> > make: *** No rule to make target '../../config_host.mk'.  Stop.
> > shanreal@eric-Inspiron-7559:~/NewLibreoffice/android/source$
> 
> I'd suggest to do a `git clean -dxf` then in both directories to remove all
> files not maintained in git, then start afresh (put autogen.input in place,
> `./autogen.sh`, `make`).


I did what you suggested,,it works...and now I can use 64bit now ,,but still the same problem not resolve ,,,that is android studio can't build it with missing *.so..in the android studio ,,I think the direcotry is wrong ..in project model,,I even can't find out the lib or jniLib directory

shanreal@eric-Inspiron-7559:~/libreoffice$ more autogen.input
--with-distro=LibreOfficeAndroidAarch64
--with-android-sdk=/home/shanreal/Android/Sdk
--with-android-ndk=/home/shanreal/Android/Sdk/ndk/25.2.9519653
--with-jdk-home=/usr/lib/jvm/java-17-openjdk-amd64



thanks
Comment 56 QA Administrators 2023-08-12 03:06:17 UTC Comment hidden (obsolete)
Comment 57 Michael Weghorn 2023-08-14 07:13:54 UTC
(In reply to eric li from comment #55)
> I did what you suggested,,it works...and now I can use 64bit now

Great.

> ,,but still
> the same problem not resolve ,,,that is android studio can't build it with
> missing *.so..in the android studio ,,I think the direcotry is wrong ..in
> project model,,I even can't find out the lib or jniLib directory

It works just fine for me with x86_64 (and a corresponding AVD) and it's unclear to me what should be substantially different with other architectures.

Sorry, I don't have the time to-double-check with 64-bit ARM myself now, but I'd recommend to double-check that you have no local modifications.
And then to check whether it works for you with x86_64 as well, and if it does, what is the relevant difference between the 2 different builds and how Android Studio treats them.

Closing this ticket, since the LO Android build works and the issue is somewhat Android-Studio-related, so not a bug in the app.