how to integrate OpenCameraApp in my project as a module - android

I have integrated This project as a module in my applictaion. When I am integrating, getting error as mentioned below. I have got so many links on SO suggesting me to downgrade studio version, or upgrade etc. Followed this for adding module in my project.
com.android.ide.common.process.ProcessException: Error while executing
'E:\Softwares\sdk1\build-tools\25.0.3\llvm-rs-cc.exe' with arguments {-O 3 -
I E:\Softwares\sdk1\build-tools\25.0.3\renderscript\include\ -I
E:\Softwares\sdk1\build-tools\25.0.3\renderscript\clang-include\ -p D:\SVN-
WORKS\MyApplication\openCamera\build\generated\source\rs\release -o D:\SVN-
WORKS\MyApplication\openCamera\build\generated\res\rs\release\raw -target-
api 15 D:\SVN-WORKS\MyApplication\openCamera\src\main\rs\align_mtb.rs
D:\SVN-WORKS\MyApplication\openCamera\src\main\rs\create_mtb.rs D:\SVN-
WORKS\MyApplication\openCamera\src\main\rs\histogram_adjust.rs D:\SVN-
WORKS\MyApplication\openCamera\src\main\rs\histogram_compute.rs D:\SVN-
WORKS\MyApplication\openCamera\src\main\rs\process_hdr.rs}

Here is the answer for the possible difficulties which you will face while adding a project as module/library in another application.
follow this video tutorial for adding a project as module/library.
Below are some points which you need to consider.
Change very first line of your build.gradle(library) from "apply plugin: 'com.android.application' " to "apply plugin: 'com.android.library' "
Remove applicationId from build.gradle(library)
Make sure build.gradle(app) and build.gradle(library) should be exactly same.
like below
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.xyz.xyzxyz"
minSdkVersion 7
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':openCamera')
compile fileTree(dir: 'libs', include: ['*.jar'])
}
build.gradle(library)
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.android.support:appcompat-v7:22.0.0'
}
If both your application as well as your library module has the MainActivity and activity_main.xml file, then make changes either in app or library. Because you may get rumTime error like binary xml error at #40(lineNumber) etc.
Your android studio version and project level gradle dependency should have same verion. Like if your studio version is 2.3.1 then dependeny block should have " classpath 'com.android.tools.build:gradle:2.3.1' "
Last but not least,delete tag of your library's mainActivity from library's manifest file. code looks like below. If you don't delete or comment it then two launchers will be there in your project and it will create two icons.
<!-- Comment or delete tag to avoid two launchers in your application -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

Related

package name is not determined in android studio

i am using Android studio 1.5. and at when i click run i receive
unable to determine package name
i checked the manifest file and it is as shown in the image below...but i do not know why the activities are marked with red even the app name and the icon
as well.
please let me know how to fix this
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.com.bt_11"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
}
I followed the same steps as user2121 and eventually tried downgrading to Android Studio 1.4.1. Unlike user2121, I still got an error, however it was different than when on 1.5.1.
AndroidManifest.xml file not found
Upon searching for this new error, I found this StackOverflow answer which solved the problem for me on 1.5.1 as well as 1.4.1.

How to implement Robobinding in android app

I'm trying to implement the MVVM architecture using Robobinding. Here's the link I'm following for the Environment setup of Robobinding in Android Studio(without AspectJ):
http://robobinding.github.io/RoboBinding/getting_started.html#_android_studio
This is what my app level Build.gradle looks like after adding the dependencies:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.simpletimerapp"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile "org.robobinding:robobinding:${robobindingVersion}"
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.+'
}
}
The problem is gradle build fails with the following error:
Error:(26, 0) Could not find property 'robobindingVersion' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated#2ccd2d42.
Open File
EDIT 1:
On replacing ${robobindingVersion} in the dependencies block with 0.8.12 (latest version of robobinding), gradle build finishes successfully. But now, I'm unable to use the "bind" attribute in the views in my layout files. This is the error:
Unexpected namespace prefix "bind" found for tag TextView
EDIT 2:
Still can't find the solution. So, I downloaded this minimal android app (from their official github page) which implements robobinding and edited it to create my own app. It's working fine now.

Unable to use github library in Android Studio

I want to use this library in a project in Android Studio, so as mentioned in read me, I created new project in the Android Studio and added dependencies in build.gradle file inside the app folder as:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.mycompany.swipe_instagram"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.lorentzos.swipecards:library:1.0.8#aar'
}
Then when I sync I started getting this error as:
I have Searched on the google and stack overflow but can't find any appropriate solution.
I used your "build.gradle" file and it is working fine for me (both with and without "aar"). Could be something wrong with the cache. Try "File -> Invalidate Caches / Restart"). Another way to generate more error message detail is to try building the module from the command line and getting verbose output
gradle -info compileDebugSources
You'll get lots of output which should give you a hint as to what's going wrong

INSTALL_FAILED_OLDER_SDK on Android Studio because of Android L [duplicate]

I'm new to Android and I'm using the Android Studio. I've created a new project just to show the Hello World! but I can't get it working on the AVD because of this error: Failure [INSTALL_FAILED_OLDER_SDK].
I already searched for the answer and I know it's something about the build.gradle and the minSdkVersion but any of the answers worked for me.
This is my AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.scoelli.test" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MyActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And this is my build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.scoelli.test"
minSdkVersion 8
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
I would appreciate not only the answer but the explanation.
Thank You!
Unless you know you want to be using the Android L developer preview with your application, do not target and compile with it. It is still very much a preview release, and it appears as though applications targeting and compiling for the preview cause this error with any non-L device.
Update these lines in your build.gradle to stick with the latest stable release (Android 4.4, API 19):
android {
compileSdkVersion 19
defaultConfig {
targetSdkVersion 19
}
}
I fixed this problem.
I just modified the compileSdkVersion from android_L to 19
to target my nexus 4.4.4.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
}
android {
**compileSdkVersion 'android-L'** modified to 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.antwei.uiframework.ui"
minSdkVersion 14
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
**compile 'com.android.support:support-v4:21.+'** modified to compile 'com.android.support:support-v4:20.0.0'
}
how to modified the value by ide.
select file->Project Structure -> Facets -> android-gradle and then modified the compile Sdk Version from android_L to 19
sorry I don't have enough reputation to add pictures
I think projects with
compileSdkVersion 'android-L'
cannot be installed in other Android versions right now.
I might be wrong there but if you're not doing anything specific to the L preview SDK, just set the compile version to one of the official ones.
Same goes for the targetSdk.
You can choose those in the Create Project wizard.
If you get this error when compiling Adobe AIR mobile app - just correct "minSdkVersion" this line in the application descriptor xml file:
<uses-sdk android:minSdkVersion="13" android:targetSdkVersion="15"></uses-sdk>

Failure [INSTALL_FAILED_OLDER_SDK] Android Studio

I'm new to Android and I'm using the Android Studio. I've created a new project just to show the Hello World! but I can't get it working on the AVD because of this error: Failure [INSTALL_FAILED_OLDER_SDK].
I already searched for the answer and I know it's something about the build.gradle and the minSdkVersion but any of the answers worked for me.
This is my AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.scoelli.test" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MyActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And this is my build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.scoelli.test"
minSdkVersion 8
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
I would appreciate not only the answer but the explanation.
Thank You!
Unless you know you want to be using the Android L developer preview with your application, do not target and compile with it. It is still very much a preview release, and it appears as though applications targeting and compiling for the preview cause this error with any non-L device.
Update these lines in your build.gradle to stick with the latest stable release (Android 4.4, API 19):
android {
compileSdkVersion 19
defaultConfig {
targetSdkVersion 19
}
}
I fixed this problem.
I just modified the compileSdkVersion from android_L to 19
to target my nexus 4.4.4.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
}
android {
**compileSdkVersion 'android-L'** modified to 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.antwei.uiframework.ui"
minSdkVersion 14
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
**compile 'com.android.support:support-v4:21.+'** modified to compile 'com.android.support:support-v4:20.0.0'
}
how to modified the value by ide.
select file->Project Structure -> Facets -> android-gradle and then modified the compile Sdk Version from android_L to 19
sorry I don't have enough reputation to add pictures
I think projects with
compileSdkVersion 'android-L'
cannot be installed in other Android versions right now.
I might be wrong there but if you're not doing anything specific to the L preview SDK, just set the compile version to one of the official ones.
Same goes for the targetSdk.
You can choose those in the Create Project wizard.
If you get this error when compiling Adobe AIR mobile app - just correct "minSdkVersion" this line in the application descriptor xml file:
<uses-sdk android:minSdkVersion="13" android:targetSdkVersion="15"></uses-sdk>

Categories

Resources