AppLovin / AppLovin-MAX-SDK-Android

Other
210 stars 95 forks source link

AppLovinAdContentRating & AppLovinGender: import fails #645

Closed Pimeko closed 2 months ago

Pimeko commented 2 months ago

MAX SDK Version

12.4.0

Device/Platform Info

Android Studio Iguana | 2023.2.1 Patch 1

Current Behavior

With Capacitor, I'm trying to build a mobile app but I get these errors in Android Studio:

myProject\android\capacitor-cordova-android-plugins\src\main\java\com\applovin\cordova\AppLovinMAX.java:29:
error: cannot find symbol
import com.applovin.sdk.AppLovinAdContentRating;
                       ^
  symbol:   class AppLovinAdContentRating
  location: package com.applovin.sdk
myProject\android\capacitor-cordova-android-plugins\src\main\java\com\applovin\cordova\AppLovinMAX.java:30:
error: cannot find symbol
import com.applovin.sdk.AppLovinAdContentRating;
                       ^
  symbol:   class AppLovinGender
  location: package com.applovin.sdk

The lines in question are:

import com.applovin.sdk.AppLovinAdContentRating;
import com.applovin.sdk.AppLovinGender;

I could build the app without any issue for the past 6 months up until last week, even though I didn't change anything on my end. Any help is appreciated 🙏

Expected Behavior

Be able to build and run the application on Android.

How to Reproduce

package.json

  "dependencies": {
    "@awesome-cordova-plugins/applovin": "^6.3.0",
    "@capacitor/android": "^5.0.3",
    "@capacitor/app": "^5.0.2",
    "@capacitor/core": "^5.0.3",
    "@capacitor/haptics": "^5.0.4",
    "cordova-plugin-applovin-max": "^1.1.4"

build.gradle

dependencies {
    implementation 'com.applovin:applovin-sdk:+'

Then run:

npm run build
npx cap sync
npx cap open

Output:

√ Copying web assets from dist to android\app\src\main\assets\public in 551.84ms
√ Creating capacitor.config.json in android\app\src\main\assets in 1.94ms
[info] Found 3 Cordova plugins for android:
       cordova-annotated-plugin-android@1.0.4
       cordova-plugin-applovin-max@1.1.4
       cordova-plugin-purchases@4.9.0
√ copy android in 640.63ms
√ Updating Android plugins in 7.56ms
[info] Found 4 Capacitor plugins for android:
       @capacitor/app@5.0.7
       @capacitor/haptics@5.0.7
       @capacitor/local-notifications@5.0.7
       @capacitor/splash-screen@5.0.7
\ update android [info] Found 3 Cordova plugins for android:
       cordova-annotated-plugin-android@1.0.4
       cordova-plugin-applovin-max@1.1.4
       cordova-plugin-purchases@4.9.0
√ update android in 115.31ms
[info] Sync finished in 0.761s
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
[info] Opening Android project at: android.

Then in Android Studio, click on "app" in the left hierarchy and try to generate an APK.

image

Additional Info

No response

thomasmso commented 2 months ago

Hey @Pimeko - Thanks for reporting this issue. This is due to Cordova plugin automatically pulling in our latest iOS/Android native SDKs.

We'll have a fix out sometime today. In the meantime, we can use https://github.com/AppLovin/AppLovin-MAX-Cordova/issues/51 as the tracker.