gpt4 book ai didi

android - 我的项目文件未包含在 apk 中

转载 作者:行者123 更新时间:2023-11-29 01:30:00 26 4
gpt4 key购买 nike

我总是收到 java.lang.ClassNotFoundException: ru.ooolpi.lpiapp.ui.activity.MainActivity。但是我有这样的课。后来发现我的工程文件apk不见了。

我的构建脚本:

buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
// classpath 'org.robolectric.gradle:gradle-android-test-plugin:0.10.1'
//classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
}
}
//apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

repositories {
maven { url 'https://github.com/donnfelker/mvn-repo/raw/master/' }
maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
jcenter()
}

dependencies {
compile 'com.android.support:multidex:1.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.squareup.dagger:dagger:1.2.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup:otto:1.3.8'
apt 'com.squareup.dagger:dagger-compiler:1.0.1'
}

android {
compileSdkVersion 22
buildToolsVersion "21.1.2"

defaultConfig {
//applicationId "ru.ooolpi.lpiapp"
minSdkVersion 10
targetSdkVersion 22
versionCode 2
versionName "1.0.1"
multiDexEnabled true
}
packagingOptions {
// Exclude file to avoid
// Error: Duplicate files during packaging of APK
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/notice.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude '.readme'
}
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
signingConfigs {
release {
storeFile file('../devcert.jks')
storePassword '123456'
keyAlias 'dev'
keyPassword '123456'
}
}
lintOptions {
//disable 'InvalidPackage'
abortOnError false
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
zipAlignEnabled true // this is default for release
}
debug {
applicationIdSuffix '.debug'
minifyEnabled false
}
}
}

我尝试使用 Android Studio 和 gradlew 进行构建。结果是一样的——我的文件没有包含在 apk 中。

更新:我的项目结构

project structure

最佳答案

查看您的混淆器配置文件。

确保您没有剥离您在 apk 中使用的任何类。要手动保留类,请添加以下行:

-keep class ru.ooolpi.lpiapp.** { *; }
-dontwarn ru.ooolpi.lpiapp.**

关于android - 我的项目文件未包含在 apk 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31722799/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com