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

error: cannot find symbol import com.applovin.sdk.AppLovinAdContentRating #51

Closed
UzverNumber47 opened this issue Apr 2, 2024 · 17 comments
Labels
bug Something isn't working stale This isue has been inactive

Comments

@UzverNumber47
Copy link

MAX Plugin Version

1.1.4

Cordova Version

12.0.1

Device/Platform Info

Android 12

Current Behavior

error: cannot find symbol import com.applovin.sdk.AppLovinAdContentRating

Expected Behavior

Should compile

How to Reproduce

Simply add a plugin
cordova plugin add cordova-plugin-applovin-max

Additional Info

This is probably somehow connected with the latest release of applovin

Could please suggest a quick workaround?

@UzverNumber47 UzverNumber47 added the bug Something isn't working label Apr 2, 2024
@UzverNumber47
Copy link
Author

error: cannot find symbol com.applovin.sdk.AppLovinGender
Is also affected.

However other sdk imports below are fine

import com.applovin.sdk.AppLovinMediationProvider; import com.applovin.sdk.AppLovinPrivacySettings; import com.applovin.sdk.AppLovinSdk; import com.applovin.sdk.AppLovinSdkConfiguration; import com.applovin.sdk.AppLovinSdkSettings; import com.applovin.sdk.AppLovinSdkUtils;

@UzverNumber47
Copy link
Author

Yes, the new Android SDK release is the issue.

The quick workaround will be replacing
com.applovin:applovin-sdk:+
with
com.applovin:applovin-sdk:12.3.1

@thomasmso
Copy link
Member

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.

EMI-INDO added a commit to EMI-INDO/AppLovin-MAX-Cordova that referenced this issue Apr 3, 2024
Add example variable
cordova plugin add cordova-plugin-applovin-max --save --variable SDK_VERSION=12.3.1

fix AppLovin#51
@EMI-INDO
Copy link

EMI-INDO commented Apr 3, 2024

@thomasmso

I sent a pull request
I hope you also update the plugin version in npm

Thank you sir

@thomasmso
Copy link
Member

@EMI-INDO - Thanks for the PR, other priorities took precedence, I will check this out tomorrow.

@thomasmso
Copy link
Member

@EMI-INDO
Copy link

EMI-INDO commented Apr 4, 2024

Yes in the near future I will update the Android and iOS code which will work on the latest SDK.

@vb111
Copy link

vb111 commented Nov 1, 2024

Problem up again , it somehow connected to [13.0.1] SDK release? How Build now?

@thomasmso
Copy link
Member

The latest version of our Cordova Plugin depends on v12.3.1 native SDKs (https://github.com/AppLovin/AppLovin-MAX-Cordova/releases). Thus, you need to ensure that your Podfiles and build.gradle files hardcode to version 12.3.1.

You can see that is what we did in our plugin.xml file:

https://github.com/AppLovin/AppLovin-MAX-Cordova/blob/master/plugin/plugin.xml#L26

@kreso22
Copy link

kreso22 commented Nov 20, 2024

Did something potentially change recently?
I am seeing this problem arise even though previously I have had the 12.3.1 work (inside 1.1.5).

iOS build works fine. Android build fails.

This is the output log:

> Task :app:compileDebugJavaWithJavac
/cordova/platforms/android/app/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
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:30: error: cannot find symbol
import com.applovin.sdk.AppLovinGender;
                       ^
  symbol:   class AppLovinGender
  location: package com.applovin.sdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1377: error: cannot find symbol
    private static AppLovinGender integerToALGender(final Integer gender)
                   ^
  symbol:   class AppLovinGender
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1397: error: cannot find symbol
    private static AppLovinAdContentRating integerToALAdContentRating(final Integer maximumAdContentRating)
                   ^
  symbol:   class AppLovinAdContentRating
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:178: error: cannot find symbol
            sdk.getTargetingData().setYearOfBirth( yearOfBirthToSet );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:184: error: cannot find symbol
            sdk.getTargetingData().setGender( integerToALGender( genderToSet ) );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:190: error: cannot find symbol
            sdk.getTargetingData().setMaximumAdContentRating( integerToALAdContentRating( maximumAdContentRatingToSet ) );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:196: error: cannot find symbol
            sdk.getTargetingData().setEmail( emailToSet );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:202: error: cannot find symbol
            sdk.getTargetingData().setPhoneNumber( phoneNumberToSet );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:208: error: cannot find symbol
            sdk.getTargetingData().setKeywords( keywordsToSet );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:214: error: cannot find symbol
            sdk.getTargetingData().setInterests( interestsToSet );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:247: error: cannot find symbol
        message.put( "isAgeRestrictedUser", AppLovinPrivacySettings.isAgeRestrictedUser( context ) );
                                                                   ^
  symbol:   method isAgeRestrictedUser(Context)
  location: class AppLovinPrivacySettings
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:302: error: cannot find symbol
        AppLovinPrivacySettings.setIsAgeRestrictedUser( isAgeRestrictedUser, getCurrentActivity() );
                               ^
  symbol:   method setIsAgeRestrictedUser(boolean,Activity)
  location: class AppLovinPrivacySettings
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:308: error: cannot find symbol
        PluginResult result = new PluginResult( OK, AppLovinPrivacySettings.isAgeRestrictedUser( getCurrentActivity() ) );
                                                                           ^
  symbol:   method isAgeRestrictedUser(Activity)
  location: class AppLovinPrivacySettings
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:388: error: cannot find symbol
            sdk.getTargetingData().setYearOfBirth( yearOfBirth );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:433: error: cannot find symbol
            sdk.getTargetingData().setEmail( email );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:448: error: cannot find symbol
            sdk.getTargetingData().setPhoneNumber( phoneNumber );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:463: error: cannot find symbol
            sdk.getTargetingData().setKeywords( keywords );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:478: error: cannot find symbol
            sdk.getTargetingData().setInterests( interests );
               ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:497: error: cannot find symbol
        sdk.getTargetingData().clearAll();
           ^
  symbol:   method getTargetingData()
  location: variable sdk of type AppLovinSdk
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:842: error: method does not override or implement a method from a supertype
    @Override
    ^
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:848: error: method does not override or implement a method from a supertype
    @Override
    ^
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1381: error: cannot find symbol
            return AppLovinGender.FEMALE;
                   ^
  symbol:   variable AppLovinGender
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1385: error: cannot find symbol
            return AppLovinGender.MALE;
                   ^
  symbol:   variable AppLovinGender
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1389: error: cannot find symbol
            return AppLovinGender.OTHER;
                   ^
  symbol:   variable AppLovinGender
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1393: error: cannot find symbol
            return AppLovinGender.UNKNOWN;
                   ^
  symbol:   variable AppLovinGender
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1401: error: cannot find symbol
            return AppLovinAdContentRating.ALL_AUDIENCES;
                   ^
  symbol:   variable AppLovinAdContentRating
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1405: error: cannot find symbol
            return AppLovinAdContentRating.EVERYONE_OVER_TWELVE;
                   ^
  symbol:   variable AppLovinAdContentRating
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1409: error: cannot find symbol
            return AppLovinAdContentRating.MATURE_AUDIENCES;
                   ^
  symbol:   variable AppLovinAdContentRating
  location: class AppLovinMAX
/cordova/platforms/android/app/src/main/java/com/applovin/cordova/AppLovinMAX.java:1413: error: cannot find symbol
            return AppLovinAdContentRating.NONE;
                   ^
  symbol:   variable AppLovinAdContentRating
  location: class AppLovinMAX
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
30 errors

> Task :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

@thomasmso
Copy link
Member

@kreso22 - looks like you are bundling the latest version of our Android SDK v13.0.0 which do not have those APIs anymore. Our latest Cordova plugin supports up to native Android and iOS SDKs v12.3.1: https://github.com/AppLovin/AppLovin-MAX-Cordova/releases.

@kreso22
Copy link

kreso22 commented Nov 20, 2024

@kreso22 - looks like you are bundling the latest version of our Android SDK v13.0.0 which do not have those APIs anymore. Our latest Cordova plugin supports up to native Android and iOS SDKs v12.3.1: https://github.com/AppLovin/AppLovin-MAX-Cordova/releases.

I'm not trying to 'do' anything. I am using latest 1.1.5 (with 12.3.1), and have been using it. iOS works.

I can't trace where the problem is coming from.

I run tools/gradlew :app:dependencies --configuration implementation the only potential clue I can see is that automatic version is being used by google-adapter and unityads-adapter
Should I maybe change those to some specific older version?

dependencies {
    implementation 'com.applovin:applovin-sdk:12.3.1'
    implementation 'com.applovin.mediation:google-adapter:+'
    implementation 'com.applovin.mediation:unityads-adapter:+'
}

@thomasmso
Copy link
Member

For Google, can you hardcode to version 23.3.0.0, and for UnityAds can you hardcode to 4.12.2.0?

@kreso22
Copy link

kreso22 commented Nov 21, 2024

For Google, can you hardcode to version 23.3.0.0, and for UnityAds can you hardcode to 4.12.2.0?

Yes! That worked.
Thanks a bunch for your help!

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale This isue has been inactive label Dec 21, 2024
Copy link

This issue was closed because it has been inactive for 5 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2024
@MonuCarpenter
Copy link

but if we use 12.3.1 then the facebook and inmobi adapters dont work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale This isue has been inactive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants