Android Notes

maven 版本发布

1、小于 AGP7+

使用 maven 插件

groovy 复制代码
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 插件

groovy 复制代码
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

问题

groovy 复制代码
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

解决

groovy 复制代码
 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 命令可以实现

js 复制代码
@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
相关推荐
太空漫步112 小时前
android社畜模拟器
android
海绵宝宝_5 小时前
【HarmonyOS NEXT】获取正式应用签名证书的签名信息
android·前端·华为·harmonyos·鸿蒙·鸿蒙应用开发
凯文的内存6 小时前
android 定制mtp连接外设的设备名称
android·media·mtp·mtpserver
天若子7 小时前
Android今日头条的屏幕适配方案
android
林的快手8 小时前
伪类选择器
android·前端·css·chrome·ajax·html·json
望佑8 小时前
Tmp detached view should be removed from RecyclerView before it can be recycled
android
xvch11 小时前
Kotlin 2.1.0 入门教程(二十四)泛型、泛型约束、绝对非空类型、下划线运算符
android·kotlin
人民的石头14 小时前
Android系统开发 给system/app传包报错
android
yujunlong391915 小时前
android,flutter 混合开发,通信,传参
android·flutter·混合开发·enginegroup
rkmhr_sef15 小时前
万字详解 MySQL MGR 高可用集群搭建
android·mysql·adb