0

I get this error while trying to build a project on Android Studio. It happens when trying to compress the final artifact with a binary file on res/raw/file.dat.

The solution like explained here: Maven corrupting binary files in source/main/resources when building jar

Is to add the file or res/raw folder to a "false" filtering on build. But the problem is that i configure my internal maven repository with JFrog Articatory following this: https://inthecheesefactory.com/blog/how-to-setup-private-maven-repository/en

The question: How to convert this:

 <project>
      <build>
          <resources>
              <resource>
                  <directory>${basedir}/src/main/resources/lib</directory>
                  <filtering>false</filtering>
              </resource>
          </resources>
          <plugins>
              ...
          </plugins>
      </build>
</project>   

Into gradle style:

def libraryGroupId = 'XXXXXXX'
def libraryArtifactId = 'XXXXXX'
def libraryVersion = '0.0.1'

publishing {
    publications {
        aar(MavenPublication) {
            groupId libraryGroupId
            version libraryVersion
            artifactId libraryArtifactId

            artifact("$buildDir/outputs/aar/${artifactId}-release.aar")
        }

    }

}

artifactory {
    contextUrl = 'XXXXXXXXXX'
    publish {
        repository {
            repoKey = 'libs-release-local'

            username = artifactory_username
            password = artifactory_password
        }
        defaults {
            publications('aar')
            publishArtifacts = true


            properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'core']
            publishPom = true
        }
    }

I've tried using pom.xml but it kepts saying does not recognized TAG project in .xml file.

Thanks!!!

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433

1 Answers1

1
android {
    sourceSets {
        main {
            assets.srcDirs = ['src/main/res/raw']
        }
    }
}
Dennis van Dalen
  • 589
  • 4
  • 13