Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdColony with Mediation integration causes only debug build to fail #52800

Closed
angel1st opened this issue Mar 18, 2020 · 11 comments
Closed

AdColony with Mediation integration causes only debug build to fail #52800

angel1st opened this issue Mar 18, 2020 · 11 comments

Comments

@angel1st
Copy link

Hi there,
I would like to integrate AdColony with Mediation. I followed Google Integration Guide.
This what I have added to app/build.gradle to have it done:

repositories {
    maven {
        url  "https://adcolony.bintray.com/AdColony"
    }
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.1.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.firebase:firebase-core:17.2.3'
    implementation 'com.google.ads.mediation:adcolony:4.1.3.1'
    implementation 'com.google.ads.mediation:facebook:5.7.0.0'
}

I have no issue to compile and install a release build to device (via flutter build apk --target="lib/config/main_production.dart" --flavor=production --split-per-abi command)

However, when I decide to run on emulator via flutter run -v --target="lib/config/main_production.dart" --flavor=production, I have an error.
Here is the output:

[ +97 ms] > Task :app:mergeDexProductionDebug
[+1199 ms] > Task :app:packageProductionDebug FAILED
[ +1 ms] 189 actionable tasks: 188 executed, 1 up-to-date
[ ] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':app:packageProductionDebug'.
[ ] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[ ] > Entry name 'AndroidManifest.xml' collided
[ ] * 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 21s
[ +385 ms] Running Gradle task 'assembleProductionDebug'... (completed in 22.4s)
[ +3 ms] "flutter run" took 23,071ms.
Gradle task assembleProductionDebug failed with exit code 1

#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 buildGradleApp (package:flutter_tools/src/android/gradle.dart:387:7)
#2 _asyncThenWrapperHelper. (dart:async-patch/async_patch.dart:73:64)
#3 _rootRunUnary (dart:async/zone.dart:1134:38)
#4 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:524:5)
#9 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#10 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#11 _DefaultProcessUtils.stream (package:flutter_tools/src/base/process.dart)
#12 _asyncThenWrapperHelper. (dart:async-patch/async_patch.dart:73:64)
#13 _rootRunUnary (dart:async/zone.dart:1134:38)
#14 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#15 _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#16 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#17 Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#18 Future._completeWithValue (dart:async/future_impl.dart:524:5)
#19 Future._asyncComplete. (dart:async/future_impl.dart:554:7)
#20 _rootRun (dart:async/zone.dart:1126:13)
#21 _CustomZone.run (dart:async/zone.dart:1023:19)
#22 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#23 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:965:23)
#24 _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#25 _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#26 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#27 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)

@TahaTesser
Copy link
Member

Hi @angel1st
This isn't an issue with AdColony
This is more of Android Studio issue
Please take a look at this possible solution
Thank you

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 18, 2020
@angel1st
Copy link
Author

angel1st commented Mar 18, 2020

@TahaTesser - after I executed File > Invalidate Caches/Restart..., now I have:

> [  +28 ms] Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
> [  +13 ms] Launching lib/config/main_production.dart on Android SDK built for x86 in debug mode...
> [   +5 ms] executing: D:\DevTools\Android\Sdk\build-tools\29.0.3\aapt dump xmltree D:\Working\biorhythms\build\app\outputs\apk\app.apk AndroidManifest.xml
> [  +10 ms] Exit code 1 from: D:\DevTools\Android\Sdk\build-tools\29.0.3\aapt dump xmltree D:\Working\biorhythms\build\app\outputs\apk\app.apk AndroidManifest.xml
> [        ] W/ResourceType(17836): Bad XML block: header size 28024 or total size 1702240364 is larger than data size 540
>            ERROR: Resource AndroidManifest.xml is corrupt
> [   +2 ms] Failed to extract manifest from APK: ProcessException: The command failed
>              Command: D:\DevTools\Android\Sdk\build-tools\29.0.3\aapt dump xmltree D:\Working\biorhythms\build\app\outputs\apk\app.apk AndroidManifest.xml.
> [   +5 ms] No application found for TargetPlatform.android_x86.
>            Is your project missing an android\app\src\main\AndroidManifest.xml?
>            Consider running "flutter create ." to create one.
> [   +8 ms] "flutter run" took 473ms.
> 
> #0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
> #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:509:7)
> <asynchronous suspension>
> #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:615:18)
> #3      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
> #4      _rootRunUnary (dart:async/zone.dart:1134:38)
> #5      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
> #6      _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
> #7      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
> #8      Future._propagateToListeners (dart:async/future_impl.dart:709:32)
> #9      Future._completeWithValue (dart:async/future_impl.dart:524:5)
> #10     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
> #11     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
> #12     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
> #13     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
> #14     _rootRunUnary (dart:async/zone.dart:1134:38)
> #15     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
> #16     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
> #17     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
> #18     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
> #19     Future._completeWithValue (dart:async/future_impl.dart:524:5)
> #20     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
> #21     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
> #22     IosProject.isSwift (package:flutter_tools/src/project.dart)
> #23     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
> #24     _rootRunUnary (dart:async/zone.dart:1134:38)
> #25     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
> #26     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
> #27     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
> #28     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
> #29     Future._completeWithValue (dart:async/future_impl.dart:524:5)
> #30     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
> #31     _rootRun (dart:async/zone.dart:1126:13)
> #32     _CustomZone.run (dart:async/zone.dart:1023:19)
> #33     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
> #34     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
> #35     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
> #36     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
> #37     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
> #38     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)
> 

However, my AndroidManifest.xml is present and it does not seem to be broken at all. On the other hand now I cannot start the app in debug mode at all, so basically my entire project has been corrupted. :-(

Note: I have fixed the above by executing flutter clean and then rebuilding the project.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 18, 2020
@TahaTesser
Copy link
Member

TahaTesser commented Mar 18, 2020

Hi @angel1st
Could you please run your app with flutter run --enable-software-rendering?
Thank you

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 18, 2020
@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 18, 2020
@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 18, 2020
@angel1st
Copy link
Author

angel1st commented Mar 18, 2020

Here is the output:


D:\Working\biorhythms>flutter run --target="lib/config/main_production.dart" --flavor=production --enable-software-rendering
Using software rendering with device Android SDK built for x86. You may get better performance with hardware mode by configuring hardware rendering for your device.
Launching lib/config/main_production.dart on Android SDK built for x86 in debug mode...
W/ResourceType(13988): Bad XML block: header size 28024 or total size 1702240364 is larger than data size 540
ERROR: Resource AndroidManifest.xml is corrupt
Failed to extract manifest from APK: ProcessException: The command failed
  Command: D:\DevTools\Android\Sdk\build-tools\29.0.3\aapt dump xmltree D:\Working\biorhythms\build\app\outputs\apk\app.apk AndroidManifest.xml.
No application found for TargetPlatform.android_x86.
Is your project missing an android\app\src\main\AndroidManifest.xml?
Consider running "flutter create ." to create one.

So basically, I am back to square one and I cannot execute flutter run for the project. How can I recover my project?

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 18, 2020
@angel1st
Copy link
Author

Ok, I have fixed the above issue by opening another project, then got back to this one and now, I can execute flutter run.
I also examined more thoroughly the entire project. To sum up:

  1. I have added to app/build.gradle following lines:
repositories {
    jcenter()

    maven {
        url  "https://adcolony.bintray.com/AdColony"
    }
}
....
dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.1.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.firebase:firebase-core:17.2.3'
    implementation 'com.google.ads.mediation:adcolony:4.1.3.1'
}
  1. Then, when I execute flutter run -v --target="lib/config/main_production.dart" --flavor=production --enable-software-rendering, this is the output with the error:

[        ] WARNING: Compatible side by side NDK version was not found. Default is 20.0.5594570.
[        ] Compatible side by side NDK version was not found. Default is 20.0.5594570.
[        ] > Task :app:validateSigningProductionDebug UP-TO-DATE
[ +919 ms] > Task :app:packageProductionDebug FAILED
[   +1 ms] FAILURE: Build failed with an exception.
[   +1 ms] * What went wrong:
[        ] Execution failed for task ':app:packageProductionDebug'.
[        ] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[        ]    > Entry name 'AndroidManifest.xml' collided
[        ] * 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.
[   +1 ms] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 3s
[        ] 189 actionable tasks: 4 executed, 185 up-to-date
[ +361 ms] Running Gradle task 'assembleProductionDebug'... (completed in 3.8s)
[   +5 ms] "flutter run" took 4,399ms.
Gradle task assembleProductionDebug failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      buildGradleApp (package:flutter_tools/src/android/gradle.dart:387:7)
#2      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#3      _rootRunUnary (dart:async/zone.dart:1134:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:524:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#11     _DefaultProcessUtils.stream (package:flutter_tools/src/base/process.dart)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#13     _rootRunUnary (dart:async/zone.dart:1134:38)
#14     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#15     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#16     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#17     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#18     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#19     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
#20     _rootRun (dart:async/zone.dart:1126:13)
#21     _CustomZone.run (dart:async/zone.dart:1023:19)
#22     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#26     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)

In the same time, I can execute flutter build apk --target="lib/config/main_production.dart" --flavor=production --split-per-abi and produce apks, however, ARM64 apk installs and runs fine, while v7 apk cannot be installed on 32 bit device - it says - "error when parsing the package".

@TahaTesser
Copy link
Member

Hi @angel1st
Glad you resolved it. Regarding your last error, please take a look at this comment

given your last message I feel safe to close this issue,
if you disagree please write in the comments and I will reopen it.
Thank you

@angel1st
Copy link
Author

@TahaTesser - I respectfully disagree with closing the issue. In fact, as I mentioned above, I cannot integrate AdColony successfully to moth arm64 and v7 apks. I don't think, the link mentioned by you above will do the trick, since it is related to completely different case - when the arm64 app cannot run on device.
My issue (in case I added implementation 'com.google.ads.mediation:adcolony:4.1.3.1' as dependency in my app/build.gradle file is that v7 apk cannot be read by device and the installation process cannot start at all.
Hence, I would kindly ask you to reopen the issue.

@TahaTesser
Copy link
Member

Hi @angel1st
AdColony isn't related to Flutter itself, we don't provide support for integrating other native libraries

This platform is not meant for assistance on personal code. Please see https://flutter.dev/community for resources and asking questions like this, you may also get some help if you post it on Stack Overflow. Closing, as this isn't an issue with Flutter itself,
if you disagree please write in the comments and I will reopen it
Thank you

@angel1st
Copy link
Author

Never mind - after all, I decided to create a new issue, which seems more logical course of action - #52809

@angel1st
Copy link
Author

@TahaTesser - in essence my inquiry is related to integration of Ad provider in Flutter project via AdMob mediation, hence I believe it is related to Flutter.
Since Google integration instructions are 1) Outdated and 2) Not directly applicable to Flutter, I think you guys should spend some time and at least provide decent guide how we can integrate Ad provider via AdMob mediation.

@lock
Copy link

lock bot commented Apr 2, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants