Security Exception after using encryption decryption library "robovm-rt-1.13.0" - android

I am using "robovm-rt-1.13.0" (an encryption-decryption library) in my android project. After encrypting when I try to build the project, I get the following error:
Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
java.lang.SecurityException: Prohibited package name: java.lang
And below is my build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "com.athansys.patient.athansys"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
cruncherEnabled = false
}
}
repositories {
maven { url "https://jitpack.io" }
}
ext {
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.2'
compile 'com.google.code.gson:gson:2.7'
compile project(':robovm-rt-1.13.0')
}
Could someone help me sort this issue.
Thanks in advance!

You cannot use java or javax as the name of your package. Replace it to something else.
java.lang.SecurityException: Prohibited package name: java
Edit: Move your Main.java file in a (source) directory that doesn't start with java or javax and use the directory structure names to change your package name in the code.
No problems with Dependencies .

Related

AndroidAnnotations can not find Android Manifest when compile

I am working at Windows 7 OS, Android Studio. After compiling AndroidAnnotation framework, I can not compile project. Right during the process of compiling it responds with "Error:Could not find the AndroidManifest.xml file, using generation folder"
My gradle file is:
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.falcodeceo.beautifulmind"
minSdkVersion 16
targetSdkVersion 24
versionCode 23
versionName "2.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.android.support:palette-v7:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.eightbitlab:blurview:1.1.2'
compile 'org.androidannotations:androidannotations:4.1.0'
}
Looked through some answers but can not apply it, as I do not understand how it works. So I will be thankful if you explain how it all goes.
You miss some necessary configuration. Just add following parts to your Gradle file
buildscript {
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
apply plugin: 'android-apt'
dependencies {
apt "org.androidannotations:androidannotations:4.1.0"
}
apt {
arguments {
androidManifestFile variant.outputs[0]?.processResources?.manifestFile
}
}
More details can be found at androidannotations wiki https://github.com/excilys/androidannotations/wiki/Building-Project-Gradle

Error In Notification Parse

Please Help
This Error
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/parse/ParseFacebookUtils$1.class
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.eaglegroup.hmusic"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile files('libs/Parse-1.12.0.jar')
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
}
And This ScreenShot
http://upload7.ir/u/preview/s1/GMUCEmdE.png
I had the same problem that happened to you. I solved it by doing the following steps.
In your project's app/libs folder, remove the below files and folder.
ParseFacebookUtilsV3-1.10.4-javadoc (It's a folder)
ParseFacebookUtilsV3-1.10.4.jar (An Executable jar file)
ParseFacebookUtilsV3-1.10.4.jar.properties (A Properties file)
By doing this, I solved mine. I think this should help.

Problems with dependencies. Integrating MapBox in Android Studio

I have some problems with integration MapBox SDK into my project.
Here is description how to add dependency into Gradle:
https://www.mapbox.com/mapbox-android-sdk/#gradle
So, I should add this into my build.gradle:
repositories {
mavenCentral()
}
dependencies {
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4#aar'){
transitive=true
}
}
After that my build.gradle looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.samusko.journeyproject"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:cardview-v7:22.1.1'
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4#aar'){
transitive=true
}
}
When I compile this I have this error:
Error:Failed to resolve: com.android.support:support-v4:22.2.0
I don't know what is wrong :(.
Please help me to resolve this error..
You are missing this line in the gradle file, put it before the "com.mapboxsdk:..." line (the support libraries you used were too old):
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
##### begin fix
# modified 2.1.1 to 2.2.0
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
##### end fix
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.4#aar'){
transitive=true
}
}
Note that this version of MapBox is no longer supported upstream. They deprecated it, even tough (IMHO) as I am writing this message the new API is not usable enough.

Wrong xml being inflated android

I have a library project which had colliding xml names like activity_login,etc..
Now even though this is the case when I run the Actvity in the library project is inflating my xml instead of its own and subsequently throwing NPE.
I've already tried giving it the fully qualified R file name but it still seems to be inflating the wrong file.
Ps:I've tried clean build doesnt work either on AS1.2.1.1.
Is this a bug of AS or am I doing something wrong
Here is my gradle file
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.xxx"
minSdkVersion 14
targetSdkVersion 21
versionCode 17
versionName "2.4.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.google.android.gms:play-services:6.5.+'
compile 'com.android.support:support-v4:21.0.+'
compile 'com.android.support:recyclerview-v7:22.0.+'
compile 'com.android.support:cardview-v7:21.0.+'
compile project('libraries:holograph')
compile project('libraries:facebook')
compile files('libs/google-api-client-android-1.18.0-rc.jar')
compile files('libs/google-api-client-java6-1.18.0-rc.jar')
compile files('libs/google-api-client-1.18.0-rc.jar')
compile 'com.crashlytics.android:crashlytics:1.+'
compile project(':chartlib')
compile project(':payu')
}
And build.gradle of payu is
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 2
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile('de.keyboardsurfer.android.widget:crouton:1.8.+#aar') {
exclude module: 'support-v7'
compile 'com.android.support:appcompat-v7:18.0.+'
}
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'de.greenrobot:eventbus:2.2.1'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.mobsandgeeks:android-saripaar:1.0.3'
compile project(':CustomBrowser')
}
And my Settings.gradle
include ':app', ':payUMoneysdk', ':CustomBrowser'
This is happening by design, consider it as overriding the library activity layout. I use it extensively for Strings, Colors etc. where it's more useful.
Just rename your projects XML layouts.

Android Studio gives me Execution failed for task ':library:proguardRelease' error after updating to Android Studio 1.0.1

I updated my Android Studio to 1.0.1. I followed this tutorial http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0 and changed from runProguard to minifyEnabled true. I also changed it in my library project. When I tried to compile it gave me Error:Execution failed for task ':> java.io.FileNotFoundException: ProjectName\library\proguard-rules.txt (The system cannot find the file specified). I researched for that and I found a solution. I added blank proguard-rules.txt file into that folder. After trying to compile, it gave me even more errors. The main error now was that it cannot find symbol class PageIndicator, which is my library's class. I don't even know what can I do for that.
My project's build.gradle:
apply plugin: 'android'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.miesto.meniu"
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
compile files('libs/volley.jar')
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.0#aar'
compile('com.google.api-client:google-api-client-xml:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.apis:google-api-services-drive:v2-rev105-1.17.0-rc'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}
My library's build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.0'
}
What am I doing wrong?
I solved this problem when I deleted my library and added it again.

Categories

Resources