duplicate class HollywoodDelegate

Please post anything related to the Hollywood APK Compiler here
Post Reply
amyren
Posts: 438
Joined: Thu May 02, 2019 11:53 am

duplicate class HollywoodDelegate

Post by amyren »

With apk compiler 5.0 I get this error when compiling
C:\Users\Admin\AppData\Local\AirsoftSoftwair\APKCompiler\com.amy66dev.dirtest\app\src\main\java\HollywoodDelegate.java:29: error: duplicate class: com.amy66dev.dirtest.HollywoodDelegate
public class HollywoodDelegate extends HollywoodActivity {

WHen browsing the project structure created by the compiler there are created two versions of the HollywoodDelegate.java file.

app/src/main/java/com/amy66dev/dirtest/HollywoodDelegate.java
app/src/main/java/HollywoodDelegate.java

I this corrrect?
amyren
Posts: 438
Joined: Thu May 02, 2019 11:53 am

Re: duplicate class HollywoodDelegate

Post by amyren »

Before coming as far as to the point I got that duplicate error, there was some other errors reported.
To get past those I had to use a custom gradle.build script like this

Code: Select all

plugins {
    alias(libs.plugins.android.application)
}

android {
    namespace = '%PACKAGE%'
    compileSdk {
        version = release(%COMPILESDK%)
    }

    defaultConfig {
        applicationId "%PACKAGE%"
        minSdk %MINSDK%
        targetSdk %TARGETSDK%

        versionCode %VERSIONCODE%
        versionName "%VERSION%"
	
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a"
        }
    }

    buildFeatures {
        viewBinding = true
    }
    
    lint {
        disable.add("Instantiatable")    
	abortOnError = false	
    }
    
    signingConfigs {
        release {
            storeFile file("%KEYSTORE%")
            storePassword "%KEYSTOREPWD%"
            keyAlias "%KEYALIAS%"
            keyPassword "%KEYALIASPWD%"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig = signingConfigs.release  	    
        }
    }      
    
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    
    sourceSets {
        main {
            java.srcDirs = ['src/main/java']         
        }
    } 
    
    externalNativeBuild {
        cmake {
            path "src/main/cpp/CMakeLists.txt"
        }
    }

    ndkVersion = "%NDKVERSION%"    
}

dependencies {
    implementation libs.appcompat
    implementation libs.androidx.documentfile
}
After that I got that duplicate HollywoodDelegate.java error.

Now, for testing I did try to rename my HollywoodDelegate.java into MyHollywoodDelegate.java, and also changed that in the java file itself

Code: Select all

public class MyHollywoodDelegate extends HollywoodActivity {

    private static final String TAG = "MyHollywoodDelegate";
Now it compiles with success, but the apk itself will fail as soon as it tries to use CallJavaMethod to call any of my own functions.
"Java method 'xxx' not found"
Post Reply