Android Notes

在这里插入图片描述

maven 版本发布

1、小于 AGP7+

使用 maven 插件

apply plugin: 'maven'
uploadArchives {
    repositories {
        mavenDeployer {
            pom.groupId = GROUP_ID
            pom.artifactId = ARTIFACT_ID
            pom.version = VERSION
            //正式版本
            repository(url: RELEASE_URL) {
    			authentication(userName: userName, password: pwd)
			}
			//快照版本
			snapshotRepository(url: SNAPSHOT_URL) {
			    authentication(userName: userName, password: pwd)
			}
        }
    }
}

2、大于等于 AGP7+

Goodle Android

使用 maven-publish 插件

plugins {
    id 'maven-publish'
}


afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
                groupId = GROUP_ID
                artifactId = ARTIFACT_ID
                version = "$sample_version"
            }
        }

        repositories {
            maven {
            	//如果仓库地址是 http,https 则不需要
                allowInsecureProtocol true
                url 'http://****/repository/primer-snapshot'
                credentials {
                    username "123456"
                    password "123456"
                }
            }
        }
    }
}

More than one file was found with OS

问题

Execution failed for task ':app:mergeCommonReleaseNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'lib/x86/liblog.so'.
If you are using jniLibs and CMake IMPORTED targets,
see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake

解决

 defaultConfig {
    packagingOptions {
        exclude 'lib/x86_64/liblog.so'
        exclude 'lib/x86/liblog.so'
        exclude 'lib/arm64-v8a/liblog.so'
        exclude 'lib/armeabi-v7a/liblog.so'
    }
}

导出设备安装包

实现比较简单,前提是已安装 adb,利用 adb pm、adb pull 命令可以实现

在这里插入图片描述

@echo
echo Please wait while the script is executing ... ... 

for /f "tokens=2 delims=:" %%a in ('adb shell pm list packages') do (
	for /f "tokens=2 delims=:" %%p in ('adb shell pm path %%a') do (
		adb pull %%p . > null
	)
)

echo The execution is complete.
pause

  • 9
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值