Skip to content

No Rating plugin in Android expert after intallation #3

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

Closed
flashag opened this issue Jan 26, 2024 · 19 comments
Closed

No Rating plugin in Android expert after intallation #3

flashag opened this issue Jan 26, 2024 · 19 comments
Labels
bug Something isn't working

Comments

@flashag
Copy link

flashag commented Jan 26, 2024

Godot version

4.1

Plugin version

v1.0.1

Phone information

Xiaomi 9T

Issue description

First thank you for the plugin but I didn't have a chance to test it.

I copied files from zip to your_project/android/plugins but no plugin appeared. Although iOS plugin showed up.

Should I copy something else?

Steps to reproduce

  1. follow instruction
  2. install android plugin
  3. no plugin in android preset

Additional context

No response

@flashag flashag added the bug Something isn't working label Jan 26, 2024
@kyoz
Copy link
Owner

kyoz commented Jan 26, 2024

That's odd, i just using it today and it just work. Can you download this example and try if it showing in android export:

https://github.com/kyoz/godot-native-rating/tree/main/example/godot_4

@flashag
Copy link
Author

flashag commented Jan 26, 2024

I tried it but no luck. Even iOS doesn't show the plugin in the preset. But I've noticed there is no android folder in the example.

@kyoz
Copy link
Owner

kyoz commented Jan 26, 2024

Yup, you have to install Android Build Template your self, then there will be android/plugins folder for you to copy this plugin to.
Screenshot 2024-01-26 at 20 10 47
Also don't forget to check this in export window:
Screenshot 2024-01-26 at 20 11 30

@kyoz
Copy link
Owner

kyoz commented Jan 26, 2024

When ever you change godot version, you have to delete the android folder and Install Android Build Template over again.

@flashag
Copy link
Author

flashag commented Jan 26, 2024

The same with this example project :( It works for iOS but Android.

Here is the video:

rating.android.mp4

@kyoz
Copy link
Owner

kyoz commented Jan 26, 2024

Screenshot 2024-01-26 at 20 28 54
I just try it. It work as it should. Are you sure you downloaded the correct version for the plugin. You should download android-template-4.1.zip

If it still not work, you should try delete android folder, run Project -> Install Android Build Template.... Then copy the plugin again.

@flashag
Copy link
Author

flashag commented Jan 26, 2024

It just isn't working. I did what you said - no luck. I deleted Android preset and created new one - same. I tried to rename folder as "Rating", "rating", leave it as is - doesn't work. Changed renderer from Compatibility to Mobile - same.

I don't know what else it can be!

I have Godot version 4.1.1

@kyoz
Copy link
Owner

kyoz commented Jan 27, 2024

You don't have to create a folder for the plugin or change compatibility mode, just paste extracted content of the plugin directly in android/plugins folder.

Here is a exactly build for 4.1.1.
android-template-4.1.1.zip

@flashag
Copy link
Author

flashag commented Jan 27, 2024

Yeah I know. I mean it can be anything so I tried all the stuff but nothing helped. I tried build for 4.1.1 but nothing changes.
Can you please show me your build.gradle may be that's the problem.

@flashag
Copy link
Author

flashag commented Jan 27, 2024

Just an example: I added another plugin files to android/plugins and the plugin immediately appeared in export preset

@kyoz
Copy link
Owner

kyoz commented Jan 27, 2024

I though it was Godot version is error so i tried to install Godot 4.1.1 and the plugin still work normally (Tried with the example i send you before).
Screenshot 2024-01-27 at 20 20 51

I don't think it's by build.gradle but here is it.

// Gradle build config for Godot Engine's Android port.
buildscript {
    apply from: 'config.gradle'

    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath libraries.androidGradlePlugin
        classpath libraries.kotlinGradlePlugin
    }
}

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

apply from: 'config.gradle'

allprojects {
    repositories {
        google()
        mavenCentral()

        // Godot user plugins custom maven repos
        String[] mavenRepos = getGodotPluginsMavenRepos()
        if (mavenRepos != null && mavenRepos.size() > 0) {
            for (String repoUrl : mavenRepos) {
                maven {
                    url repoUrl
                }
            }
        }
    }
}

configurations {
    // Initializes a placeholder for the devImplementation dependency configuration.
    devImplementation {}
}

dependencies {
    implementation libraries.kotlinStdLib
    implementation libraries.androidxFragment

    if (rootProject.findProject(":lib")) {
        implementation project(":lib")
    } else if (rootProject.findProject(":godot:lib")) {
        implementation project(":godot:lib")
    } else {
        // Godot gradle build mode. In this scenario this project is the only one around and the Godot
        // library is available through the pre-generated godot-lib.*.aar android archive files.
        debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar', '*.aar'])
        devImplementation fileTree(dir: 'libs/dev', include: ['*.jar', '*.aar'])
        releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar', '*.aar'])
    }

    // Godot user plugins remote dependencies
    String[] remoteDeps = getGodotPluginsRemoteBinaries()
    if (remoteDeps != null && remoteDeps.size() > 0) {
        for (String dep : remoteDeps) {
            implementation dep
        }
    }

    // Godot user plugins local dependencies
    String[] pluginsBinaries = getGodotPluginsLocalBinaries()
    if (pluginsBinaries != null && pluginsBinaries.size() > 0) {
        implementation files(pluginsBinaries)
    }
}

android {
    compileSdkVersion versions.compileSdk
    buildToolsVersion versions.buildTools
    ndkVersion versions.ndkVersion

    compileOptions {
        sourceCompatibility versions.javaVersion
        targetCompatibility versions.javaVersion
    }

    kotlinOptions {
        jvmTarget = versions.javaVersion
    }

    assetPacks = [":assetPacks:installTime"]

    defaultConfig {
        // The default ignore pattern for the 'assets' directory includes hidden files and directories which are used by Godot projects.
        aaptOptions {
            ignoreAssetsPattern "!.svn:!.git:!.gitignore:!.ds_store:!*.scc:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
        }

        ndk {
            String[] export_abi_list = getExportEnabledABIs()
            abiFilters export_abi_list
        }

        manifestPlaceholders = [godotEditorVersion: getGodotEditorVersion()]

        // Feel free to modify the application id to your own.
        applicationId getExportPackageName()
        versionCode getExportVersionCode()
        versionName getExportVersionName()
        minSdkVersion getExportMinSdkVersion()
        targetSdkVersion getExportTargetSdkVersion()

        missingDimensionStrategy 'products', 'template'
    }

    lintOptions {
        abortOnError false
        disable 'MissingTranslation', 'UnusedResources'
    }

    ndkVersion versions.ndkVersion

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'

        // 'doNotStrip' is enabled for development within Android Studio
        if (shouldNotStrip()) {
            doNotStrip '**/*.so'
        }
    }

    signingConfigs {
        debug {
            if (hasCustomDebugKeystore()) {
                storeFile new File(getDebugKeystoreFile())
                storePassword getDebugKeystorePassword()
                keyAlias getDebugKeyAlias()
                keyPassword getDebugKeystorePassword()
            }
        }

        release {
            File keystoreFile = new File(getReleaseKeystoreFile())
            if (keystoreFile.isFile()) {
                storeFile keystoreFile
                storePassword getReleaseKeystorePassword()
                keyAlias getReleaseKeyAlias()
                keyPassword getReleaseKeystorePassword()
            }
        }
    }

    buildTypes {

        debug {
            // Signing and zip-aligning are skipped for prebuilt builds, but
            // performed for Godot gradle builds.
            zipAlignEnabled shouldZipAlign()
            if (shouldSign()) {
                signingConfig signingConfigs.debug
            } else {
                signingConfig null
            }
        }

        dev {
            initWith debug
            // Signing and zip-aligning are skipped for prebuilt builds, but
            // performed for Godot gradle builds.
            zipAlignEnabled shouldZipAlign()
            if (shouldSign()) {
                signingConfig signingConfigs.debug
            } else {
                signingConfig null
            }
        }

        release {
            // Signing and zip-aligning are skipped for prebuilt builds, but
            // performed for Godot gradle builds.
            zipAlignEnabled shouldZipAlign()
            if (shouldSign()) {
                signingConfig signingConfigs.release
            } else {
                signingConfig null
            }
        }
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
            aidl.srcDirs = ['aidl']
            assets.srcDirs = ['assets']
        }
        debug.jniLibs.srcDirs = ['libs/debug', 'libs/debug/vulkan_validation_layers']
        dev.jniLibs.srcDirs = ['libs/dev']
        release.jniLibs.srcDirs = ['libs/release']
    }

    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            output.outputFileName = "android_${variant.name}.apk"
        }
    }
}

task copyAndRenameDebugApk(type: Copy) {
    from "$buildDir/outputs/apk/debug/android_debug.apk"
    into getExportPath()
    rename "android_debug.apk", getExportFilename()
}

task copyAndRenameDevApk(type: Copy) {
    from "$buildDir/outputs/apk/dev/android_dev.apk"
    into getExportPath()
    rename "android_dev.apk", getExportFilename()
}

task copyAndRenameReleaseApk(type: Copy) {
    from "$buildDir/outputs/apk/release/android_release.apk"
    into getExportPath()
    rename "android_release.apk", getExportFilename()
}

task copyAndRenameDebugAab(type: Copy) {
    from "$buildDir/outputs/bundle/debug/build-debug.aab"
    into getExportPath()
    rename "build-debug.aab", getExportFilename()
}

task copyAndRenameDevAab(type: Copy) {
    from "$buildDir/outputs/bundle/dev/build-dev.aab"
    into getExportPath()
    rename "build-dev.aab", getExportFilename()
}

task copyAndRenameReleaseAab(type: Copy) {
    from "$buildDir/outputs/bundle/release/build-release.aab"
    into getExportPath()
    rename "build-release.aab", getExportFilename()
}

@kyoz
Copy link
Owner

kyoz commented Jan 27, 2024

Can you send me the full directory path where your project folder is? Sometime that maybe cause the problem.

@flashag
Copy link
Author

flashag commented Jan 27, 2024

my project is here:
/Users/user/Documents/Godot projects/Game Folder

and your example project here:
/Users/user/Downloads/Example

@kyoz
Copy link
Owner

kyoz commented Jan 29, 2024

Unfortunately, i still can't reprocedure your problem.Tried on all of my pc, laptop with various of Godot version but still doesn't face that issue. Are you tried other godot versions?

@flashag
Copy link
Author

flashag commented Jan 29, 2024

I will try, thanks! It's really weird because other plugins work just like that.
Can you please show me what the whole path to the plugin looks like in your case? Do you rename the extracted folder or something?

@kyoz
Copy link
Owner

kyoz commented Jan 29, 2024

That's why i told it really weird. Here is my full path:

Screenshot 2024-01-29 at 17 58 01

/Users/kyoz/Documents/Github/godot-plugins/godot-native-rating/example/godot_4/android/plugins

First i think maybe space in path may cause the problem, but as you showed, your example are in:

/Users/user/Downloads/Example

So it may not because of space. I'v used like every godot plugins in the github but i've never faced something like that @@.

Is there ary error in the Output when you restart Godot?

@flashag
Copy link
Author

flashag commented Jan 29, 2024

Ok, I admit I'm stupid enough. I finally solved it. When you extract the archive it gives you a folder, so I put the folder inside plugins folder, even though I should have put only files from extracted folder inside plugins folder. Just like you showed it.

Thank you once again! You have useful plugins, I'll def test them all!

P.S what do you think about a plugin for some analytics like Firebase but for Godot 4?

@kyoz
Copy link
Owner

kyoz commented Jan 29, 2024

No problem, bro. For analytics, because of something happen with google policy in the past which is very confused (for both dev and user), so i no longer using that. I just using Admob metric.

And of course, the main reason is that the SDK have some gap. Mean, when you using several plugins (like admob, firebase...etc.) It can cause conflict and will unable to build.

I'm still watching for it. I'll rewrite and maintain as much as Godot plugin as i can.

@flashag
Copy link
Author

flashag commented Jan 29, 2024

Awesome!

@flashag flashag closed this as completed Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants