@Bektur: Thank you!
I tried to implement MultiDex. Succeeded with the implementation, still getting this error:
java.lang.NoClassDefFoundError: com.google.firebase.iid.FirebaseInstanceId
So I guess that the problem is in dependencies. here is the original build.gradle just after plugin.notifications.v2 following Corona Docs:
apply plugin: 'com.android.application' // Application name variables def appName = new XmlSlurper().parse(file('src/main/AndroidManifest.xml')).@package.text() def apkName = appName.toString().split('\\.').last() def platform = "mac" if (System.properties['os.name'].toLowerCase().contains('windows')) { platform = "win" } // Paths used throughout the build process def coronaNativeDir = System.getProperty("user.home") + "/Library/Application Support/Corona/Native" if (platform == "win") { coronaNativeDir = System.getenv("CORONA\_ROOT") } // Check to see if Corona Native has been properly setup def coronaNativeDirObj = new File(coronaNativeDir) if( ! coronaNativeDirObj.exists() ) { throw new GradleException("error: Corona Native has not been setup. Run 'Native/SetupCoronaNative.app' in your Corona install to set it up") } def assetsDir = "$projectDir/src/main/assets" def jniLibsDir = "$projectDir/src/main/jniLibs" def coronaNativeSharedDir = "$coronaNativeDir/Corona/shared" def coronaNativeAndroidLibDir = "$coronaNativeDir/Corona/android/lib/Corona" def coronaNativeMacBinDir = "$coronaNativeDir/Corona/" + platform + "/bin" def execPath = System.getenv("PATH") if (platform == "win") { assetsDir = "$projectDir\\src\\main\\assets" jniLibsDir = "$projectDir\\src\\main\\jniLibs" coronaNativeSharedDir = "$coronaNativeDir\\Corona\\shared" coronaNativeAndroidLibDir = "$coronaNativeDir\\Corona\\android\\lib\\Corona" coronaNativeMacBinDir = "$coronaNativeDir\\Corona\\" + platform + "\\bin" execPath = System.getenv("PATH") + System.getProperty("path.separator") + System.getenv("CORONA\_PATH") } android { compileSdkVersion 25 buildToolsVersion '26.0.2' defaultConfig { applicationId "$appName" minSdkVersion 15 targetSdkVersion 25 versionCode 362 versionName "3.62" } applicationVariants.all { variant -\> variant.outputs.all { output -\> outputFileName = "${variant.name}-${variant.versionName}.apk" } } } task cleanAssets(type: Delete, description: 'remove Corona assets and libcorona.so') { delete "$jniLibsDir/armeabi-v7a/libcorona.so" delete "$assetsDir" doFirst { println "== cleanAssets ==" } doLast { new File("$assetsDir").mkdirs() } } task compileLua(type: Exec, description: 'compile Lua source code') { executable = "$coronaNativeMacBinDir/lua" if (platform == "win") { executable = "$coronaNativeMacBinDir\\lua.exe" } workingDir = "$coronaNativeMacBinDir" def packagePath = "package.path='$coronaNativeSharedDir/bin/?.lua;$coronaNativeSharedDir/bin/?/init.lua;'..package.path" // hmm, Lua does not like '\\' packagePath = packagePath.replace("\\","/") def compileLua = "$coronaNativeSharedDir/bin/Compile.lua" if (platform == "win") { compileLua = "$coronaNativeSharedDir\\bin\\Compile.lua" } args = ['-e', packagePath, "$compileLua", platform, "$coronaNativeDir"] def luacpath = "$coronaNativeMacBinDir/?.so" if (platform == "win") { luacpath = "$coronaNativeMacBinDir\\?.dll" } def coronaAssetsDir = "$rootDir/../Corona" if (platform == "win") { coronaAssetsDir = "$rootDir\\..\\Corona" } environment "PATH", "$execPath" environment "LUA\_CPATH", "$luacpath" environment "TARGET\_PLATFORM", 'android' environment "PROJECT\_DIR", "$rootDir" environment "CORONA\_COPY\_PNG\_PRESERVE", '--preserve' environment "CONFIGURATION", 'release' environment "CORONA\_ASSETS\_DIR", "$coronaAssetsDir" environment "CORONA\_TARGET\_RESOURCES\_DIR", "$assetsDir" environment "CORONA\_TARGET\_EXECUTABLE\_DIR", "$assetsDir" dependsOn 'cleanAssets' doFirst { println '== compileLua ==' } } task copyCoronaResources(type: Copy, description: 'include resources from Corona Native') { from fileTree(dir: "$coronaNativeAndroidLibDir/res", include: '\*\*/\*') into "$projectDir/src/main/res" dependsOn 'compileLua' doFirst { println '== copyCoronaResources ==' } } task copyCoronaNativeLibs(type: Copy, description: 'include precompiled libraries from Corona Native') { from fileTree(dir: "$coronaNativeAndroidLibDir/libs", exclude: '\*\*/corona\_statusbar\_icon\_default.png') into "$jniLibsDir" dependsOn 'copyCoronaResources' doFirst { println '== copyCoronaNativeLibs ==' } } task certifyBuild(type: Exec, description: 'certify libcorona.so with resource.car hash and developerkey.cert') { executable = "$coronaNativeMacBinDir/CoronaBuilder.app/Contents/MacOS/CoronaBuilder" if (platform == "win") { executable = "$coronaNativeMacBinDir/CoronaBuilder.exe" } workingDir = "$coronaNativeMacBinDir" environment "PATH", "$execPath" def developerKey = "$coronaNativeSharedDir/resource/developerkey.cert" def resourceCar = "$assetsDir/resource.car" def libcoronaSo = "$jniLibsDir/armeabi-v7a/libcorona.so" if (platform == "win") { developerKey = "$coronaNativeSharedDir\\resource\\developerkey.cert" resourceCar = "$assetsDir\\resource.car" libcoronaSo = "$jniLibsDir\\armeabi-v7a\\libcorona.so" } args = ['app\_sign', 'sign', developerKey, resourceCar, libcoronaSo, 'little', 'android', "$appName"] dependsOn 'copyCoronaNativeLibs' doFirst { println '== certifyBuild ==' } } tasks.preBuild.dependsOn('certifyBuild') dependencies { compile fileTree(dir: 'libs', include: '\*.jar') compile 'com.android.support:appcompat-v7:25.3.1' compile project(':plugin') }
I have 2 questions:
- Should Android Studio > Preferences > Plugins FireBase Services be ON?
- When I downloaded the plugin, I got plugin.notifications.v2.jar file, that goes to MyApp > android > plugin > libs. I got also metadata.lua. What is that for? Where does it goes? It looks like the part should go to AndroidManifest.xml in the app, the part is already in the build.settings in Corona…
Thank you!