Mr Tony
Mr Tony

Reputation: 19

Import Unity Ads module to Android Studio

I had a problem while trying to import Unity ads to my Android Studio project. I found many answers from forum about adding module unity-ads.aar file to android studio. Android studio window doesn't allow me click finish button to add this file to project.

I enclose the picture showing that android studio doesn't recognize that file. enter image description here

Upvotes: 0

Views: 1036

Answers (1)

lazydevpro
lazydevpro

Reputation: 127

Actually, in its recent update, Android Studio has removed the option to import modules .arr file. Now you need to manually import it. Just follow the steps below to add .arr file to your project. Step 1: switch your app to project mode

enter image description here

Step 2: Create a new directory and name it libs

enter image description here enter image description here

Step 3: Now manually open that directory location in your file explorer and paste unit-ads.arr

enter image description here

Now go to your app-level Gradle and add the module as a dependency

    implementation files('../libs/unity-ads.aar')

enter image description here

Also do add .arr in the file tree

    implementation fileTree(dir: 'libs', include: ['*.jar', '*.arr'])

Now sync the project, and you should be able to use a new module inside your code. Don't know why Android Studio removed this option and why unity hasn't switched to mavenCentral() or any easier solution. But for now, this method works for me.

Upvotes: 1

Related Questions