Trouble with admob plugin on android-native builds.

I’m trying to use admob plugin in my project, but I guess there is a problem with admob plugin jar file. 

What I did for test purpose. 

  1. copy native App template.

  2. change main.lua as below (only 2 lines)

    local ga = require( “plugin.googleAnalytics” ) 
    local ad = require(“plugin.admob”)

  1. download plugin files via download_plugins.sh script, and copy to android/app/libs folders. (both are jar files)

  2. build with android studio and run at device. 

google analytics plugin was successfully loaded,

but admob plugin fails to be loaded. 

Is there anything I should do to ‘load’ admob plugin??

or the plugin file has faults?

01-11 01:13:14.676: I/Corona(32657): Platform: SHV-E210S / ARM Neon / 4.4.4 / Mali-400 MP / OpenGL ES 2.0 / 2018.3195 / 한국어 | KR | ko_KR | ko

01-11 01:13:14.716: V/Corona(32657): > Class.forName: shared.google.play.services.base.LuaLoader

01-11 01:13:14.776: V/Corona(32657): > Class.forName: _CoronaSetup.LuaLoader

01-11 01:13:14.781: I/Corona(32657): main.lua

01-11 01:13:14.781: V/Corona(32657): > Class.forName: plugin.googleAnalytics.LuaLoader

01-11 01:13:14.781: V/Corona(32657): < Class.forName: plugin.googleAnalytics.LuaLoader

01-11 01:13:14.781: V/Corona(32657): Loading via reflection: plugin.googleAnalytics.LuaLoader

01-11 01:13:14.786: V/Corona(32657): > Class.forName: plugin.admob.LuaLoader

01-11 01:13:14.791: I/Corona(32657): WARNING: Could not load class 'plugin.admob.LuaLoader’

01-11 01:13:14.796: I/Corona(32657): ERROR: Runtime error

01-11 01:13:14.796: I/Corona(32657): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-11.2/release/release/platform/resources/init.lua:906: module ‘plugin.admob’ not found:resource (plugin.admob.lu) does not exist in archive

01-11 01:13:14.796: I/Corona(32657): no field package.preload[‘plugin.admob’]

01-11 01:13:14.796: I/Corona(32657): no file ‘(null)/plugin/admob.lua’

01-11 01:13:14.796: I/Corona(32657): no file ‘(null)/plugin/admob.lua’

01-11 01:13:14.796: I/Corona(32657): no file ‘/data/app-lib/com.mycompany.app-17/libplugin/admob.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘./plugin/admob.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘(null)/plugin/admob.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘/data/app-lib/com.mycompany.app-17/libplugin.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘./plugin.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘(null)/plugin.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘/data/app-lib/com.mycompany.app-17/libplugin.admob.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘./plugin.admob.so’

01-11 01:13:14.796: I/Corona(32657): no file ‘(null)/plugin.admob.so’

01-11 01:13:14.796: I/Corona(32657): stack traceback:

01-11 01:13:14.796: I/Corona(32657): [C]: in function ‘require’

01-11 01:13:14.796: I/Corona(32657): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-11.2/release/release/platform/resources/init.lua:906: in function ‘require’

01-11 01:13:14.796: I/Corona(32657): ?: in main chunk

01-11 01:13:14.801: I/Corona(32657): ERROR: Runtime error

01-11 01:13:14.801: I/Corona(32657): /Users/jenkins/slaveroot/workspace/Enterprise/OS/ios-11.2/release/release/platform/resources/init.lua:906: module ‘plugin.admob’ not found:resource (plugin.admob.lu) does not exist in archive

Hi junhyuncho,

Have you included needed plugins to your build.settings?

There is a short blog post about how you can use plugins natively on android: https://coronalabs.com/blog/2017/10/19/using-plugins-with-native-android-builds/

Hi,

Can you show your project structure with libs folder expanded? This error indicates that Android Studio didn’t find plugin.admob.jar lib in the libs folder.

If you located it correctly you still have to add [lua]compile ‘com.google.android.gms:play-services-ads:9.6.1’[/lua] entry into your dependencies in build.gradle file. 

Hi junhyuncho,

Have you included needed plugins to your build.settings?

There is a short blog post about how you can use plugins natively on android: https://coronalabs.com/blog/2017/10/19/using-plugins-with-native-android-builds/

Hi,

Can you show your project structure with libs folder expanded? This error indicates that Android Studio didn’t find plugin.admob.jar lib in the libs folder.

If you located it correctly you still have to add [lua]compile ‘com.google.android.gms:play-services-ads:9.6.1’[/lua] entry into your dependencies in build.gradle file.