Open piernik opened 6 years ago
I have a similar issue using Android Studio to build my Cordova project. When I install this plugin, I receive this error message in Android: Process 'command 'C:\Program Files\Android\Android Studio\jre\bin\java.exe'' finished with non-zero exit value 1
If I remove this plugin, the build is OK.
I tried with 2 apps and the issue is the same.
(Using Android@7.0.0 or Android@7.1.0 )
I have the same issue. Others reported that it works with android@6.3.0, but in my project this leads to other errors
I can confirm this issue. Tried cleaning, adding removing platforms, and reinstalling all packages and plugins with no luck.
Same issue here with cordova-android@7.1.0
I use cordova-android@7.1.0 and works well.
Add following:
configurations.all { resolutionStrategy { force 'com.android.support:support-v4:27.1.1' } }
to gradle
@ivanov84 > thanks for the tip and information. Could you tell me in what file this config must be inserted? Thanks.
@ivanov84 , I tried adding the config to both platform/build.gradle and platform/app/build.gradle file in the end , however it did not succeed. Removing the plugin resolves the problem. Tried the same on 2 apps on Android 7.0.0
@htsnet @arkoak I used hook with replacing build-extras.gradle file with following code:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.1'
}
}
hook code:
var fs = require('fs');
var android_dir = `platforms/android`;
var gradle_filename = 'build-extras.gradle';
var gradle_file = `scripts/${gradle_filename}`;
if (fs.existsSync(android_dir) && fs.existsSync(gradle_file)) {
fs.createReadStream(gradle_file)
.pipe(fs.createWriteStream(`${android_dir}/${gradle_filename}`));
}
hook in config:
<hook src="scripts/copy_build_extras.js" type="before_build" />
+1 doesnt work with ionic 3
I changed the Gradle Scripts, build.gradle and included/changed all these lines inside dependencies:
compile "com.google.android.gms:play-services-analytics:+"
compile "com.android.support:support-v4:24.1.1+"
compile "com.google.android.gms:play-services-base:+"
compile "com.google.android.gms:play-services-ads:+"
compile "com.google.gms:google-services:+"
compile "com.google.android.gms:play-services-tagmanager:+"
compile "com.android.support:customtabs:23.2.0"
I copied from another app that is working. After that, I could build and it´s running. I am testing just now to confirm that everything is OK.
Don´t ask me why....
I removed android platform, deleted the plugins folder and then ran
ionic cordova prepare
ionic cordova platform add android
after which it ran
I tried all the Solutions from here but the issue still there, App get Crashed on admob.banner.Prepare Method any expert solution?
thanks @htsnet
@htsnet You're my hero! Thank you so much!!
compile "com.google.android.gms:play-services-analytics:+" compile "com.android.support:support-v4:24.1.1+" compile "com.google.android.gms:play-services-base:+" compile "com.google.android.gms:play-services-ads:+" compile "com.google.gms:google-services:+" compile "com.google.android.gms:play-services-tagmanager:+"
investigated it again, a foolproof solution that seems to work every time and with other conflicting libraries is to set all occurances of com.google.** libraries to use version "+". this can b achieved by doing a search replace in android and plugin folders of app
@spyr0s like me nothing works for me but i kept trying i just fix it right now first downgrade from cordova-android@7.1.0 to cordova-android@6.3.0 and then go to \platforms\android\project.properties, replace PLAY_SERVICES_VERSION by “+” only like this :
before :
com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION
com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION
after :
com.google.android.gms:play-services-base:+
com.google.android.gms:play-services-ads:+
thats works for me i hope he does for you too and every one else
Another way: install cordova plugin to create version automatically
cordova plugin add cordova-android-play-services-gradle-release
just removed platform android and added again
ionic cordova platform rm android
ionic cordova platform add android
hey, I tried all the solutions.but nothing works for me. plz help me :-(
hi,
i have the same problem, the above solutiosn didn't work for me. Could anyone solve the error with other steps?
Need to put this somewhere because it's what worked for me @mihawk007 thank you.
I enter in platrfoms/android/project.properties and change this:
cordova.system.library.2=com.google.android.gms:play-services-base:+ cordova.system.library.3=com.google.android.gms:play-services-ads:+
remove the versions and put + and work properly.
I can't build app. I'm using ionic as main framework. How I installed it?
npm install --save @ionic-native/admob-free
v 4.7.0ionic cordova plugin add cordova-plugin-admob-free
v 0.15.0ionic cordova platform remove android
ionic cordova platform add android --save
ionic cordova run android
That error was returned: