0
votes

Hello i'm trying for 3 days now to solve this problem but i can't so if anyone can help me to solve it. after installing admob-free plugin i get this error while building my apk :

Dex: Error converting bytecode to dex: Cause: PARSE ERROR: class name (com/google/android/gms/base/R) does not match path (Com/google/android/gms/base/R.class) ...while parsing Com/google/android/gms/base/R.class

so if anyone can help me this is my setting :

this is my project info :

: 1.19.1 ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages: @ionic/app-scripts : 3.1.8

Cordova Platforms : android 6.4.0

Ionic Framework : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v6.11.4
npm               : 3.10.10
OS                : Windows 10
2

2 Answers

0
votes

Try with the latest version of the plugin (v0.15.0).

Error itself shows the solution. There is (com/google/android/gms/base/R) and (Com/google/android/gms/base/R.class) . Try fixing the case issue. It should work then as expected.

If it do not work, you can try this dirty fix.

--> copying following 3 folders to platforms/android/app/src/main/java/name/ratson/cordova/admob/

platforms/android/src/name/ratson/cordova/admob/banner platforms/android/src/name/ratson/cordova/admob/interstitial platforms/android/src/name/ratson/cordova/admob/rewardvideo

it's dirty fix, but for now you can build your app. ;)

0
votes

Try Updating Ionic version by running the command npm i -g ionic.

also, try to update your node version by installing the latest version from here