mgks / Android-SmartWebView

A simple use webview integrated w/ native features to help create most advanced hybrid applications.
https://mgks.dev/smart-webview
MIT License
561 stars 278 forks source link

Getting build error in Android Studio #268

Closed ThemeMetro closed 1 year ago

ThemeMetro commented 1 year ago

I am getting below error when trying to build the app. tried clean and rebuild lots of time.

Cannot resolve symbol 'APPLICATION_ID' Cannot resolve symbol 'VERSION_CODE'

in MainActivity.java

//Getting device basic information
public void get_info(){
    if(true_online) {
        fcm_token();
        set_cookie("DEVICE=android");
        DeviceDetails dv = new DeviceDetails();
        set_cookie("DEVICE_INFO=" + dv.pull());
        set_cookie("DEV_API=" + Build.VERSION.SDK_INT);
        set_cookie("APP_ID=" + BuildConfig.APPLICATION_ID);
        set_cookie("APP_VER=" + BuildConfig.VERSION_CODE + "/" + BuildConfig.VERSION_NAME);
    }
}
mgks commented 1 year ago

you should replace both those lines with

set_cookie("APP_ID=" + BuildConfig.LIBRARY_PACKAGE_NAME);
set_cookie("APP_VER=" + BuildConfig.BUILD_TYPE + "/" + BuildConfig.VERSION_NAME);

this problem is already resolved in beta branch. you can give that a try, it has other changes too.

ThemeMetro commented 1 year ago

you should replace both those lines with

set_cookie("APP_ID=" + BuildConfig.LIBRARY_PACKAGE_NAME);
set_cookie("APP_VER=" + BuildConfig.BUILD_TYPE + "/" + BuildConfig.VERSION_NAME);

this problem is already resolved in beta branch. you can give that a try, it has other changes too.

Thank you very much :)