Closed gberenst closed 4 years ago
I tried exporting your project via the build service and had no issue.
As noted in the comments of #3504 cordova exports in r178 are importing construct-mobile-advert@1.5.1, but it should be using 1.5.2 which corrects some issues.
I've updated the version for the next release, but you should be able to use the newer version by changing the plugin version in the config.xml to 1.5.2 before running cordova prepare.
THank you Iain, I´ve changed to 1.5.2 in the exported config.xml, created a new cordova project, but still same issue when adding android platform. Here´s the log. Any idea?
Using cordova-fetch for cordova-android@7.1.1 Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.paukgames.wordshapes Name: Word_Shapes Activity: MainActivity Android target: android-27 Android project created with cordova-android@7.1.1 Android Studio project detected Android Studio project detected Plugin 'cordova-plugin-inappbrowser' found in config.xml... Migrating it to package.json Plugin 'construct-mobile-advert' found in config.xml... Migrating it to package.json Plugin 'cordova-plugin-whitelist' found in config.xml... Migrating it to package.json Plugin 'construct-plugin-file' found in config.xml... Migrating it to package.json Plugin 'cordova-plugin-fullscreen' found in config.xml... Migrating it to package.json Plugin 'construct-mobile-notchfix' found in config.xml... Migrating it to package.json Discovered saved plugin "cordova-plugin-inappbrowser". Adding it to the project Installing "cordova-plugin-inappbrowser" for android Adding cordova-plugin-inappbrowser to package.json Discovered saved plugin "construct-mobile-advert". Adding it to the project Installing "construct-mobile-advert" for android Subproject Path: CordovaLib Subproject Path: app Adding construct-mobile-advert to package.json Discovered saved plugin "cordova-plugin-whitelist". Adding it to the project Installing "cordova-plugin-whitelist" for android Adding cordova-plugin-whitelist to package.json Discovered saved plugin "construct-plugin-file". Adding it to the project Installing "construct-plugin-file" for android
The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.
If this is a new application no changes are required.
If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:
"<preference name="AndroidPersistentFileLocation"
value="Compatibility" />"
to config.xml in order for the application to find previously stored files.
Adding construct-plugin-file to package.json Discovered saved plugin "cordova-plugin-fullscreen". Adding it to the project Installing "cordova-plugin-fullscreen" for android Adding cordova-plugin-fullscreen to package.json Discovered saved plugin "construct-mobile-notchfix". Adding it to the project Installing "construct-mobile-notchfix" for android Adding construct-mobile-notchfix to package.json ENOENT: no such file or directory, open 'C:\cordova\ws2\platforms\android\gradle.properties'
El lun., 9 dic. 2019 a las 9:46, Iain Shorter (notifications@github.com) escribió:
I tried exporting your project via the build service and had no issue.
As noted in the comments of #3504 https://github.com/Scirra/Construct-3-bugs/issues/3504 cordova exports in r178 are importing construct-mobile-advert@1.5.1, but it should be using 1.5.2 which corrects some issues.
I've updated the version for the next release, but you should be able to use the newer version by changing the plugin version in the config.xml to 1.5.2 before running cordova prepare.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Scirra/Construct-3-bugs/issues/3531?email_source=notifications&email_token=ALVG3GMNLVPSG44AMC64HVLQXY4YTA5CNFSM4JXOEIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGJBORY#issuecomment-563222343, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVG3GPOYI2K6WNM6OVHMALQXY4YTANCNFSM4JXOEIBQ .
Just to add info, here´s the plugin list of the projects:
C:\cordova\ws2>cordova plugin list construct-mobile-advert 1.5.2 "ConstructAd" construct-mobile-notchfix 1.0.2 "NotchPatch" construct-plugin-file 1.0.0 "File" cordova-plugin-fullscreen 1.1.0 "cordova-plugin-fullscreen" cordova-plugin-inappbrowser 3.1.0 "InAppBrowser" cordova-plugin-whitelist 1.3.4 "Whitelist"
C:\cordova\ws2>cordova prepare Android Studio project detected ENOENT: no such file or directory, open 'C:\cordova\ws2\platforms\android\gradle.properties'
El lun., 9 dic. 2019 a las 9:46, Iain Shorter (notifications@github.com) escribió:
I tried exporting your project via the build service and had no issue.
As noted in the comments of #3504 https://github.com/Scirra/Construct-3-bugs/issues/3504 cordova exports in r178 are importing construct-mobile-advert@1.5.1, but it should be using 1.5.2 which corrects some issues.
I've updated the version for the next release, but you should be able to use the newer version by changing the plugin version in the config.xml to 1.5.2 before running cordova prepare.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Scirra/Construct-3-bugs/issues/3531?email_source=notifications&email_token=ALVG3GMNLVPSG44AMC64HVLQXY4YTA5CNFSM4JXOEIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGJBORY#issuecomment-563222343, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVG3GPOYI2K6WNM6OVHMALQXY4YTANCNFSM4JXOEIBQ .
Tried here and had no issues I'm afraid. Perhaps try running cordova --verbose prepare
? I'm using the same version of cordova CLI as you, but mine is resolving to cordova-android@8.1.0, so I'm thinking it's down to the version variation.
Sorry Iain, I´ve downgraded cordova to 8.1.0, error persist. Also when building on phonegap we get the following error which is not shown when removing that plugin:
Fetching plugin "cordova-plugin-inappbrowser" via npm Installing "cordova-plugin-inappbrowser" at "3.1.0" for android Fetching plugin "construct-mobile-advert@1.5.2" via npm Installing "construct-mobile-advert" at "1.5.2" for android Subproject Path: CordovaLib Subproject Path: app Fetching plugin "cordova-plugin-androidx-socialsharing@1.0.0" via npm Installing "cordova-plugin-androidx-socialsharing" at "1.0.0" for android Fetching plugin "es6-promise-plugin@^4.1.0" via npm Installing "es6-promise-plugin" at "4.2.2" for android Subproject Path: CordovaLib Subproject Path: app Fetching plugin "construct-mobile-rate@0.4.0" via npm Installing "construct-mobile-rate" at "0.4.0" for android Fetching plugin "cordova-plugin-whitelist" via npm Installing "cordova-plugin-whitelist" at "1.3.4" for android Fetching plugin "construct-plugin-file" via npm Installing "construct-plugin-file" at "1.0.0" for android
The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.
If this is a new application no changes are required.
If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:
"<preference name="AndroidPersistentFileLocation"
value="Compatibility" />"
to config.xml in order for the application to find previously stored files. Fetching plugin "cordova-plugin-fullscreen" via npm Installing "cordova-plugin-fullscreen" at "1.1.0" for android Fetching plugin "construct-mobile-notchfix" via npm Installing "construct-mobile-notchfix" at "1.0.2" for android
Studio Gradle projects
Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=undefined (recommended setting) :wrapper
BUILD SUCCESSFUL in 0s 1 actionable task: 1 executed Subproject Path: CordovaLib Subproject Path: app To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.10.3/userguide/gradle_daemon.html. Daemon will be stopped at the end of the build stopping after processing
Configure project :app Exception while marshalling /opt/android-sdk/build-tools/26.0.3/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/build-tools/28.0.3/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/extras/google/instantapps/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/platform-tools/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/platforms/android-28/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/platforms/android-29/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/build-tools/26.0.3/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/build-tools/28.0.3/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/extras/google/instantapps/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/platform-tools/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/platforms/android-28/package.xml. Probably the SDK is read-only Exception while marshalling /opt/android-sdk/platforms/android-29/package.xml. Probably the SDK is read-only
Task :app:preBuild UP-TO-DATE Task :CordovaLib:preBuild UP-TO-DATE Task :CordovaLib:preReleaseBuild UP-TO-DATE Task :CordovaLib:checkReleaseManifest Task :CordovaLib:processReleaseManifest Task :app:preReleaseBuild Task :CordovaLib:compileReleaseAidl NO-SOURCE Task :app:compileReleaseAidl NO-SOURCE Task :CordovaLib:packageReleaseRenderscript NO-SOURCE Task :app:compileReleaseRenderscript Task :app:checkReleaseManifest Task :app:generateReleaseBuildConfig Task :app:prepareLintJar Task :app:generateReleaseSources Task :CordovaLib:compileReleaseRenderscript Task :CordovaLib:generateReleaseBuildConfig Task :CordovaLib:generateReleaseResValues Task :CordovaLib:generateReleaseResources Task :CordovaLib:packageReleaseResources Task :CordovaLib:generateReleaseRFile Task :CordovaLib:prepareLintJar Task :CordovaLib:generateReleaseSources Task :CordovaLib:javaPreCompileRelease
Task :CordovaLib:compileReleaseJavaWithJavac Note: /var/gimlet/tmp/47052611752920/383294/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
Task :CordovaLib:processReleaseJavaRes NO-SOURCE Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease Task :app:javaPreCompileRelease Task :app:mainApkListPersistenceRelease Task :app:generateReleaseResValues Task :app:generateReleaseResources Task :app:mergeReleaseResources Task :app:createReleaseCompatibleScreenManifests Task :app:processReleaseManifest Task :app:processReleaseResources
Task :app:compileReleaseJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
Task :app:compileReleaseNdk NO-SOURCE Task :app:compileReleaseSources Task :app:lintVitalRelease Task :app:mergeReleaseShaders Task :app:compileReleaseShaders Task :app:generateReleaseAssets Task :CordovaLib:mergeReleaseShaders Task :CordovaLib:compileReleaseShaders Task :CordovaLib:generateReleaseAssets Task :CordovaLib:packageReleaseAssets Task :app:mergeReleaseAssets Task :app:validateSigningRelease Task :app:signingConfigWriterRelease /.gradle/caches/transforms-1/files-1.1/play-services-ads-18.3.0.aar/239c3ddd3b48e8f3060af119824e88da/jars/classes.jar: D8: Type
sun.misc.Unsafe
was not found, it is required for default or static interface methods desugaring ofvoid com.google.android.gms.internal.ads.zzdfs$zzi.<clinit>()
/.gradle/caches/transforms-1/files-1.1/play-services-ads-lite-18.3.0.aar/1ff19c36af500543fa534bd88aafc2f6/jars/classes.jar: D8: Typelibcore.io.Memory
was not found, it is required for default or static interface methods desugaring ofvoid com.google.android.gms.internal.ads.zzduy$zza.zza(long, byte)
/.gradle/caches/transforms-1/files-1.1/play-services-ads-lite-18.3.0.aar/1ff19c36af500543fa534bd88aafc2f6/jars/classes.jar: D8: Typelibcore.io.Memory
was not found, it is required for default or static interface methods desugaring ofvoid com.google.android.gms.internal.ads.zzduy$zzb.zza(long, byte)
Task :app:transformClassesWithDexBuilderForReleaseTask :app:transformDexArchiveWithExternalLibsDexMergerForRelease FAILED 35 actionable tasks: 35 executed D8: Program type already present: android.support.v4.app.INotificationSideChannel
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForRelease'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.v4.app.INotificationSideChannel
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 31s Error: /var/gimlet/tmp/47052611752920/383294/gradlew: Command failed with exit code 1 Error output: Note: /var/gimlet/tmp/47052611752920/383294/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. D8: Program type already present: android.support.v4.app.INotificationSideChannel
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForRelease'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.v4.app.INotificationSideChannel
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 31s at ChildProcess.whenDone (/var/gimlet/tmp/47052611752920/383294/cordova/node_modules/cordova-common/src/superspawn.js:135:23) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:915:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
El lun., 9 dic. 2019 a las 11:36, Iain Shorter (notifications@github.com) escribió:
Tried here and had no issues I'm afraid. Perhaps try running cordova --verbose prepare ? I'm using the same version of cordova CLI as you, but mine is resolving to cordova-android@8.1.0, so I'm thinking it's down to the version variation.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Scirra/Construct-3-bugs/issues/3531?email_source=notifications&email_token=ALVG3GPI24ZKDMH3DUV4N3DQXZJVBA5CNFSM4JXOEIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGJMHZQ#issuecomment-563266534, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVG3GK5J5GFHUJ42SCS7T3QXZJVBANCNFSM4JXOEIBQ .
Ah that's on Phonegap Build? As far as I'm aware there are no ways to solve Android-X support on PGB. I would suggest using a local version of Cordova, or the build server. As those are the platforms we officially target.
Ok i'll check that out, and what do you think about the phonegap error?
El mar., 10 dic. 2019 2:46 p. m., Iain Shorter notifications@github.com escribió:
Sounds like you have a permission issue with the directory your Android SDK is in. There's an awful lot of "Probably the SDK is read-only" errors in there.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Scirra/Construct-3-bugs/issues/3531?email_source=notifications&email_token=ALVG3GJFG7LOATRNJ25XYULQX7IYLA5CNFSM4JXOEIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGQECGQ#issuecomment-564150554, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVG3GPO5WDWYDI4YTJOB6DQX7IYLANCNFSM4JXOEIBQ .
So "Android X" is a replacement for the "Android support" library, which is used by lots of things.
If your not aware Phonegap is just a wrapper around Cordova, as is our own build service.
Cordova doesn't enable Android X support by default, and requires a script to enable it. Phonegap doesn't allow you to run scripts. The build service allows scripts, but they must pass a security review first.
The reason cordova doesn't enable Android X at the moment is that if you include Android support AND Android X in the same project it cannot compile. Because you end up with duplicates which cannot be resolved. Which is the error you saw:
Program type already present: android.support.v4.app.INotificationSideChannel
Current versions of the Google Services libraries ( such as Admob and Google Play Games ) already use Android X. Our plugins "Mobile Advert" and "Play Games" use these. So for all our plugins to work together, all of the plugins we have that used Android Support now have to use Android X. This has the side effect that none of those plugins now work on PhoneGap build.
This issue can only be resolved by cordova coming up with a fix at the tooling level, but they haven't talked about yet.
If I remember correctly the affected plugins are:
@gberenst can you confirm what issues you are having on the build service? I had no trouble building your project.
Ok thank you for the explanation, it all make sense now (except for mi local cordova CLI ENOENT error), when updating to r178 it builds fine at your scirra service. We'll have to define which way to build ios file as yours is good but much more steps than phonegap. May be using old plugins and javascript code inside c3p until cordova fixes the android x issue. Thanks for your support!
El mié., 11 dic. 2019 10:31 a. m., Iain Shorter notifications@github.com escribió:
@gberenst https://github.com/gberenst can you confirm what issues you are having on the build service? I had no trouble building your project.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Scirra/Construct-3-bugs/issues/3531?email_source=notifications&email_token=ALVG3GMOSCOMHB7FITLSZJTQYDTR5A5CNFSM4JXOEIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGTDH6A#issuecomment-564540408, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVG3GL5K4UJ37BX75ACRTDQYDTR5ANCNFSM4JXOEIBQ .
You should be able to use a local copy of Cordova as well, provided it's up to date.
Yes the additional steps are frustrating, but due to Apple restrictions it's impractical to set up the build server to generate IPA files. Out of interest what do you use to publish iOS applications after you have built the IPA file via PhoneGap build? As far as I'm aware you need a mac to publish an IPA to the app store, and xcode is capable of publishing a project after building the IPA.
First I make certificates in Apple developer http://docs.phonegap.com/phonegap-build/signing/ios/
These I use in PGB for the ipa
Setup the App in Appstore in ITunes Connect.. Info, description, icons,ect.
Use Xcode > Application loader on my mac for uploading the ipa
Back to Itunes Connect prepare for Submission
I am trying now to use old cocoon ads plugin (1.0.12 for android and 1.0.8 for ios) with scripting in C3 as an alternative to keep using phonegap.
El mié., 11 dic. 2019 10:42 a. m., Iain Shorter notifications@github.com escribió:
You should be able to use a local copy of Cordova as well, provided it's up to date.
Yes the additional steps are frustrating, but due to Apple restrictions it's impractical to set up the build server to generate IPA files. Out of interest what do you use to publish iOS applications after you have built the IPA file via PhoneGap build? As far as I'm aware you need a mac to publish an IPA to the app store, and xcode is capable of publishing a project after building the IPA.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Scirra/Construct-3-bugs/issues/3531?email_source=notifications&email_token=ALVG3GJKCTOREDXMSPD5KZLQYDU3RA5CNFSM4JXOEIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGTETVA#issuecomment-564546004, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVG3GN5RZ54ICZMFYSPZFLQYDU3RANCNFSM4JXOEIBQ .
Ah okay so you are using Application Loader then. I've been keeping an eye out for a good method that users without a Mac can upload to the store. But as far as I'm aware it's not possible.
Thanks for telling me about your dev process.
Okay if we're basically labelling this issue as Phonegap Build then I will mark this as external and close it.
You may have some luck with a 3rd party advert addons for C3, several exist. If you need help with scripting then post on the C3 scripting forum, sure someone will be able to help.
Problem description
We have always built our project without any issues. Now added the MobileAdvert plugin and fails building in both Cordova CLI and PhoneGap. Also fails in C3 cloud build service. If we remove plugin it builds fine.
Attach a .c3p
https://drive.google.com/open?id=1aRtv_uP2q1mHFeUFvZbByEIjAKVDnqcS
Steps to reproduce
For example, in cordova CLI
Observed result
It fails, log says: Android Studio project detected ENOENT: no such file or directory, open 'C:\cordova\PROJECT_NAME\platforms\android\gradle.properties'
Expected result
Succesful APK build
More details
Built with android 7.1.1 in Cordova CLI. However it takes latest android in PhoneGap Build and fails too. Cordova Version; 9.0.0 (cordova-lib@9.0.1) Cordova plugin version: construct-mobile-advert 1.5.1 "ConstructAd"