Extension linking / import native libraries


#1

Hi,
I am developing an extension for Android. It would be a simple extension for the Android obb file. But I have a problem with the dependency for play_licensing and downloader_library.
If I use this extension in a sample project the *.java imports for the libs shown above wont be found so the release / debug build failed.

I have added these two libs as a dependency in the extension lib include.xml.

Any help would be very nice.

Best Railnation


#2

Microsoft Windows [Version 10.0.16299.371]
© 2017 Microsoft Corporation. Alle Rechte vorbehalten.

C:\haxe\ExtensionModule>lime test “project.xml” android -debug
Creating C:/haxe/ExtensionModule/bin/android/obj/obj/android-debug-v7/__pch/haxe/hxcpp.h.gch…

Compiling group: haxe
arm-linux-androideabi-g++ -Iinclude --sysroot=C:\Android\android-ndk/platforms/android-9/arch-arm -IC:\Android\android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -IC:\Android\android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -IC:/sdk/haxe_sdk_3.4.4/haxe/lib/hxcpp/3,4,188/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wno-overflow -D_LINUX_STDDEF_H -Wno-psabi -DHXCPP_CPP11 -DHXCPP_ARMV7 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=9 -Wa,–noexecstack -O0 -g -DNDEBUG -c … tags=[haxe,static]

  • src/lime/utils/ObjectPool_openfl_geom_Rectangle.cpp
  • src/lime/utils/ObjectPool_openfl_geom_Point.cpp
  • src/lime/utils/ObjectPool_openfl_utils_TouchData.cpp
  • src/lime/utils/ObjectPool.cpp [haxe,release]
  • src/lime/utils/Log.cpp [haxe,release]
  • src/lime/utils/ObjectPool_openfl_geom_Matrix.cpp
  • src/lime/utils/AssetCache.cpp [haxe,release]
  • src/lime/utils/ObjectPool_openfl_Vector_openfl_display_DisplayObject.cpp
  • src/ApplicationMain.cpp
    Link: libApplicationMain-debug-v7.so
    Incremental java compilation is an incubating feature.
    :app:preBuild UP-TO-DATE
    :app:preDebugBuild UP-TO-DATE
    :app:checkDebugManifest
    :app:preReleaseBuild UP-TO-DATE
    :deps:downloader_library:preBuild UP-TO-DATE
    :deps:downloader_library:preReleaseBuild UP-TO-DATE
    :deps:downloader_library:compileReleaseNdk UP-TO-DATE
    :deps:downloader_library:compileLint
    :deps:downloader_library:copyReleaseLint UP-TO-DATE
    :deps:downloader_library:mergeReleaseProguardFiles UP-TO-DATE
    :deps:downloader_library:packageReleaseRenderscript UP-TO-DATE
    :deps:downloader_library:checkReleaseManifest
    :deps:downloader_library:prepareReleaseDependencies
    :deps:downloader_library:compileReleaseRenderscript UP-TO-DATE
    :deps:downloader_library:generateReleaseResValues UP-TO-DATE
    :deps:downloader_library:generateReleaseResources UP-TO-DATE
    :deps:downloader_library:packageReleaseResources UP-TO-DATE
    :deps:downloader_library:compileReleaseAidl UP-TO-DATE
    :deps:downloader_library:generateReleaseBuildConfig UP-TO-DATE
    :deps:downloader_library:mergeReleaseShaders UP-TO-DATE
    :deps:downloader_library:compileReleaseShaders UP-TO-DATE
    :deps:downloader_library:generateReleaseAssets UP-TO-DATE
    :deps:downloader_library:mergeReleaseAssets UP-TO-DATE
    :deps:downloader_library:processReleaseManifest UP-TO-DATE
    :deps:downloader_library:processReleaseResources UP-TO-DATE
    :deps:downloader_library:generateReleaseSources UP-TO-DATE
    :deps:downloader_library:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
    :deps:downloader_library:compileReleaseJavaWithJavac UP-TO-DATE
    :deps:downloader_library:processReleaseJavaRes UP-TO-DATE
    :deps:downloader_library:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
    :deps:downloader_library:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
    :deps:downloader_library:mergeReleaseJniLibFolders UP-TO-DATE
    :deps:downloader_library:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
    :deps:downloader_library:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
    :deps:downloader_library:bundleRelease UP-TO-DATE
    :deps:extension-api:preBuild UP-TO-DATE
    :deps:extension-api:preReleaseBuild UP-TO-DATE
    :deps:extension-api:compileReleaseNdk UP-TO-DATE
    :deps:extension-api:compileLint
    :deps:extension-api:copyReleaseLint UP-TO-DATE
    :deps:extension-api:mergeReleaseProguardFiles UP-TO-DATE
    :deps:extension-api:packageReleaseRenderscript UP-TO-DATE
    :deps:extension-api:checkReleaseManifest
    :deps:extension-api:prepareReleaseDependencies
    :deps:extension-api:compileReleaseRenderscript UP-TO-DATE
    :deps:extension-api:generateReleaseResValues UP-TO-DATE
    :deps:extension-api:generateReleaseResources UP-TO-DATE
    :deps:extension-api:packageReleaseResources UP-TO-DATE
    :deps:extension-api:compileReleaseAidl UP-TO-DATE
    :deps:extension-api:generateReleaseBuildConfig UP-TO-DATE
    :deps:extension-api:mergeReleaseShaders UP-TO-DATE
    :deps:extension-api:compileReleaseShaders UP-TO-DATE
    :deps:extension-api:generateReleaseAssets UP-TO-DATE
    :deps:extension-api:mergeReleaseAssets UP-TO-DATE
    :deps:extension-api:processReleaseManifest UP-TO-DATE
    :deps:extension-api:processReleaseResources UP-TO-DATE
    :deps:extension-api:generateReleaseSources UP-TO-DATE
    :deps:extension-api:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
    :deps:extension-api:compileReleaseJavaWithJavac UP-TO-DATE
    :deps:extension-api:processReleaseJavaRes UP-TO-DATE
    :deps:extension-api:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
    :deps:extension-api:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
    :deps:extension-api:mergeReleaseJniLibFolders UP-TO-DATE
    :deps:extension-api:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
    :deps:extension-api:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
    :deps:extension-api:bundleRelease UP-TO-DATE
    :deps:obbextension:preBuild UP-TO-DATE
    :deps:obbextension:preReleaseBuild UP-TO-DATE
    :deps:obbextension:compileReleaseNdk UP-TO-DATE
    :deps:obbextension:compileLint
    :deps:obbextension:copyReleaseLint UP-TO-DATE
    :deps:obbextension:mergeReleaseProguardFiles UP-TO-DATE
    :deps:obbextension:packageReleaseRenderscript UP-TO-DATE
    :deps:obbextension:checkReleaseManifest
    :deps:obbextension:preDebugAndroidTestBuild UP-TO-DATE
    :deps:obbextension:preDebugBuild UP-TO-DATE
    :deps:obbextension:preDebugUnitTestBuild UP-TO-DATE
    :deps:obbextension:preReleaseUnitTestBuild UP-TO-DATE
    :deps:play_licensing:preBuild UP-TO-DATE
    :deps:play_licensing:preReleaseBuild UP-TO-DATE
    :deps:play_licensing:compileReleaseNdk UP-TO-DATE
    :deps:play_licensing:compileLint
    :deps:play_licensing:copyReleaseLint UP-TO-DATE
    :deps:play_licensing:mergeReleaseProguardFiles UP-TO-DATE
    :deps:play_licensing:packageReleaseRenderscript UP-TO-DATE
    :deps:play_licensing:checkReleaseManifest
    :deps:play_licensing:prepareReleaseDependencies
    :deps:play_licensing:compileReleaseRenderscript UP-TO-DATE
    :deps:play_licensing:generateReleaseResValues UP-TO-DATE
    :deps:play_licensing:generateReleaseResources UP-TO-DATE
    :deps:play_licensing:packageReleaseResources
    :deps:play_licensing:compileReleaseAidl
    :deps:play_licensing:generateReleaseBuildConfig UP-TO-DATE
    :deps:play_licensing:mergeReleaseShaders UP-TO-DATE
    :deps:play_licensing:compileReleaseShaders UP-TO-DATE
    :deps:play_licensing:generateReleaseAssets UP-TO-DATE
    :deps:play_licensing:mergeReleaseAssets UP-TO-DATE
    :deps:play_licensing:processReleaseManifest UP-TO-DATE
    :deps:play_licensing:processReleaseResources UP-TO-DATE
    :deps:play_licensing:generateReleaseSources
    :deps:play_licensing:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
    :deps:play_licensing:compileReleaseJavaWithJavac UP-TO-DATE
    :deps:play_licensing:processReleaseJavaRes UP-TO-DATE
    :deps:play_licensing:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
    :deps:play_licensing:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
    :deps:play_licensing:mergeReleaseJniLibFolders UP-TO-DATE
    :deps:play_licensing:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
    :deps:play_licensing:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
    :deps:play_licensing:bundleRelease UP-TO-DATE
    :deps:obbextension:prepareBinDepsDownloader_libraryUnspecifiedLibrary UP-TO-DATE
    :deps:obbextension:prepareBinDepsExtensionApiUnspecifiedLibrary UP-TO-DATE
    :deps:obbextension:prepareBinDepsPlay_licensingUnspecifiedLibrary UP-TO-DATE
    :deps:obbextension:prepareReleaseDependencies
    :deps:obbextension:compileReleaseRenderscript UP-TO-DATE
    :deps:obbextension:generateReleaseResValues UP-TO-DATE
    :deps:obbextension:generateReleaseResources UP-TO-DATE
    :deps:obbextension:packageReleaseResources UP-TO-DATE
    :deps:obbextension:compileReleaseAidl UP-TO-DATE
    :deps:obbextension:generateReleaseBuildConfig UP-TO-DATE
    :deps:obbextension:mergeReleaseShaders UP-TO-DATE
    :deps:obbextension:compileReleaseShaders UP-TO-DATE
    :deps:obbextension:generateReleaseAssets UP-TO-DATE
    :deps:obbextension:mergeReleaseAssets UP-TO-DATE
    :deps:obbextension:mergeReleaseResources UP-TO-DATE
    :deps:obbextension:processReleaseManifest UP-TO-DATE
    :deps:obbextension:processReleaseResources UP-TO-DATE
    :deps:obbextension:generateReleaseSources UP-TO-DATE
    :deps:obbextension:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
    :deps:obbextension:compileReleaseJavaWithJavac
    :deps:obbextension:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
    C:\haxe\ExtensionModule\bin\android\bin\deps\obbextension\src\main\java\com\brightfuture\obb\DownloaderReceiver.java:19: error: cannot find symbol
    import com.google.android.vending.licensing.LicenceChecker;
    ^
    symbol: class LicenceChecker
    location: package com.google.android.vending.licensing
    1 error
    :deps:obbextension:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:deps:obbextension:compileReleaseJavaWithJavac’.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED